grpcclient

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 21 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instrument added in v1.1.0

func NewBackoffRetry

func NewBackoffRetry(cfg backoff.Config) grpc.UnaryClientInterceptor

NewBackoffRetry gRPC middleware.

func NewRateLimiter

func NewRateLimiter(cfg *Config) grpc.UnaryClientInterceptor

NewRateLimiter creates a UnaryClientInterceptor for client side rate limiting.

Types

type Config

type Config struct {
	MaxRecvMsgSize  int     `yaml:"max_recv_msg_size"`
	MaxSendMsgSize  int     `yaml:"max_send_msg_size"`
	GRPCCompression string  `yaml:"grpc_compression"`
	RateLimit       float64 `yaml:"rate_limit"`
	RateLimitBurst  int     `yaml:"rate_limit_burst"`

	BackoffOnRatelimits bool           `yaml:"backoff_on_ratelimits"`
	BackoffConfig       backoff.Config `yaml:"backoff_config"`

	TLSEnabled bool             `yaml:"tls_enabled"`
	TLS        tls.ClientConfig `yaml:",inline"`
}

Config for a gRPC client.

func (*Config) CallOptions

func (cfg *Config) CallOptions() []grpc.CallOption

CallOptions returns the config in terms of CallOptions.

func (*Config) DialOption

func (cfg *Config) DialOption(unaryClientInterceptors []grpc.UnaryClientInterceptor, streamClientInterceptors []grpc.StreamClientInterceptor) ([]grpc.DialOption, error)

DialOption returns the config as a grpc.DialOptions.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers flags.

func (*Config) RegisterFlagsWithPrefix added in v1.1.0

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlagsWithPrefix registers flags with prefix.

func (*Config) Validate added in v1.3.0

func (cfg *Config) Validate(log log.Logger) error

Jump to

Keyboard shortcuts

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