Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEntryNotFound = errors.New("cache entry not found")
)
Functions ¶
This section is empty.
Types ¶
type AppCacheService ¶
type AppCacheService interface { Create(ctx context.Context, entry CacheEntry) error List(ctx context.Context, keys ...string) ([]CacheEntry, error) FindByName(ctx context.Context, key string) (CacheEntry, error) }
type CacheStorage ¶
type CacheStorage interface { GetAll(ctx context.Context, keys ...string) ([]CacheEntry, error) Get(ctx context.Context, key string) (CacheEntry, error) Put(ctx context.Context, entry CacheEntry) error }
type MockAppCacheService ¶
type MockAppCacheService struct { OnCreate func(CacheEntry) error OnList func(...string) ([]CacheEntry, error) OnFindByName func(string) (CacheEntry, error) }
MockAppCacheService implements AppCacheService interface
func (*MockAppCacheService) Create ¶
func (m *MockAppCacheService) Create(ctx context.Context, e CacheEntry) error
func (*MockAppCacheService) FindByName ¶
func (m *MockAppCacheService) FindByName(ctx context.Context, k string) (CacheEntry, error)
func (*MockAppCacheService) List ¶
func (m *MockAppCacheService) List(ctx context.Context, keys ...string) ([]CacheEntry, error)
type MockCacheStorage ¶
type MockCacheStorage struct { OnPut func(CacheEntry) error OnGetAll func(...string) ([]CacheEntry, error) OnGet func(string) (CacheEntry, error) }
MockCacheStorage implements CacheStorage interface
func (*MockCacheStorage) Get ¶
func (m *MockCacheStorage) Get(ctx context.Context, key string) (CacheEntry, error)
func (*MockCacheStorage) GetAll ¶
func (m *MockCacheStorage) GetAll(ctx context.Context, keys ...string) ([]CacheEntry, error)
func (*MockCacheStorage) Put ¶
func (m *MockCacheStorage) Put(ctx context.Context, e CacheEntry) error
Click to show internal directories.
Click to hide internal directories.