rpc

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 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

type ConnFactoryOption func(*GrpcConnFactorySettings)

func WithAuthority

func WithAuthority(authority string) ConnFactoryOption

func WithConnCred

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

func WithHeaders

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

func WithKeepalive

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

func WithMaxRecvMsgSize

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

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

func (s *Stats) FullMethod() string

func (*Stats) ReqHeaders

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

func (*Stats) ReqSize

func (s *Stats) ReqSize() int64

func (*Stats) RespHeaders

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

func (*Stats) RespSize

func (s *Stats) RespSize() int64

func (*Stats) RespTrailers

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

Jump to

Keyboard shortcuts

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