Documentation
¶
Index ¶
- type Option
- func WithConsul(consul *consulApi.Client) Option
- func WithGrpcAddr(addr string) Option
- func WithGrpcServerOption(opts ...grpc.ServerOption) Option
- func WithHttp(h bool) Option
- func WithHttpAddr(addr string) Option
- func WithHttpServerOption(opts ...mux.Optional) 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 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 WithLoggingDecider ¶
WithLoggingDecider
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 默认超时1分钟再关闭,K8S service 关闭策略 refer: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/
func (*Server) Handle ¶
func (s *Server) Handle(method, path string, h runtime.HandlerFunc)
Handle 注册自定义HTTP路由
func (*Server) RegisterService ¶
func (s *Server) RegisterService(desc *grpc.ServiceDesc, serviceImpl interface{})
RegisterService 注册函数