Documentation ¶
Index ¶
- func Instrument(requestDuration *prometheus.HistogramVec) ([]grpc.UnaryClientInterceptor, []grpc.StreamClientInterceptor)
- func NewBackoffRetry(cfg util.BackoffConfig) grpc.UnaryClientInterceptor
- func NewRateLimiter(cfg *Config) grpc.UnaryClientInterceptor
- type Config
- func (cfg *Config) CallOptions() []grpc.CallOption
- func (cfg *Config) DialOption(unaryClientInterceptors []grpc.UnaryClientInterceptor, ...) []grpc.DialOption
- func (cfg *Config) RegisterFlags(f *flag.FlagSet)
- func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
- func (cfg *Config) Validate(log log.Logger) error
- type ConfigWithTLS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Instrument ¶ added in v1.1.0
func Instrument(requestDuration *prometheus.HistogramVec) ([]grpc.UnaryClientInterceptor, []grpc.StreamClientInterceptor)
func NewBackoffRetry ¶
func NewBackoffRetry(cfg util.BackoffConfig) 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"` UseGzipCompression bool `yaml:"use_gzip_compression"` // TODO: Remove this deprecated option in v1.6.0. GRPCCompression string `yaml:"grpc_compression"` RateLimit float64 `yaml:"rate_limit"` RateLimitBurst int `yaml:"rate_limit_burst"` BackoffOnRatelimits bool `yaml:"backoff_on_ratelimits"` BackoffConfig util.BackoffConfig `yaml:"backoff_config"` }
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
DialOption returns the config as a grpc.DialOptions.
func (*Config) RegisterFlags ¶
RegisterFlags registers flags.
func (*Config) RegisterFlagsWithPrefix ¶ added in v1.1.0
RegisterFlagsWithPrefix registers flags with prefix.
type ConfigWithTLS ¶ added in v1.2.0
type ConfigWithTLS struct { GRPC Config `yaml:",inline"` TLS tls.ClientConfig `yaml:",inline"` }
ConfigWithTLS is the config for a grpc client with tls
func (*ConfigWithTLS) DialOption ¶ added in v1.2.0
func (cfg *ConfigWithTLS) DialOption(unaryClientInterceptors []grpc.UnaryClientInterceptor, streamClientInterceptors []grpc.StreamClientInterceptor) ([]grpc.DialOption, error)
DialOption returns the config as a grpc.DialOptions
func (*ConfigWithTLS) RegisterFlagsWithPrefix ¶ added in v1.2.0
func (cfg *ConfigWithTLS) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix registers flags with prefix.
Click to show internal directories.
Click to hide internal directories.