fixed
This commit is contained in:
parent
01bbcaf3d3
commit
48683558dc
4
main.go
4
main.go
|
|
@ -21,10 +21,10 @@ func main() {
|
|||
// 证书
|
||||
creds, err := credentials.NewServerTLSFromFile("cert.pem", "key.pem")
|
||||
if err != nil {
|
||||
log.Fatal("err: %s", err.Error())
|
||||
log.Fatalf("err: %s", err.Error())
|
||||
}
|
||||
// 传递进grpc
|
||||
options := []grpc.ServerOption{grpc.Creds(creds), grpc.MaxMsgSize(1024 * 1024), grpc.MaxRecvMsgSize(1024 * 1024), grpc.UnaryInterceptor(service.AuthGrpcInterceptor)}
|
||||
options := []grpc.ServerOption{grpc.Creds(creds), grpc.MaxRecvMsgSize(1024 * 1024), grpc.UnaryInterceptor(service.AuthGrpcInterceptor)}
|
||||
// grpc服务 ...展开符
|
||||
server := grpc.NewServer(options...)
|
||||
//服务注册
|
||||
|
|
|
|||
Loading…
Reference in New Issue