Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustLogLevel ¶
func AdjustLogLevel(logLevel string)
Types ¶
type GrpcServerRunner ¶
type GrpcServerRunner interface {
GetGrpcServer() *grpc.Server
Run(ctx context.Context) error
Shutdown(ctx context.Context) error
}
GrpcServerRunner is used to painlessly run a gRPC sever. Use GetGrpcServer to register your service(s). Shutdown will shut it down gracefully.
func NewGrpcServerRunner ¶
func NewGrpcServerRunner( config GrpcServerRunnerConfig, unaryInterceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor, ) (GrpcServerRunner, error)
type GrpcServerRunnerConfig ¶
type GrpcServerRunnerConfig struct {
Server struct {
Connection net.Listener `mapstructure:",omitempty"`
Host string
Port int
Auth struct {
CertFile string `mapstructure:"cert-file" yaml:"cert-file"`
KeyFile string `mapstructure:"key-file" yaml:"key-file"`
}
}
Prometheus struct {
Enabled bool
Host string
Port int
Prefix string
Buckets []float64
}
}
GrpcServerRunnerConfig is used to configure GrpcServerRunnerConfig behaviour. It can be used with viper. You can provide your own net.Listener implementation instead of host and port, by setting Server.Port to 0 and setting the value of Server.Connection.
Click to show internal directories.
Click to hide internal directories.