grpc

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 13 Imported by: 0

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 HealthChecker added in v0.7.0

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

func NewHealthChecker added in v0.7.0

func NewHealthChecker(db *sqlx.DB, opts ...Option) *HealthChecker

func (*HealthChecker) Check added in v0.7.0

func (*HealthChecker) Watch added in v0.7.0

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, healthServer *grpc_health_v1.HealthServer)
	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