store

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(types ...any)

Types

type GenericInterface

type GenericInterface interface {
	Set(ctx context.Context, key string, value any) error
	Get(ctx context.Context, key string, target any) error
	Update(ctx context.Context, key string, fn func(func(target any) error) (any, error)) error
	Delete(ctx context.Context, key string) error
}

func NewMemStore

func NewMemStore(storeName string, ttl time.Duration) GenericInterface

func NewRedisStore

func NewRedisStore(storeKey string, db redis.Client, ttl time.Duration) GenericInterface

type MemStore

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

func (*MemStore) Delete

func (s *MemStore) Delete(ctx context.Context, key string) error

func (*MemStore) Get

func (s *MemStore) Get(ctx context.Context, key string, target any) error

func (*MemStore) Set

func (s *MemStore) Set(ctx context.Context, key string, value any) error

func (*MemStore) Update

func (s *MemStore) Update(ctx context.Context, key string, fn func(func(target any) error) (any, error)) error

type MockGenericInterface

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

MockGenericInterface is a mock of GenericInterface interface.

func NewMockGenericInterface

func NewMockGenericInterface(ctrl *gomock.Controller) *MockGenericInterface

NewMockGenericInterface creates a new mock instance.

func (*MockGenericInterface) Delete

func (m *MockGenericInterface) Delete(ctx context.Context, key string) error

Delete mocks base method.

func (*MockGenericInterface) EXPECT

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

func (*MockGenericInterface) Get

func (m *MockGenericInterface) Get(ctx context.Context, key string, target any) error

Get mocks base method.

func (*MockGenericInterface) Set

func (m *MockGenericInterface) Set(ctx context.Context, key string, value any) error

Set mocks base method.

func (*MockGenericInterface) Update

func (m *MockGenericInterface) Update(ctx context.Context, key string, fn func(func(any) error) (any, error)) error

Update mocks base method.

type MockGenericInterfaceMockRecorder

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

MockGenericInterfaceMockRecorder is the mock recorder for MockGenericInterface.

func (*MockGenericInterfaceMockRecorder) Delete

func (mr *MockGenericInterfaceMockRecorder) Delete(ctx, key interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockGenericInterfaceMockRecorder) Get

func (mr *MockGenericInterfaceMockRecorder) Get(ctx, key, target interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockGenericInterfaceMockRecorder) Set

func (mr *MockGenericInterfaceMockRecorder) Set(ctx, key, value interface{}) *gomock.Call

Set indicates an expected call of Set.

func (*MockGenericInterfaceMockRecorder) Update

func (mr *MockGenericInterfaceMockRecorder) Update(ctx, key, fn interface{}) *gomock.Call

Update indicates an expected call of Update.

type RedisStore

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

func (*RedisStore) Delete

func (s *RedisStore) Delete(ctx context.Context, key string) error

func (*RedisStore) Get

func (s *RedisStore) Get(ctx context.Context, key string, target any) error

func (*RedisStore) Set

func (s *RedisStore) Set(ctx context.Context, key string, value any) error

func (*RedisStore) Update

func (s *RedisStore) Update(ctx context.Context, key string, fn func(func(target any) error) (any, error)) error

Jump to

Keyboard shortcuts

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