Documentation ¶
Index ¶
- func AnyValue[V any](v any, err error) (V, error)
- func GetPublishKeysByTopic(topics []string, keys []string) map[string][]string
- func InitLocalCache(localCache *config.LocalCache)
- func LRUStringHash(key string) uint64
- type Cache
- type EmptyTarget
- 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 ¶
func GetPublishKeysByTopic ¶ added in v3.8.0
func InitLocalCache ¶ added in v3.8.0
func InitLocalCache(localCache *config.LocalCache)
func LRUStringHash ¶ added in v3.8.0
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 EmptyTarget ¶ added in v3.8.0
type EmptyTarget struct{}
func (EmptyTarget) IncrDelHit ¶ added in v3.8.0
func (e EmptyTarget) IncrDelHit()
func (EmptyTarget) IncrDelNotFound ¶ added in v3.8.0
func (e EmptyTarget) IncrDelNotFound()
func (EmptyTarget) IncrGetFailed ¶ added in v3.8.0
func (e EmptyTarget) IncrGetFailed()
func (EmptyTarget) IncrGetHit ¶ added in v3.8.0
func (e EmptyTarget) IncrGetHit()
func (EmptyTarget) IncrGetSuccess ¶ added in v3.8.0
func (e EmptyTarget) IncrGetSuccess()
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.