Documentation ¶
Index ¶
- Constants
- type Config
- type Item
- type ItemConstraint
- type Option
- func WithClock[PT ItemConstraint[T], T any](clock clockwork.Clock) Option[PT, T]
- func WithCloseItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T]
- func WithCreateItemFunc[PT ItemConstraint[T], T any](f func(ctx context.Context) (PT, error)) Option[PT, T]
- func WithCreateItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T]
- func WithIdleTimeToLive[PT ItemConstraint[T], T any](idleTTL time.Duration) Option[PT, T]
- func WithItemUsageLimit[PT ItemConstraint[T], T any](itemUsageLimit uint64) Option[PT, T]
- func WithLimit[PT ItemConstraint[T], T any](size int) Option[PT, T]
- func WithSyncCloseItem[PT ItemConstraint[T], T any]() Option[PT, T]
- func WithTrace[PT ItemConstraint[T], T any](t *Trace) Option[PT, T]
- type Pool
- type Stats
- type Trace
Constants ¶
View Source
const (
DefaultLimit = 50
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v3.77.0
type Config[PT ItemConstraint[T], T any] struct { // contains filtered or unexported fields }
type ItemConstraint ¶ added in v3.80.3
type Option ¶ added in v3.80.3
type Option[PT ItemConstraint[T], T any] func(c *Config[PT, T])
func WithClock ¶ added in v3.79.1
func WithClock[PT ItemConstraint[T], T any](clock clockwork.Clock) Option[PT, T]
func WithCloseItemTimeout ¶ added in v3.59.0
func WithCloseItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T]
func WithCreateItemFunc ¶ added in v3.79.1
func WithCreateItemFunc[PT ItemConstraint[T], T any](f func(ctx context.Context) (PT, error)) Option[PT, T]
func WithCreateItemTimeout ¶ added in v3.59.0
func WithCreateItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T]
func WithIdleTimeToLive ¶ added in v3.80.3
func WithIdleTimeToLive[PT ItemConstraint[T], T any](idleTTL time.Duration) Option[PT, T]
func WithItemUsageLimit ¶ added in v3.80.10
func WithItemUsageLimit[PT ItemConstraint[T], T any](itemUsageLimit uint64) Option[PT, T]
func WithLimit ¶ added in v3.59.0
func WithLimit[PT ItemConstraint[T], T any](size int) Option[PT, T]
func WithSyncCloseItem ¶ added in v3.80.0
func WithSyncCloseItem[PT ItemConstraint[T], T any]() Option[PT, T]
func WithTrace ¶ added in v3.58.0
func WithTrace[PT ItemConstraint[T], T any](t *Trace) Option[PT, T]
type Pool ¶
type Pool[PT ItemConstraint[T], T any] struct { // contains filtered or unexported fields }
type Trace ¶ added in v3.58.0
type Trace struct { OnNew func(ctx *context.Context, call stack.Caller) func(limit int) OnClose func(ctx *context.Context, call stack.Caller) func(err error) OnTry func(ctx *context.Context, call stack.Caller) func(err error) OnWith func(ctx *context.Context, call stack.Caller) func(attempts int, err error) OnPut func(ctx *context.Context, call stack.Caller, item any) func(err error) OnGet func(ctx *context.Context, call stack.Caller) func(item any, attempts int, err error) OnChange func(Stats) // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.