This commit is contained in:
wyh 2022-07-07 15:50:04 +08:00
parent 01bbcaf3d3
commit 48683558dc
1 changed files with 2 additions and 2 deletions

View File

@ -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...)
//服务注册