上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 45 下一页
摘要: RBAC介绍 在Kubernetes中,所有资源对象都是通过API进行操作,他们保存在etcd里。 而对etcd的操作我们需要通过访问 kube-apiserver 来实现,上面的Service Account其实就是APIServer的认证过程,而授权的机制是通过RBAC:基于角色的访问控制实现。 阅读全文
posted @ 2023-01-08 07:00 厚礼蝎 阅读(130) 评论(0) 推荐(0)
摘要: 给结构体实现String() sting方法,方便按照我们想看的方式打印出来fmt.Println(),类似与python的__str__和__repr__ package main_test import ( "fmt" "github.com/bytedance/sonic" "testing" 阅读全文
posted @ 2023-01-08 06:39 厚礼蝎 阅读(173) 评论(0) 推荐(0)
摘要: package main import ( "encoding/json" "log" "strings" ) type Status int8 // 定义常量 const ( UP Status = iota + 1 // 从1开始 DOWN RUNNING PENDING ERROR ) // 阅读全文
posted @ 2023-01-08 06:37 厚礼蝎 阅读(45) 评论(0) 推荐(0)
摘要: github.com/go-playground/validator 范围约束 对于字符串、切片、数组和map,约束其长度。 len=10, min=6, max=10, gt=10。 对于数值,约束其取值。 min, max, eq, ne, gt, gte, lt, lte, oneof=6 8 阅读全文
posted @ 2023-01-08 06:35 厚礼蝎 阅读(400) 评论(0) 推荐(0)
摘要: 实现MarshalJSON() ([]byte, error) 方法 ,序列化后可以把原来的枚举数转化为枚举数对应的字符串 实现UnmarshalJSON([]byte) error方法,可以把byte中的枚举的字符串转化为对应枚举字符串的枚举数 实现String() string方法,方便按照我们 阅读全文
posted @ 2023-01-08 06:33 厚礼蝎 阅读(251) 评论(0) 推荐(0)
摘要: 使用命令启动服务 例如 初始化 vblog-api init 启动服务 vblog-api start -f etc/confit.toml 版本号 vblog-api -v 需要借助一个强大的CLI库 Cobra https://github.com/spf13/cobra 安装 go get - 阅读全文
posted @ 2023-01-08 06:18 厚礼蝎 阅读(49) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2023-01-07 22:13 厚礼蝎 阅读(3) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2023-01-07 21:36 厚礼蝎 阅读(7) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2023-01-04 07:16 厚礼蝎 阅读(7) 评论(0) 推荐(0)
摘要: 内存的监控 $ free total used free shared buffers cached Mem: 16402432 16360492 41940 0 465404 12714880 -/+ buffers/cache: 3180208 13222224 Swap: 8193108 26 阅读全文
posted @ 2023-01-04 06:54 厚礼蝎 阅读(97) 评论(0) 推荐(0)
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 45 下一页