grpcx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPageSize

func GetPageSize(
	defaultPageSize int32,
	maxPageSize int32,
	req PageSizeRequest,
) (pageSize int32, err error)

func InitPrometheusMetrics

func InitPrometheusMetrics(server *grpc.Server)

func LoggingUnaryServerInterceptor

func LoggingUnaryServerInterceptor(log *zap.Logger) grpc.UnaryServerInterceptor

func NewClientConnection

func NewClientConnection(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

NewClientConnection establishes new gRPC client connection and returns it.

func NewServer

func NewServer(log *zap.Logger) *grpc.Server

Types

type PageSizeRequest

type PageSizeRequest interface {
	GetPageSize() int32
}

PageSizeRequest describes a request with page size parameter.

type ServerController

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

func NewServerController

func NewServerController(
	addr string,
	server *grpc.Server,
	log *zap.Logger,
	opts ...ServerControllerOption,
) *ServerController

func (*ServerController) Start

func (sm *ServerController) Start(ctx context.Context) error

func (*ServerController) Stop

func (sm *ServerController) Stop(ctx context.Context) error

func (*ServerController) Wait

func (sm *ServerController) Wait() <-chan error

type ServerControllerOption

type ServerControllerOption func(*ServerController)

func ServerControllerWithUnixSocket

func ServerControllerWithUnixSocket(path string) ServerControllerOption

Jump to

Keyboard shortcuts

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