memorystore

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: 10 Imported by: 0

Documentation

Overview

Package memorystore provides an in-memory mock implementation of GCP Memorystore.

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 GCP Memorystore.

func New

func New(opts *config.Options) *Mock

New creates a new Memorystore 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 Memorystore instance.

func (*Mock) Delete

func (m *Mock) Delete(ctx 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 a Memorystore instance 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(ctx 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 a Memorystore instance.

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.

func (*Mock) ListCaches

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

ListCaches lists all Memorystore instances.

func (*Mock) Set

func (m *Mock) Set(ctx 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