Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is an error report that the key is not found. ErrNotFound = errors.New("cache: key not found") )
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
type Cacher interface { // Open establish connection to the target server. Open(ctx context.Context) error // Get a value, return ErrNotFound if key not found. Get(ctx context.Context, key string) ([]byte, error) // Set a value Set(ctx context.Context, key string, val []byte, opts ...SetOption) error // Delete a value Delete(ctx context.Context, key string) error // Close close the underlying connection. Close(ctx context.Context) error }
Cacher is interface for a cache service.
type SetOptions ¶
SetOptions hold options when setting value for a key.
Click to show internal directories.
Click to hide internal directories.