rpc

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetadataStreamInterceptor

func MetadataStreamInterceptor(md map[string][]string) grpc.StreamClientInterceptor

func MetadataUnaryInterceptor

func MetadataUnaryInterceptor(md map[string][]string) grpc.UnaryClientInterceptor

func WithStatsCtx

func WithStatsCtx(parentCtx context.Context) context.Context

Types

type ConnFactoryOption added in v1.2.0

type ConnFactoryOption func(*GrpcConnFactorySettings)

func WithAuthority added in v1.3.0

func WithAuthority(authority string) ConnFactoryOption

func WithConnCred added in v1.2.0

func WithConnCred(insecure bool, caCert string, cert string, certKey string) ConnFactoryOption

func WithHeaders added in v1.6.0

func WithHeaders(h map[string][]string) ConnFactoryOption

func WithKeepalive added in v1.7.0

func WithKeepalive(keepalive bool, keepaliveTime time.Duration) ConnFactoryOption

func WithMaxRecvMsgSize added in v1.9.0

func WithMaxRecvMsgSize(messageSize int) ConnFactoryOption

type ConnectionOptions

type ConnectionOptions struct {
	Host      string
	Authority string
	Metadata  map[string][]string
}

func NewConnectionOpts

func NewConnectionOpts(target string) (*ConnectionOptions, error)

type GrpcConnFactory

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

func NewGrpcConnFactory

func NewGrpcConnFactory(opts ...ConnFactoryOption) *GrpcConnFactory

func (*GrpcConnFactory) Close

func (f *GrpcConnFactory) Close() error

func (*GrpcConnFactory) CloseConn

func (f *GrpcConnFactory) CloseConn(target string) error

func (*GrpcConnFactory) GetConn

func (f *GrpcConnFactory) GetConn(target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

type GrpcConnFactorySettings added in v1.2.0

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

type Stats

type Stats struct {
	Duration time.Duration

	sync.RWMutex
	// contains filtered or unexported fields
}

func ExtractRpcStats

func ExtractRpcStats(ctx context.Context) *Stats

func (*Stats) FullMethod added in v1.6.0

func (s *Stats) FullMethod() string

func (*Stats) ReqHeaders added in v1.6.0

func (s *Stats) ReqHeaders() metadata.MD

func (*Stats) ReqSize

func (s *Stats) ReqSize() int64

func (*Stats) RespHeaders added in v1.6.0

func (s *Stats) RespHeaders() metadata.MD

func (*Stats) RespSize

func (s *Stats) RespSize() int64

func (*Stats) RespTrailers added in v1.6.0

func (s *Stats) RespTrailers() metadata.MD

Jump to

Keyboard shortcuts

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