Documentation ¶
Index ¶
Constants ¶
View Source
const NotFound = CacheError("[cache] not found")
View Source
const NotSupported = CacheError("[cache] not supported")
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { Set(ctx context.Context, key string, value interface{}, expiration int) error Increment(ctx context.Context, key string, expiration int) (int64, error) Get(ctx context.Context, key string) ([]byte, error) GetObject(ctx context.Context, key string, doc interface{}) error GetString(ctx context.Context, key string) (string, error) GetInt(ctx context.Context, key string) (int64, error) GetFloat(ctx context.Context, key string) (float64, error) Exist(ctx context.Context, key string) bool Delete(ctx context.Context, key string, opts ...DeleteOptions) error GetKeys(ctx context.Context, pattern string) []string RemainingTime(ctx context.Context, key string) int Close() error }
Cache cache service
type CacheError ¶
type CacheError string
func (CacheError) Error ¶
func (e CacheError) Error() string
type DeleteCache ¶
type DeleteCache struct {
Pattern string
}
type DeleteOptions ¶
type DeleteOptions func(options *DeleteCache)
Click to show internal directories.
Click to hide internal directories.