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 ¶
type Config[PT ItemConstraint[T], T any] struct { // contains filtered or unexported fields }
type ItemConstraint ¶
type Option ¶
type Option[PT ItemConstraint[T], T any] func(c *Config[PT, T])
func WithCloseItemTimeout ¶
func WithCloseItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T]
func WithCreateItemFunc ¶
func WithCreateItemFunc[PT ItemConstraint[T], T any](f func(ctx context.Context) (PT, error)) Option[PT, T]
func WithCreateItemTimeout ¶
func WithCreateItemTimeout[PT ItemConstraint[T], T any](t time.Duration) Option[PT, T]
func WithIdleTimeToLive ¶
func WithIdleTimeToLive[PT ItemConstraint[T], T any](idleTTL time.Duration) Option[PT, T]
func WithItemUsageLimit ¶
func WithItemUsageLimit[PT ItemConstraint[T], T any](itemUsageLimit uint64) Option[PT, T]
func WithLimit ¶
func WithLimit[PT ItemConstraint[T], T any](size int) Option[PT, T]
func WithSyncCloseItem ¶
func WithSyncCloseItem[PT ItemConstraint[T], T any]() Option[PT, T]
func WithTrace ¶
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 ¶
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.