Documentation ¶ Index ¶ type Cache func (store *Cache) Delete(ctx context.Context, key string) error func (store *Cache) Get(ctx context.Context, key string) (any, error) func (store *Cache) Set(ctx context.Context, key string, val any) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Cache ¶ type Cache struct { Cache *cache.Cache // 过期时间 TTL func(ctx context.Context, key string) time.Duration } Cache TTL缓存 func (*Cache) Delete ¶ func (store *Cache) Delete(ctx context.Context, key string) error func (*Cache) Get ¶ func (store *Cache) Get(ctx context.Context, key string) (any, error) func (*Cache) Set ¶ func (store *Cache) Set(ctx context.Context, key string, val any) error Source Files ¶ View all Source files cache.go Click to show internal directories. Click to hide internal directories.