grpc gateway

Posted by 夏泽民

https://jergoo.gitbooks.io/go-grpc-practice-guide/content/chapter3/gateway.html etcd3 API全面升级为gRPC后,同时要提供REST API服务,维护两个版本的服务显然不太合理,所以grpc-gateway诞生了。通过protobuf的自定义option实现了一个网关,服务端同时开启gRPC和HTTP服务,HTTP服务接收客户端请求后转换为grpc请求数据,获取响应后转为json数据返回给客户端。



mysql enum

Posted by 夏泽民

CREATE TABLE t_enum_example ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(10) DEFAULT NULL, color enum(‘blue’,’green’,’red’) DEFAULT NULL, PRIMARY KEY (id) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1;



ddd

Posted by 夏泽民

项目的目录结构 分为 application,domain,facade,infrastructure 四个部分



cobertura gover 测试覆盖率

Posted by 夏泽民

https://github.com/t-yuki/gocover-cobertura This is a simple helper tool for generating XML output in Cobertura format for CIs like Jenkins and others from go tool cover output.



gorm Preloading

Posted by 夏泽民

默认情况下GORM因为性能问题,不会自动加载关联属性的值,gorm通过Preload函数支持预加载(Eager loading)关联数据



Search

Popular posts

Anything in here will be replaced on browsers that support the canvas element

Recent posts

This blog is maintained by 夏泽民

Get in touch with me at 465474307@qq.com

Subscribe to our mailing list

* indicates required