Documentation
¶
Index ¶
- func RecoveryWithLogger(options *serverOptions) grpc_recovery.RecoveryHandlerFunc
- type Option
- func WithAuthFunc(authFunc grpc_auth.AuthFunc) Option
- func WithGrpcOption(option grpc.ServerOption) Option
- func WithLogger(logger *zap.Logger) Option
- func WithPrometheus(listen string) Option
- func WithRegistry(register registry.Registry, serviceName string, listen string) Option
- func WithStreamServerInterceptor(intercoptors ...grpc.StreamServerInterceptor) Option
- func WithTracer(tracer opentracing.Tracer) Option
- func WithUnaryServerInterceptor(intercoptors ...grpc.UnaryServerInterceptor) Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecoveryWithLogger ¶
func RecoveryWithLogger(options *serverOptions) grpc_recovery.RecoveryHandlerFunc
Types ¶
type Option ¶
type Option func(*serverOptions)
func WithAuthFunc ¶
func WithAuthFunc(authFunc grpc_auth.AuthFunc) Option
func WithGrpcOption ¶
func WithGrpcOption(option grpc.ServerOption) Option
func WithLogger ¶
func WithPrometheus ¶
func WithRegistry ¶
func WithStreamServerInterceptor ¶
func WithStreamServerInterceptor(intercoptors ...grpc.StreamServerInterceptor) Option
func WithTracer ¶
func WithTracer(tracer opentracing.Tracer) Option
func WithUnaryServerInterceptor ¶
func WithUnaryServerInterceptor(intercoptors ...grpc.UnaryServerInterceptor) Option
type Server ¶
type Server struct { Name string Option *serverOptions }
func Micro ¶
micro service stack support. if you use prometheus, the http server implement yourself example:
httpServer := &http.Server{ Handler: promhttp.HandlerFor(reg, promhttp.HandlerOpts{}), Addr: fmt.Sprintf("0.0.0.0:%d", 9092) } go func() { if err := httpServer.ListenAndServe(); err != nil { log.Fatal("Unable to start a http server.") } }()
func (Server) BuildGrpcServer ¶
func (Server) StartPrometheus ¶
Click to show internal directories.
Click to hide internal directories.