Documentation ¶
Index ¶
- func StreamInterceptorChain(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
- func UnaryInterceptorChain(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- type Config
- func (c *Config) Address() string
- func (c *Config) Build() *grpcServer
- func (c *Config) WithLogger(log *logger.Logger) *Config
- func (c *Config) WithServerOption(opts ...grpc.ServerOption) *Config
- func (c *Config) WithStreamInterceptor(opts ...grpc.StreamServerInterceptor) *Config
- func (c *Config) WithUnaryInterceptor(opts ...grpc.UnaryServerInterceptor) *Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamInterceptorChain ¶
func StreamInterceptorChain(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
StreamInterceptorChain returns stream interceptors chain.
func UnaryInterceptorChain ¶
func UnaryInterceptorChain(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
UnaryInterceptorChain returns interceptors chain.
Types ¶
type Config ¶
type Config struct { Debug bool // 是否开启调试 Network string // net.listen的network类型 Host string // 服务ip Port int // 服务端口 PlainTextAddress string // 注册中心显示的地址 Version string // 当前项目版本号 Name string // 服务名称 TLS bool // 是否使用tls连接 CertFile string // tls的cert文件路径 KeyFile string // tls的key文件路径 ServerSlowThreshold int64 // 服务器素速度阈值 // contains filtered or unexported fields }
func (*Config) WithLogger ¶
WithLogger 重新设置日志组件
func (*Config) WithServerOption ¶
func (c *Config) WithServerOption(opts ...grpc.ServerOption) *Config
WithServerOption 设置grpc服务参数
func (*Config) WithStreamInterceptor ¶
func (c *Config) WithStreamInterceptor(opts ...grpc.StreamServerInterceptor) *Config
WithStreamInterceptor 设置拦截 stream
func (*Config) WithUnaryInterceptor ¶
func (c *Config) WithUnaryInterceptor(opts ...grpc.UnaryServerInterceptor) *Config
WithUnaryInterceptor 设置拦截 unary(一元) RPC
Click to show internal directories.
Click to hide internal directories.