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

cache

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package cache 是 data 门面子包:缓存域——接口(Cache/CacheAside/BatchGetter/SourceFunc)+ 本地缓存(LocalCache/SingleFlightCache)+ 缓存键构造 + Checker。实现在 pkg/cache。

re-export 自 github.com/oekit/pkg/cache:类型为泛型 type alias(与源包**完全同一类型**, 双向赋值互通);非泛型函数/变量经 var 引用同一函数值。源包新增导出符号时 本壳需同步(门面跟版税,data 门面化决策已接受)。

Index

Constants

This section is empty.

Variables

View Source
var HashKey = src.HashKey
View Source
var Key = src.Key
View Source
var NewChecker = src.NewChecker
View Source
var TenantKey = src.TenantKey
View Source
var UserKey = src.UserKey
View Source
var WithClock = src.WithClock

Functions

This section is empty.

Types

type BatchGetter added in v0.8.1

type BatchGetter[T any] = src.BatchGetter[T]

type Cache

type Cache[T any] = src.Cache[T]

type CacheAside

type CacheAside[T any] = src.CacheAside[T]

type Checker added in v0.5.0

type Checker = src.Checker

type LocalCache

type LocalCache[T any] = src.LocalCache[T]

func NewLocalCache

func NewLocalCache[T any](cfg LocalConfig[T]) *LocalCache[T]

NewLocalCache 创建本地缓存(泛型函数无法 var re-export,经包装转发)。

type LocalConfig

type LocalConfig[T any] = src.LocalConfig[T]

type Option added in v0.5.0

type Option = src.Option

type SingleFlightCache

type SingleFlightCache[T any] = src.SingleFlightCache[T]

func NewSingleFlightCache

func NewSingleFlightCache[T any](inner CacheAside[T]) *SingleFlightCache[T]

NewSingleFlightCache 创建并发回源合并装饰器。

type SourceFunc

type SourceFunc[T any] = src.SourceFunc[T]

Jump to

Keyboard shortcuts

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