Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
GrpcServer returns new opinionated gRPC server based on grpc-middleware
func NewGrpcServer ¶
func NewGrpcServer(servicesRegistrationHandler func(*grpc.Server), options *GrpcServerOptions) *GrpcServer
NewGrpcServer returns a gRPC server optionally configured with GrpcServerOptions
func (*GrpcServer) GetLogger ¶
func (s *GrpcServer) GetLogger() *logrus.Logger
GetLogger returns a pointer to the logger used by the server
func (*GrpcServer) IsStarted ¶
func (s *GrpcServer) IsStarted() bool
IsStarted returns true only of Run() was called and listeners are already started
func (*GrpcServer) Run ¶
func (s *GrpcServer) Run()
Run starts the listeners, blocks and waits for interruption signal to quit
func (*GrpcServer) Stop ¶
func (s *GrpcServer) Stop()
Stop stops listening on server ports. Stopped server can't be Run() again.
type GrpcServerOptions ¶
type GrpcServerOptions struct { GrpcPort int MetricsPort int RecoveryHandler grpc_recovery.RecoveryHandlerFunc AuthHandler grpc_auth.AuthFunc LoggerFields logrus.Fields LogHealthCheckCalls bool DisableHistogramMetrics bool AdditionalOptions []grpc.ServerOption // contains filtered or unexported fields }
GrpcServerOptions allows to override default GrpcServer options
Click to show internal directories.
Click to hide internal directories.