server

package
v0.0.0-...-d77dacb Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeepaliveTimeoutCanceledErr = "keepalive timeout is canceled"

	ReqGetMetricsCastErr         = `protobuf "ReqGetMetrics" type cast error`
	PeriodOrMetricsFieldEmptyErr = `period or metrics slice is empty`
)
View Source
const (
	DefaultMaxMsgSize = 2 << 20 // 2Mb
)

Variables

This section is empty.

Functions

func CheckNetErrClosing

func CheckNetErrClosing(err error) error

func PanicServerInterceptor

func PanicServerInterceptor(panicHandler func(ctx context.Context, err error, params ...interface{}) error, params ...interface{}) grpc.UnaryServerInterceptor

func SetGrpcServerOptions

func SetGrpcServerOptions(conf configs.Configs, lg logr.Logger,
	internalInterceptors ...grpc.UnaryServerInterceptor) ([]grpc.ServerOption, error)

Types

type ProviderServer

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

func NewProviderServer

func NewProviderServer(conf *configs.Configs, logger logr.Logger, grpcSrv *server.Server, listener ...net.Listener) *ProviderServer

func (ProviderServer) GetMetrics

func (ps ProviderServer) GetMetrics(ctx context.Context, req *pb.ReqGetMetrics) (res *pb.ResGetMetrics, err error)

func (ProviderServer) Ping

func (ps ProviderServer) Ping(ctx context.Context, req *pb.ReqPing) (*pb.ResPong, error)

func (*ProviderServer) Start

func (ps *ProviderServer) Start() <-chan error

func (*ProviderServer) Stop

func (ps *ProviderServer) Stop() error

type Server

type Server interface {
	Start() <-chan error
	Stop() error
}

Jump to

Keyboard shortcuts

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