Documentation
¶
Index ¶
- type Option
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) EntryCount() int64
- func (s *Store) EvacuateCount() int64
- func (s *Store) ExpiredCount() int64
- func (s *Store) Get(ctx context.Context, key string) ([]byte, error)
- func (s *Store) GetDel(ctx context.Context, key string) ([]byte, error)
- func (s *Store) GetMulti(ctx context.Context, keys []string) ([][]byte, error)
- func (s *Store) Has(ctx context.Context, key string) (bool, error)
- func (s *Store) HitCount() int64
- func (s *Store) MissCount() int64
- func (s *Store) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
- func (s *Store) SetMulti(ctx context.Context, items []store.Item) error
- func (s *Store) SetNX(ctx context.Context, key string, value []byte, ttl time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config)
Option 配置本地缓存。
func WithDefaultTTL ¶
WithDefaultTTL 设置调用方未指定 TTL 时使用的默认有效期。
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store 是基于 FreeCache 的缓存实现。
Click to show internal directories.
Click to hide internal directories.