bigcache

package
v2.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package bigcache is a generated GoMock package.

Index

Constants

View Source
const (
	// BigcacheType represents the storage type as a string value
	BigcacheType = "bigcache"
	// BigcacheTagPattern represents the tag pattern to be used as a key in specified storage
	BigcacheTagPattern = "gocache_tag_%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BigcacheClientInterface

type BigcacheClientInterface interface {
	Get(key string) ([]byte, error)
	Set(key string, entry []byte) error
	Delete(key string) error
	Reset() error
}

BigcacheClientInterface represents a allegro/bigcache client

type BigcacheStore

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

BigcacheStore is a store for Bigcache

func NewBigcache

func NewBigcache(client BigcacheClientInterface, options ...store.Option) *BigcacheStore

NewBigcache creates a new store to Bigcache instance(s)

func (*BigcacheStore) Clear

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

Clear resets all data in the store

func (*BigcacheStore) Delete

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

Delete removes data from Bigcache for given key identifier

func (*BigcacheStore) Get

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

Get returns data stored from a given key

func (*BigcacheStore) GetType

func (s *BigcacheStore) GetType() string

GetType returns the store type

func (*BigcacheStore) GetWithTTL

func (s *BigcacheStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)

Not implemented for BigcacheStore

func (*BigcacheStore) Invalidate

func (s *BigcacheStore) Invalidate(ctx context.Context, options ...store.InvalidateOption) error

Invalidate invalidates some cache data in Bigcache for given options

func (*BigcacheStore) Set

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

Set defines data in Bigcache for given key identifier

type MockBigcacheClientInterface

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

MockBigcacheClientInterface is a mock of BigcacheClientInterface interface.

func NewMockBigcacheClientInterface

func NewMockBigcacheClientInterface(ctrl *gomock.Controller) *MockBigcacheClientInterface

NewMockBigcacheClientInterface creates a new mock instance.

func (*MockBigcacheClientInterface) Delete

func (m *MockBigcacheClientInterface) Delete(key string) error

Delete mocks base method.

func (*MockBigcacheClientInterface) EXPECT

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

func (*MockBigcacheClientInterface) Get

func (m *MockBigcacheClientInterface) Get(key string) ([]byte, error)

Get mocks base method.

func (*MockBigcacheClientInterface) Reset

Reset mocks base method.

func (*MockBigcacheClientInterface) Set

func (m *MockBigcacheClientInterface) Set(key string, entry []byte) error

Set mocks base method.

type MockBigcacheClientInterfaceMockRecorder

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

MockBigcacheClientInterfaceMockRecorder is the mock recorder for MockBigcacheClientInterface.

func (*MockBigcacheClientInterfaceMockRecorder) Delete

func (mr *MockBigcacheClientInterfaceMockRecorder) Delete(key interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockBigcacheClientInterfaceMockRecorder) Get

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

Get indicates an expected call of Get.

func (*MockBigcacheClientInterfaceMockRecorder) Reset

Reset indicates an expected call of Reset.

func (*MockBigcacheClientInterfaceMockRecorder) Set

func (mr *MockBigcacheClientInterfaceMockRecorder) Set(key, entry 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