elasticache

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package elasticache provides an in-memory mock implementation of AWS ElastiCache.

Index

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 New

func New(opts *config.Options) *Mock

New creates a new ElastiCache mock with the given configuration options.

func (*Mock) CreateCache

func (m *Mock) CreateCache(_ context.Context, cfg driver.CacheConfig) (*driver.CacheInfo, error)

CreateCache creates a new ElastiCache cluster.

func (*Mock) Delete

func (m *Mock) Delete(_ context.Context, cacheName, key string) error

Delete removes a value from the cache.

func (*Mock) DeleteCache

func (m *Mock) DeleteCache(_ context.Context, name string) error

DeleteCache deletes an ElastiCache cluster by name.

func (*Mock) FlushAll

func (m *Mock) FlushAll(_ context.Context, cacheName string) error

FlushAll removes all items from the cache.

func (*Mock) Get

func (m *Mock) Get(_ context.Context, cacheName, key string) (*driver.Item, error)

Get retrieves a value from the cache.

func (*Mock) GetCache

func (m *Mock) GetCache(_ context.Context, name string) (*driver.CacheInfo, error)

GetCache retrieves information about an ElastiCache cluster.

func (*Mock) Keys

func (m *Mock) Keys(_ context.Context, cacheName, pattern string) ([]string, error)

Keys returns all keys matching the given pattern in the cache. Supports "*" as a wildcard. Empty pattern returns all keys.

func (*Mock) ListCaches

func (m *Mock) ListCaches(_ context.Context) ([]driver.CacheInfo, error)

ListCaches lists all ElastiCache clusters.

func (*Mock) Set

func (m *Mock) Set(_ context.Context, cacheName, key string, value []byte, ttl time.Duration) error

Set stores a value in the cache with an optional TTL.

func (*Mock) SetMonitoring

func (m *Mock) SetMonitoring(mon mondriver.Monitoring)

SetMonitoring sets the monitoring backend for auto-metric generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL