pkg

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 26 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcServer

type GrpcServer struct {
	Config GrpcServerConfig
	Server *grpc.Server
}

func NewGrpcServer

func NewGrpcServer(config GrpcServerConfig) (*GrpcServer, error)

NewGrpcServer instantiates and initializes a new grpc server. It does not run the server.

func (*GrpcServer) Run

func (s *GrpcServer) Run() (err error)

Run runs the grpc server, call this after creating a server with NewGrpcServer()

type GrpcServerConfig

type GrpcServerConfig struct {
	Port                               int                   // port to run on
	SentryEnabled                      bool                  // enable sentry integration
	SentryClientOptions                sentry.ClientOptions  // arbitrary sentry client options to pass through to sentry client
	PrometheusEnabled                  bool                  // enable prometheus metrics
	PrometheusPath                     string                // path to enable prometheus metrics on
	PrometheusPort                     int                   // port to run prometheus metrics on
	PrometheusEnableLatencyHistograms  bool                  // enable prometheus latency histograms
	GetErrorToReturn                   func(err error) error // called when recovering from a panic, gets the error to return to the caller
	CaptureRecoveredErr                func(err error) bool  // called when recovering from a panic, return true to capture the error in sentry
	CaptureErrormessage                string                // error message logged when recovering from a panic
	Opts                               []grpc.ServerOption   // arbitrary options to pass through to the server
	TlsCertPath, TlsKeyPath, TlsCaPath string                // file paths to tls cert, key, and ca, if all 3 are provided then the server runs with tls enabled
	MinTlsVersion                      uint16                // minimum tls version to use, defaults to 1.0
	UnaryServerInterceptors            []grpc.UnaryServerInterceptor
	StreamServerInterceptors           []grpc.StreamServerInterceptor
	AuthFunc                           grpc_auth.AuthFunc
	HealthServer                       grpc_health_v1.HealthServer
}

type HealthChecker

type HealthChecker struct{}

func NewHealthChecker

func NewHealthChecker() *HealthChecker

func (*HealthChecker) Watch

Jump to

Keyboard shortcuts

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