grpc

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientDialOptions

func ClientDialOptions() []grpc.DialOption

func GetGrpcClientConn

func GetGrpcClientConn(addr string, connectionTimeout time.Duration) (*grpc.ClientConn, error)

func GetIPFromContext added in v0.0.36

func GetIPFromContext(ctx context.Context) (net.IP, error)

returns IP address from grpc context. It will lookup IP in X-Forwarded-For and X-Real-IP headers, if both get empty, lookup IP from peer context

Types

type EmptyGrpcClientOption added in v0.0.21

type EmptyGrpcClientOption struct{}

EmptyGrpcClientOption does not alter the configuration. It can be embedded in another structure to build custom options.

This API is EXPERIMENTAL.

type GrpcClient added in v0.0.16

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

func NewGrpcClient added in v0.0.16

func NewGrpcClient(addr string, options ...GrpcClientOption) (*GrpcClient, error)

func (*GrpcClient) ApplyOptions added in v0.0.21

func (o *GrpcClient) ApplyOptions(options ...GrpcClientOption) *GrpcClient

func (*GrpcClient) Close added in v0.0.16

func (g *GrpcClient) Close() error

func (*GrpcClient) Conn added in v0.0.21

func (g *GrpcClient) Conn() *grpc.ClientConn

type GrpcClientOption added in v0.0.21

type GrpcClientOption interface {
	// contains filtered or unexported methods
}

A GrpcClientOption sets options.

func WithConnectionTimeout added in v0.0.21

func WithConnectionTimeout(connectionTimeout time.Duration) GrpcClientOption

func WithMaxMsgSize added in v0.0.21

func WithMaxMsgSize(maxMsgSize int) GrpcClientOption

type GrpcClientOptionFunc added in v0.0.21

type GrpcClientOptionFunc func(*GrpcClient)

GrpcClientOptionFunc wraps a function that modifies Client into an implementation of the GrpcClientOption interface.

Jump to

Keyboard shortcuts

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