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) Check ¶
func (s *HealthChecker) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*HealthChecker) Watch ¶
func (s *HealthChecker) Watch(req *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error
Click to show internal directories.
Click to hide internal directories.