Documentation
¶
Overview ¶
Package driver defines the interface for cache service implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
CreateCache(ctx context.Context, config CacheConfig) (*CacheInfo, error)
DeleteCache(ctx context.Context, name string) error
GetCache(ctx context.Context, name string) (*CacheInfo, error)
ListCaches(ctx context.Context) ([]CacheInfo, error)
Set(ctx context.Context, cacheName, key string, value []byte, ttl time.Duration) error
Get(ctx context.Context, cacheName, key string) (*Item, error)
Delete(ctx context.Context, cacheName, key string) error
Keys(ctx context.Context, cacheName, pattern string) ([]string, error)
FlushAll(ctx context.Context, cacheName string) error
}
Cache is the interface that cache provider implementations must satisfy.
type CacheConfig ¶
type CacheConfig struct {
Name string
NodeType string
Engine string // "redis", "memcached"
Tags map[string]string
}
CacheConfig describes a cache instance to create.
Click to show internal directories.
Click to hide internal directories.