摘要:
hello.proto syntax = "proto3";package helloproto;message Student { string name = 1; bool male = 2; repeated int32 scores = 3;} 命令 protoc --go_out=. he 阅读全文
摘要:
package main import ( "io" "net/http" "net/rpc" "net/rpc/jsonrpc" ) type HelloService struct { } func (p *HelloService) Hello(request string, reply *s 阅读全文
摘要:
rpc服务端 package main import ( "log" "net" "net/rpc" "net/rpc/jsonrpc" ) type HelloService struct { } func (p *HelloService) Hello(request string, reply 阅读全文
摘要:
简单的中间件 权限认证 demo func JWTAuthMiddleware() func(c *gin.Context) { return func(c *gin.Context) { staffName := c.Request.Header.Get("staff_name") stafEma 阅读全文
摘要:
背景:给予gin 框架的服务,想写一个中间件,保存操作信息到数据库。 字段包括请求的数据,也就是需要获取 请求参数中的body,、 像这样, appGp.POST("delAddAdministrator", middlewares.LogMiddleWare, api.DelAddAdminist 阅读全文