上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要: ## example1```gotype MyStruct struct { A int B int}var sizeOfMyStruct = int(unsafe.Sizeof(MyStruct{}))func MyStructToBytes(s *MyStruct) []byte { var x reflect.SliceHeader x.Len = sizeOfMyS... 阅读全文
posted @ 2020-06-04 09:58 白云辉 阅读(8404) 评论(0) 推荐(0) 编辑
摘要: ```gotype MemStats struct { // 已分配的对象的字节数. // // 和HeapAlloc相同. Alloc uint64 // 分配的字节数累积之和. // // 所以对象释放的时候这个值不会减少. TotalAlloc uint64 // 从... 阅读全文
posted @ 2020-06-02 14:13 白云辉 阅读(309) 评论(0) 推荐(0) 编辑
摘要: ```gofunc WithTimeout(dur time.Duration, fn func() error) error { var ch = make(chan error, 1) go time.AfterFunc(dur, func() { ch <- errors.New("函数执行超时: " + pkg.Caller.FromFunc(reflect.ValueOf(fn))) ... 阅读全文
posted @ 2020-06-02 09:20 白云辉 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: 1. 一个OpenResty lua模块,可以在etcd和Kubernetes中使用上游配置。 1. https://github.com/rrfeng/lua-resty-upstream-etcd 2. 用于OpenResty的lua模块可以动态更新etcd和kubernetes的上游。 从etcd或kubernetes apiserver进行上游实时更改,而无需重新... 阅读全文
posted @ 2020-05-29 11:24 白云辉 阅读(1508) 评论(0) 推荐(0) 编辑
摘要: ```gopackage mainimport ( "context" "fmt" "github.com/cloudflare/tableflip" "io" l "log" "net/http" "os" "os/signal" "syscall" "time")var log = l.New(os.Stderr, "", l.LstdFlags|l.Llongfile)f 阅读全文
posted @ 2020-05-27 14:46 白云辉 阅读(739) 评论(0) 推荐(0) 编辑
摘要: go benchmark 性能测试, 基准测试, 单元测试, 覆盖测试 编写基准测试 http://localhost:8081/ui/flamegraph go go test v bench=. benchmem main_test.go go test v bench=BenchmarkTri 阅读全文
posted @ 2020-05-27 11:24 白云辉 阅读(5548) 评论(0) 推荐(0) 编辑
摘要: ## 2020-05-181. kubesphere 1. KubeSphere 是在 Kubernetes 之上构建的以应用为中心的企业级分布式容器平台,提供简单易用的操作界面以及向导式操作方式,在降低用户使用容器调度平台学习成本的同时,极大减轻开发、测试、运维的日常工作的复杂度,旨在解决 Kubernetes 本身存在的存储、网络、安全和易用性等痛点 2. 平台已经整合并优化了多个... 阅读全文
posted @ 2020-05-18 12:50 白云辉 阅读(286) 评论(0) 推荐(0) 编辑
摘要: ## 2020-05-111. 顺丰上线「丰食」平台,正式进入外卖领域2. 用 jsDelivr 免费加速 GitHub Pages 的静态资源 1. GitHub 图床的正确用法,通过 jsDelivr CDN 全球加速 2. https://mp.weixin.qq.com/s/8_SMul8gMlSBv10h_WdOVA?utm_source=tuicool&utm_medium... 阅读全文
posted @ 2020-05-11 19:59 白云辉 阅读(425) 评论(0) 推荐(0) 编辑
摘要: protobuf go https://github.com/protocolbuffers/protobuf go https://github.com/golang/protobuf https://github.com/grpc/grpc go go get github.com/golang 阅读全文
posted @ 2020-05-11 09:26 白云辉 阅读(6492) 评论(1) 推荐(0) 编辑
摘要: ## 2020-05-081. 《大学》中列出“格物、致知、诚意、正心、修身、齐家、治国、平天下”的儒家修身八条目1. Mac-显示隐藏文件-快捷键与命令行 command+shift+.1. Go 版本管理器 gvm https://github.com/voidint/g 1. Pika is a nosql compatible with redis, it is deve... 阅读全文
posted @ 2020-05-09 19:35 白云辉 阅读(1466) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页