Documentation
¶
Index ¶
- func RegisterGrpcServerOption(name string, handler func(cnf *conf.Configuration) grpc.ServerOption)
- func RegisterGrpcStreamInterceptor(name string, handler func(*conf.Configuration) grpc.StreamServerInterceptor)
- func RegisterGrpcUnaryInterceptor(name string, handler func(*conf.Configuration) grpc.UnaryServerInterceptor)
- type Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterGrpcServerOption ¶
func RegisterGrpcServerOption(name string, handler func(cnf *conf.Configuration) grpc.ServerOption)
func RegisterGrpcStreamInterceptor ¶ added in v0.0.3
func RegisterGrpcStreamInterceptor(name string, handler func(*conf.Configuration) grpc.StreamServerInterceptor)
func RegisterGrpcUnaryInterceptor ¶
func RegisterGrpcUnaryInterceptor(name string, handler func(*conf.Configuration) grpc.UnaryServerInterceptor)
Types ¶
type Option ¶
type Option func(s *serverOptions)
func UseLogger ¶
func UseLogger() Option
UseLogger use component logger named "grpc" and set grpclog use zap logger.It is used by default.
func WithConfiguration ¶ added in v0.0.3
func WithConfiguration(cfg *conf.Configuration) Option
func WithGracefulStop ¶ added in v0.1.0
func WithGracefulStop() Option
WithGracefulStop indicate use graceful stop
func WithGrpcOption ¶
func WithGrpcOption(opts ...grpc.ServerOption) Option
type Server ¶
type Server struct { // ServiceInfos is for service discovery,it converts from grpc service info ServiceInfos []*registry.ServiceInfo // contains filtered or unexported fields }
Server is the grpcx server
func (*Server) Apply ¶
func (s *Server) Apply(cfg *conf.Configuration)
func (*Server) ListenAndServe ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.