-
Notifications
You must be signed in to change notification settings - Fork 0
Library and Tool
Go Package
-
sqlc : 根据SQL直接生成go代码
-
swag : 通过go的注释生成swag. 注意的点,对于嵌套过深的struct不要直接暴露,比如kubernetes的metadata
-
samber/lo: similar lodash, base on generic
-
spf13/cast: 类型转换
-
tidwall/gjson: 用jsonpath获取值
-
Viper: 配置工具
-
Cobra: 命令行工具
-
bxcodec/faker: generate mock data with struct tag
-
Validaor: https://github.com/go-playground/validator
custom message
https://medium.com/@apzuk3/input-validation-in-golang-bc24cdec1835
-
alice: https://github.com/justinas/alice middleware chaining
-
https://github.com/getkin/kin-openapi 基于openapi v3验证json schema
-
goreplay: https://github.com/buger/goreplay/wiki/Capturing-and-replaying-traffic capture and replay traffic
-
req:
github.com/imroc/req
http client -
caarlos0/env: read env variable
-
httpexpect: https://github.com/gavv/httpexpect test http request
-
go-linq: 仿c# linq
-
yaml的坑
"gopkg.in/yaml.v2"
和"sigs.k8s.io/yaml"
k8s yaml空值会返回null, yaml.v2会返回[] k8s yaml能识别json tag
Kubernetes Tool
- Velero: 备份资源
- k9s: 命令行工具
Document Related:
Command Line Tool:
- https://explainshell.com/ : shell 命令解析
- jq: 解析json. jq cookbook.
- yq: 解析yaml
- xargs: 常用的命令行分割工具。
DevOps
-
Concept
- GitOps: 传统的CD多为push模式,GitOps CD则为pull模式.
- CI/CD: 关于CI/CD,注重的是理念,工具本身并不是最主要的,就算没有工具用最传统的命令行也是能够达成目标的。
-
IaC Tool:
- pulumi: 相比Terraform用HAC的DSL, pulumi直接用代码控制infrastructure
- CloudFormation
- Terraform
- Packer: VM Image构建工具。大概原理:(AWS AMI例子)先launch Instance, 然后运行所有的命令, 最后对instance创建snapshot。
- Vault: 常见的sensitive data store
- AWS CDK
-
CI/CD Tool:
- Gitlab CI: 依托于gitlab平台,基于.gitlab-ci.yaml运行。
测试工具
- microcks: 根据文档生成mock server, 可以部署在kubernetes上
- Testcontainers: 用代码控制container. Golang Package
- BATS: assert shell script. Docs. assert doc. 安装方式git submodule. 用run运行命令,可以防止函数因为exit 1,导致测试失败.
- terratest: 测试infrastructure. 实现: 对于没有API的工具,封装工具命令行。对于有API的工具,封装API.
Images:
生产力工具:
- taskfile: 基本可以替代makefile
- tilt
其他工具:
- Vagrant: 虚拟机构建工具