支持grpc拦截器加入
This commit is contained in:
parent
e386683768
commit
a42b6770c9
|
|
@ -18,6 +18,7 @@ type Config struct {
|
||||||
Address string
|
Address string
|
||||||
Port int
|
Port int
|
||||||
AppName string
|
AppName string
|
||||||
|
opts []grpc.ServerOption
|
||||||
}
|
}
|
||||||
|
|
||||||
var rpc *grpc.Server
|
var rpc *grpc.Server
|
||||||
|
|
@ -29,12 +30,13 @@ func Init(config *Config) *grpc.Server {
|
||||||
Address: "0.0.0.0",
|
Address: "0.0.0.0",
|
||||||
Port: 0,
|
Port: 0,
|
||||||
AppName: "unknown",
|
AppName: "unknown",
|
||||||
|
opts: []grpc.ServerOption{grpc.MaxRecvMsgSize(1024 * 1024), grpc.MaxSendMsgSize(1024 * 1024)},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conf = config
|
conf = config
|
||||||
|
|
||||||
if rpc == nil {
|
if rpc == nil {
|
||||||
rpc = grpc.NewServer(grpc.MaxRecvMsgSize(1024*1024), grpc.MaxSendMsgSize(1024*1024))
|
rpc = grpc.NewServer(conf.opts...)
|
||||||
}
|
}
|
||||||
return rpc
|
return rpc
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue