grpc

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConnectionServing

func IsConnectionServing(ctx context.Context, service string, conn *grpc.ClientConn) bool

IsConnectionServing checks if GRPC connection status equals HealthCheckResponse_SERVING

func NewConnection

func NewConnection(ctx context.Context, host string, port int, cfg ConnectionConfig, logger *log.Logger) *grpc.ClientConn

NewConnection provides new grpc connection

func NewServer

func NewServer(cfg ServerConfig, logger *log.Logger, unaryInterceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor) *grpc.Server

NewServer provides new grpc server

Types

type ConnectionConfig

type ConnectionConfig struct {
	ConnTime    time.Duration
	ConnTimeout time.Duration
}

ConnectionConfig provides values for gRPC connection configuration

type ServerConfig

type ServerConfig struct {
	ServerMinTime time.Duration
	ServerTime    time.Duration
	ServerTimeout time.Duration
}

ServerConfig provides values for gRPC server configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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