Documentation ¶
Index ¶
- Variables
- func ReplaceCacher(caches ...ICache)
- type ICache
- type NoCache
- func (n *NoCache) Close() error
- func (n *NoCache) DecrBy(ctx context.Context, key string, decrement int64) (int64, error)
- func (n *NoCache) Del(ctx context.Context, keys ...string) (int64, error)
- func (n *NoCache) Get(ctx context.Context, key string) ([]byte, error)
- func (n *NoCache) GetDel(ctx context.Context, key string) ([]byte, error)
- func (n *NoCache) IncrBy(ctx context.Context, key string, decrement int64) (int64, error)
- func (n *NoCache) Set(ctx context.Context, key string, value []byte, expiration time.Duration) error
- func (n *NoCache) SetNX(ctx context.Context, key string, value []byte, expiration time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorNoCache = errors.New("no cache")
)
Functions ¶
func ReplaceCacher ¶
func ReplaceCacher(caches ...ICache)
Types ¶
type ICache ¶
type ICache interface { Set(ctx context.Context, key string, value []byte, expiration time.Duration) error SetNX(ctx context.Context, key string, value []byte, expiration time.Duration) (bool, error) DecrBy(ctx context.Context, key string, decrement int64) (int64, error) IncrBy(ctx context.Context, key string, decrement int64) (int64, error) Get(ctx context.Context, key string) ([]byte, error) GetDel(ctx context.Context, key string) ([]byte, error) Del(ctx context.Context, keys ...string) (int64, error) Close() error }
Click to show internal directories.
Click to hide internal directories.