Documentation
¶
Overview ¶
Package elasticache provides an in-memory mock implementation of AWS ElastiCache.
Index ¶
- type Mock
- func (m *Mock) CreateCache(_ context.Context, cfg driver.CacheConfig) (*driver.CacheInfo, error)
- func (m *Mock) Decr(ctx context.Context, cacheName, key string) (int64, error)
- func (m *Mock) DecrBy(_ context.Context, cacheName, key string, delta int64) (int64, error)
- func (m *Mock) Delete(_ context.Context, cacheName, key string) error
- func (m *Mock) DeleteCache(_ context.Context, name string) error
- func (m *Mock) Expire(_ context.Context, cacheName, key string, ttl time.Duration) error
- func (m *Mock) FlushAll(_ context.Context, cacheName string) error
- func (m *Mock) Get(_ context.Context, cacheName, key string) (*driver.Item, error)
- func (m *Mock) GetCache(_ context.Context, name string) (*driver.CacheInfo, error)
- func (m *Mock) GetTTL(_ context.Context, cacheName, key string) (time.Duration, error)
- func (m *Mock) Incr(ctx context.Context, cacheName, key string) (int64, error)
- func (m *Mock) IncrBy(_ context.Context, cacheName, key string, delta int64) (int64, error)
- func (m *Mock) Keys(_ context.Context, cacheName, pattern string) ([]string, error)
- func (m *Mock) ListCaches(_ context.Context) ([]driver.CacheInfo, error)
- func (m *Mock) Persist(_ context.Context, cacheName, key string) error
- func (m *Mock) Set(_ context.Context, cacheName, key string, value []byte, ttl time.Duration) error
- func (m *Mock) SetMonitoring(mon mondriver.Monitoring)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of the AWS ElastiCache service.
func (*Mock) CreateCache ¶
CreateCache creates a new ElastiCache cluster.
func (*Mock) DecrBy ¶ added in v1.3.1
DecrBy atomically decrements the integer value of a key by delta.
func (*Mock) DeleteCache ¶
DeleteCache deletes an ElastiCache cluster by name.
func (*Mock) GetTTL ¶ added in v1.3.1
GetTTL returns the remaining TTL for a key. Returns -1 if the key has no TTL.
func (*Mock) IncrBy ¶ added in v1.3.1
IncrBy atomically increments the integer value of a key by delta.
func (*Mock) Keys ¶
Keys returns all keys matching the given pattern in the cache. Supports "*" as a wildcard. Empty pattern returns all keys.
func (*Mock) ListCaches ¶
ListCaches lists all ElastiCache clusters.
func (*Mock) SetMonitoring ¶
func (m *Mock) SetMonitoring(mon mondriver.Monitoring)
SetMonitoring sets the monitoring backend for auto-metric generation.