extgrpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option = func(o *Options)

func CombineOptions

func CombineOptions(options ...Option) Option

func NoopOption

func NoopOption() Option

func WithGRPCServerOption

func WithGRPCServerOption(opt grpc.ServerOption) Option

WithGRPCServerOption allows adding raw grpc.ServerOption's to the instantiated gRPC server.

func WithGracePeriod

func WithGracePeriod(t time.Duration) Option

WithGracePeriod sets shutdown grace period for gRPC server. Server waits connections to drain for specified amount of time.

func WithListen

func WithListen(s string) Option

WithListen sets address to listen for gRPC server. Server accepts incoming connections on given address.

func WithNetwork

func WithNetwork(s string) Option

WithNetwork sets network to listen for gRPC server e.g tcp, udp or unix.

func WithOtelTracing

func WithOtelTracing() Option

func WithServer

func WithServer(f registerServerFunc) Option

WithGRPCServer calls the passed gRPC registration functions on the created grpc.Server.

func WithStreamServerInterceptor

func WithStreamServerInterceptor(interceptor grpc.StreamServerInterceptor) Option

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

WithTLSConfig sets TLS configuration for gRPC server.

func WithUnaryServerInterceptor

func WithUnaryServerInterceptor(interceptor grpc.UnaryServerInterceptor) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(logger *log.Logger, probe *prober.GRPCProbe, opts ...Option) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Run

func (s *Server) Run(g *run.Group, statusProber prober.Probe)

func (*Server) Shutdown

func (s *Server) Shutdown(err error)

Shutdown gracefully shuts down the server by waiting, for specified amount of time (by gracePeriod) for connections to return to idle and then shut down.

Jump to

Keyboard shortcuts

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