Documentation ¶
Index ¶
- func AnyValue[V any](v any, err error) (V, error)
- type Cache
- type Option
- func WithDeleteKeyBefore(fn func(ctx context.Context, key ...string)) Option
- func WithExpirationEvict() Option
- func WithLazy() Option
- func WithLinkDisable() Option
- func WithLinkSlotNum(linkSlotNum int) Option
- func WithLocalDisable() Option
- func WithLocalFailedTTL(localFailedTTL time.Duration) Option
- func WithLocalSlotNum(localSlotNum int) Option
- func WithLocalSlotSize(localSlotSize int) Option
- func WithLocalSuccessTTL(localSuccessTTL time.Duration) Option
- func WithTarget(target lru.Target) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache[V any] interface { Get(ctx context.Context, key string, fetch func(ctx context.Context) (V, error)) (V, error) GetLink(ctx context.Context, key string, fetch func(ctx context.Context) (V, error), link ...string) (V, error) Del(ctx context.Context, key ...string) DelLocal(ctx context.Context, key ...string) Stop() }
type Option ¶
type Option func(o *option)
func WithDeleteKeyBefore ¶
func WithExpirationEvict ¶
func WithExpirationEvict() Option
func WithLinkDisable ¶
func WithLinkDisable() Option
func WithLinkSlotNum ¶
func WithLocalDisable ¶
func WithLocalDisable() Option
func WithLocalFailedTTL ¶
func WithLocalSlotNum ¶
func WithLocalSlotSize ¶
func WithLocalSuccessTTL ¶
func WithTarget ¶
Click to show internal directories.
Click to hide internal directories.