Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v0.48.12 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCache

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

ClientCache is a structure around frostfs-sdk-go/client to reuse already created clients.

func NewSDKClientCache

func NewSDKClientCache(opts ClientCacheOpts) *ClientCache

NewSDKClientCache creates instance of client cache. `opts` are used for new client creation.

func (*ClientCache) CloseAll

func (c *ClientCache) CloseAll()

CloseAll closes underlying connections of all cached clients.

Ignores closing errors.

func (*ClientCache) Get

Get function returns existing client or creates a new one.

func (*ClientCache) SetLogger added in v0.48.0

func (c *ClientCache) SetLogger(l *logger.Logger)

type ClientCacheOpts

type ClientCacheOpts struct {
	DialTimeout             time.Duration
	StreamTimeout           time.Duration
	ClientWaitTimeout       time.Duration
	HealthcheckInterval     time.Duration
	IdleTimeout             time.Duration
	ReconnectTimeout        time.Duration
	MaxStreamsPerConnection int64
	MaxClientPerAddress     int64

	Key              *ecdsa.PrivateKey
	ResponseCallback func(client.ResponseMetaInfo) error
	AllowExternal    bool
	DialerSource     *net.DialerSource
	RetryPolicy      *RetryPolicy
	RetryThrottling  *RetryThrottling

	Log     *logger.Logger
	Name    string
	Metrics Metrics
}

type Metrics added in v0.48.0

type Metrics interface {
	IncFailedHealthcheckCounter(service, address string)
}

type RetryPolicy added in v0.46.9

type RetryPolicy struct {
	MaxAttempts       uint64
	InitialBackoff    time.Duration
	MaxBackoff        time.Duration
	BackoffMultiplier float64
}

type RetryThrottling added in v0.46.9

type RetryThrottling struct {
	MaxTokens  int64
	TokenRatio int64
	TokenDec   int64
}

Jump to

Keyboard shortcuts

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