grpc

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 13 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) *grpc.ClientConn

NewConnection provides new grpc connection

func NewServer

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

NewServer provides new grpc server

Types

type Adapter

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

Adapter is grpc server app adapter

func NewAdapter

func NewAdapter(name, address string, server *grpcmain.Server) *Adapter

NewAdapter provides new primary adapter

func (*Adapter) Start

func (adapter *Adapter) Start(ctx context.Context) error

Start start grpc application adapter

func (*Adapter) Stop

func (adapter *Adapter) Stop(ctx context.Context) error

Stop stops grpc application adapter

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