server

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳