bootstrap

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 20 Imported by: 0

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) (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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL