日志 boost::log source core sink ACL log golang 参考资料 https://www.boost.org/doc/libs/1_65_1/libs/log/doc/html/index.html boost::log库学习 ...
分类:
其他好文 时间:
2020-07-18 15:59:39
阅读次数:
62
安装请参考官方资料-快速开始,安装gRPC需要安装Go、protocol buffer、protoc-gen-go、gRPC等。 1.安装Go,grpc是用Golang开发的,所以需要安装Go; 2.下载protocol buffer,这是gRPC的协议编译工具,写好proto之后,需要用这个编译。... ...
分类:
其他好文 时间:
2020-07-18 15:29:40
阅读次数:
101
部署说明:环境说明:组件版本下载地址Prometheus2.6.1https://prometheus.io/download/#prometheusgo1.11.4https://golang.org/dl/Grafana5.4.2https://dl.grafana.com/oss/release/grafana-5.4.2-1.x86_64.rpm安装go解压安装:[root@cs-linf
分类:
其他好文 时间:
2020-07-15 23:36:06
阅读次数:
152
代码 https://github.com/smallinsect/MyGo/tree/master/myjson MyUsers.json文件内容 { "name": "小昆虫", "age": 2233, "account_id": "2222222aaaaa", "password": "** ...
分类:
Web程序 时间:
2020-07-15 22:56:01
阅读次数:
155
汉诺塔问题 golang 递归 实现经典汉诺塔问题 汉诺塔动画演示 // 从A-->C ,借助B func hanota(A []int, B []int, C []int) []int { n := len(A) helpHanota(n, &A, &B, &C) return C } func ...
分类:
其他好文 时间:
2020-07-14 16:34:30
阅读次数:
56
对于docker 来说init 进程的管理很重要,以下是几个不错的选择 tini 参考资料https://github.com/krallin/tini dumb-init 参考资料https://github.com/Yelp/dumb-init docker 自己的init 启动的时候添加 -- ...
分类:
系统相关 时间:
2020-07-13 21:57:45
阅读次数:
119
关键性数据结构 hmap: map 的 header结构 bmap: map 的 bucket结构 mapextra: map 的 拓展结构 不是每一个map都包含 golang map 是用 hash map实现的,首先,我们先看 hash map是怎么实现的;然后我们再看 golang map ...
分类:
其他好文 时间:
2020-07-13 13:33:53
阅读次数:
54
file ,err :=os.Open("d:\\aaa.txt") // 打开文件句柄 if err!=nil{ fmt.Println("打开文件出错") }else { fmt.Println("文件存在") } read := bufio.NewReader(file) // 创建文件读取对 ...
分类:
其他好文 时间:
2020-07-13 13:26:03
阅读次数:
97
golang操作redis主要有两个库,go-redis和redigo。两者操作都比较简单,区别上redigo更像一个client执行各种操作都是通过Do函数去做的,redis-go对函数的封装更好,相比之下redigo操作redis显得有些繁琐。但是官方更推荐redigo,所以项目中我使用了red ...
分类:
其他好文 时间:
2020-07-12 19:02:06
阅读次数:
99