grpc

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PortConfigKey        = "grpc-port"
	GracePeriodConfigKey = "grpc-grace-period"
)
View Source
const (
	HealthUnknown    = 0
	HealthServing    = 1
	HealthNotServing = 2
)
View Source
const DefaultGracePeriod = 3 * time.Second
View Source
const DefaultHealthEnabled = true
View Source
const DefaultLoggingInterceptor = true
View Source
const DefaultPort = "50051"
View Source
const DefaultPrometheusInterceptor = true
View Source
const DefaultRequestIdInterceptor = true

Variables

This section is empty.

Functions

func Flags

func Flags() *pflag.FlagSet

Flags is a convenience function to quickly add the gRPC server options as CLI flags Implements the cli.FlagProvider type

Types

type Option

type Option func(*Options)

func DisableHealthServer

func DisableHealthServer() Option

func DisableLoggingInterceptor

func DisableLoggingInterceptor() Option

func DisablePrometheusInterceptor

func DisablePrometheusInterceptor() Option

func DisableRequestIdInterceptor

func DisableRequestIdInterceptor() Option

func Name

func Name(name string) Option

func Port

func Port(addr string) Option

func ShutdownGracePeriod

func ShutdownGracePeriod(duration time.Duration) Option

type Options

type Options struct {
	Port                string
	Name                string
	ShutdownGracePeriod time.Duration
	HealthServerEnabled bool
	// contains filtered or unexported fields
}

type Server

type Server interface {
	ListenAndServe(ctx context.Context, wg *sync.WaitGroup)
	Server() *grpc.Server
}

func NewServer

func NewServer(opts ...Option) Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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