memcache

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Overview

Package memcache is a generated GoMock package.

Index

Constants

View Source
const (
	// MemcacheType represents the storage type as a string value
	MemcacheType = "memcache"
	// MemcacheTagPattern represents the tag pattern to be used as a key in specified storage
	MemcacheTagPattern = "gocache_tag_%s"

	TagKeyExpiry = 720 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MemcacheClientInterface

type MemcacheClientInterface interface {
	Get(key string) (item *memcache.Item, err error)
	Set(item *memcache.Item) error
	Delete(item string) error
	FlushAll() error
	CompareAndSwap(item *memcache.Item) error
	Add(item *memcache.Item) error
}

MemcacheClientInterface represents a bradfitz/gomemcache client

type MemcacheStore

type MemcacheStore struct {
	// contains filtered or unexported fields
}

MemcacheStore is a store for Memcache

func NewMemcache

func NewMemcache(client MemcacheClientInterface, options ...lib_store.Option) *MemcacheStore

NewMemcache creates a new store to Memcache instance(s)

func (*MemcacheStore) Clear

func (s *MemcacheStore) Clear(_ context.Context) error

Clear resets all data in the store

func (*MemcacheStore) Delete

func (s *MemcacheStore) Delete(_ context.Context, key any) error

Delete removes data from Memcache for given key identifier

func (*MemcacheStore) Get

func (s *MemcacheStore) Get(_ context.Context, key any) (any, error)

Get returns data stored from a given key

func (*MemcacheStore) GetType

func (s *MemcacheStore) GetType() string

GetType returns the store type

func (*MemcacheStore) GetWithTTL

func (s *MemcacheStore) GetWithTTL(_ context.Context, key any) (any, time.Duration, error)

GetWithTTL returns data stored from a given key and its corresponding TTL

func (*MemcacheStore) Invalidate

func (s *MemcacheStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error

Invalidate invalidates some cache data in Memcache for given options

func (*MemcacheStore) Set

func (s *MemcacheStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

Set defines data in Memcache for given key identifier

type MockMemcacheClientInterface

type MockMemcacheClientInterface struct {
	// contains filtered or unexported fields
}

MockMemcacheClientInterface is a mock of MemcacheClientInterface interface.

func NewMockMemcacheClientInterface

func NewMockMemcacheClientInterface(ctrl *gomock.Controller) *MockMemcacheClientInterface

NewMockMemcacheClientInterface creates a new mock instance.

func (*MockMemcacheClientInterface) Add

Add mocks base method.

func (*MockMemcacheClientInterface) CompareAndSwap

func (m *MockMemcacheClientInterface) CompareAndSwap(item *memcache.Item) error

CompareAndSwap mocks base method.

func (*MockMemcacheClientInterface) Delete

func (m *MockMemcacheClientInterface) Delete(item string) error

Delete mocks base method.

func (*MockMemcacheClientInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMemcacheClientInterface) FlushAll

func (m *MockMemcacheClientInterface) FlushAll() error

FlushAll mocks base method.

func (*MockMemcacheClientInterface) Get

Get mocks base method.

func (*MockMemcacheClientInterface) Set

Set mocks base method.

type MockMemcacheClientInterfaceMockRecorder

type MockMemcacheClientInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockMemcacheClientInterfaceMockRecorder is the mock recorder for MockMemcacheClientInterface.

func (*MockMemcacheClientInterfaceMockRecorder) Add

func (mr *MockMemcacheClientInterfaceMockRecorder) Add(item interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockMemcacheClientInterfaceMockRecorder) CompareAndSwap

func (mr *MockMemcacheClientInterfaceMockRecorder) CompareAndSwap(item interface{}) *gomock.Call

CompareAndSwap indicates an expected call of CompareAndSwap.

func (*MockMemcacheClientInterfaceMockRecorder) Delete

func (mr *MockMemcacheClientInterfaceMockRecorder) Delete(item interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockMemcacheClientInterfaceMockRecorder) FlushAll

FlushAll indicates an expected call of FlushAll.

func (*MockMemcacheClientInterfaceMockRecorder) Get

func (mr *MockMemcacheClientInterfaceMockRecorder) Get(key interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockMemcacheClientInterfaceMockRecorder) Set

func (mr *MockMemcacheClientInterfaceMockRecorder) Set(item interface{}) *gomock.Call

Set indicates an expected call of Set.

Jump to

Keyboard shortcuts

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