Azure Monitoring

Submitted by Lizhe on Fri, 11/20/2020 - 08:36

Azure 的 Monitoring 做的还是挺有意思的,尤其是可以从 Prometheus 端点直接读数据这个 

insights 侵入性好像有点强,不知道能不能像 istio 自动注入,如果能自动注入的话应该还可以

202011201638000

OpenAPI 5

Submitted by Lizhe on Thu, 11/19/2020 - 05:58

 

上一个例子中使用的是 Parameters

这里尝试一下 request body

抛开 go-swagger不谈,直接使用 swagger 应该是下面的样子

20201119015854

 

 

openapi: 3.0.0

info:

  description: |

    This is a sample Petstore server.  You can find

    out more about Swagger at

OpenAPI 4

Submitted by Lizhe on Wed, 11/18/2020 - 07:26

go-swagger 会自动查找程序 main 函数入口

然后生成对应的 swagger 文档

也就是说,endpoint 入口是可以,也应该被分开写在不同文件内的

main.go

 

// Package Helloworld API.

//

// The purpose of this service is to provide an application

// that is using plain go code to define an API

OpenAPI 3

Submitted by Lizhe on Wed, 11/18/2020 - 05:38

这里有一个复杂的例子

 

/ Package Helloworld API.

//

// The purpose of this service is to provide an application

// that is using plain go code to define an API

//

OpenAPI 2

Submitted by Lizhe on Tue, 11/17/2020 - 08:02

启动Swagger的本地服务器最简单的办法就是 docker

docker pull swaggerapi/swagger-editor

docker run --rm -p 80:8080 swaggerapi/swagger-editor

 

20201117035645

因为实在不喜欢 Java , 这里用 golang 做一个例子

swagger文档的 info 信息,写在package 之前

// Package Helloworld API.

//

OpenAPI 1

Submitted by Lizhe on Tue, 11/17/2020 - 02:15

OpenAPI ( OAS ) 是一个语言无关的 RESTful API 接口规范,

数据类型

OAS 使用几种已知的 format 格式来详细定义所使用的 type 数据类型。

20201117101817

OpenAPI的 根对象

Gitflow 2

Submitted by Lizhe on Wed, 11/11/2020 - 02:41

这一次我们试试 sourcetree 对 Git flow 的支持,不用命令行了 ,毕竟日常工作也不能天天命令行

 

20201111105450

 

20201111125148

 

Gitflow 1

Submitted by Lizhe on Tue, 11/10/2020 - 06:58

关于Gitflow本身,这里先不说了,请参考

https://www.jianshu.com/p/41910dc6ef29

这里重点是尝试一下工具的使用

 

  1. brew install git-flow

20201110030144

然后克隆repo

git clone https://pactera-lizhe@bitbucket.org/pactera-lizhe/hellogitflow.git

 

cd 到 项目文件夹下后, 初始化

 

Github build golang docker image

Submitted by Lizhe on Tue, 10/20/2020 - 10:23

 

name: Docker Image CI

 

on:

  push:

    branches: [ master ]

  pull_request:

    branches: [ master ]

 

jobs:

 

  build:

 

    runs-on: ubuntu-latest

 

    steps:

    - uses: actions/checkout@v2

 

    - name: Build and Push Docker Iamge

      uses: docker/build-push-action@v1

      with: 

        username: ${{ secrets.username }}

        password: ${{ secrets.password }}

CircleCI build golang docker image

Submitted by Lizhe on Tue, 10/20/2020 - 10:20

 

version: 2

jobs:

  build:

    docker:

      - image: golang:alpine3.12

        auth:

          username: libaibai

          password: $password

 

    steps:

      - checkout

      - setup_remote_docker:

          version: 19.03.13

          docker_layer_caching: false

      - run:

          name: Install Docker client

          command: apk add docker-cli

      - run: |

          TAG=0.1