client

package
v3.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package client provides gRPC client implementation for limits service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(
	name string,
	cfg PoolConfig,
	ring ring.ReadRing,
	factory ring_client.PoolFactory,
	logger log.Logger,
) *ring_client.Pool

NewPool returns a new pool of clients for the ingest-limits.

func NewPoolFactory

func NewPoolFactory(cfg Config) ring_client.PoolFactory

NewPoolFactory returns a new factory for ingest-limits clients.

Types

type Client

Client is a gRPC client for the ingest-limits.

func NewClient

func NewClient(cfg Config, addr string) (*Client, error)

NewClient returns a new Client for the specified ingest-limits.

type Config

type Config struct {
	GRPCClientConfig             grpcclient.Config              `yaml:"grpc_client_config" doc:"description=Configures client gRPC connections to limits service."`
	PoolConfig                   PoolConfig                     `yaml:"pool_config,omitempty" doc:"description=Configures client gRPC connections pool to limits service."`
	GRPCUnaryClientInterceptors  []grpc.UnaryClientInterceptor  `yaml:"-"`
	GRCPStreamClientInterceptors []grpc.StreamClientInterceptor `yaml:"-"`

	// Internal is used to indicate that this client communicates on behalf of
	// a machine and not a user. When Internal = true, the client won't attempt
	// to inject an userid into the context.
	Internal bool `yaml:"-"`
}

Config contains the config for an ingest-limits client.

func (*Config) RegisterFlagsWithPrefix

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

type PoolConfig

type PoolConfig struct {
	ClientCleanupPeriod     time.Duration `yaml:"client_cleanup_period"`
	HealthCheckIngestLimits bool          `yaml:"health_check_ingest_limits"`
	RemoteTimeout           time.Duration `yaml:"remote_timeout"`
}

PoolConfig contains the config for a pool of ingest-limits clients.

func (*PoolConfig) RegisterFlagsWithPrefix

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

Jump to

Keyboard shortcuts

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