Documentation
¶
Index ¶
- type Discover
- type Option
- func WithAuthFunc(a interceptor.Authorize) Option
- func WithDiscover(d Discover) Option
- func WithGrpcAddr(addr string) Option
- func WithGrpcServerOption(opts ...grpc.ServerOption) Option
- func WithHttpAddr(addr string) Option
- func WithHttpServerOption(opts ...mux.Optional) Option
- func WithLimiter(l *limit.Limiter) Option
- func WithLogger(logger grpc_logging.Logger) Option
- func WithLoggingDecider(decider logging.Decider) Option
- func WithRequestFieldExtractor(f logging.RequestFieldExtractorFunc) Option
- func WithResponseFieldExtractor(f logging.ResponseFieldExtractorFunc) Option
- func WithStreamServerInterceptor(f grpc.StreamServerInterceptor) Option
- func WithTracer(tracer opentracing.Tracer) Option
- func WithUnaryServerInterceptor(f grpc.UnaryServerInterceptor) Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discover ¶ added in v0.2.12
type Discover interface { ServiceRegister(name, addr string, tags []string, meta map[string]string) error ServiceDeregister(name string) error }
Discover service discovery
type Option ¶
type Option func(*options)
Option the option for this module
func WithGrpcServerOption ¶
func WithGrpcServerOption(opts ...grpc.ServerOption) Option
WithGRPCServerOption with other grpc options
func WithHttpServerOption ¶
WithHTTPServerOption with http server options
func WithLimiter ¶ added in v0.2.18
WithLimiter performs rate limiting on the request.
func WithLoggingDecider ¶
WithLoggingDecider Decider how log output.
func WithRequestFieldExtractor ¶
func WithRequestFieldExtractor(f logging.RequestFieldExtractorFunc) Option
WithRequestFieldExtractor customizes the function for extracting log fields from protobuf messages, for unary and server-streamed methods only.
func WithResponseFieldExtractor ¶
func WithResponseFieldExtractor(f logging.ResponseFieldExtractorFunc) Option
WithResponseFieldExtractor customizes the function for extracting log fields from protobuf messages, for unary and server-streamed methods only.
func WithStreamServerInterceptor ¶
func WithStreamServerInterceptor(f grpc.StreamServerInterceptor) Option
WithStreamServerInterceptor
func WithUnaryServerInterceptor ¶
func WithUnaryServerInterceptor(f grpc.UnaryServerInterceptor) Option
WithUnaryServerInterceptor
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server the grpc server
func (*Server) Close ¶
Close K8s closes after 60 seconds by default refer: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/
func (*Server) Handle ¶
func (s *Server) Handle(method, path string, h runtime.HandlerFunc)
Handle registering HTTP handler
func (*Server) RegisterService ¶
func (s *Server) RegisterService(desc *grpc.ServiceDesc, serviceImpl interface{})
RegisterService registering gRPC service