Documentation
¶
Index ¶
- type Cache
- type CacheMock
- func (mock *CacheMock[V]) CreateTxDelCmd(ctx context.Context, key string) (TxDelCmd, error)
- func (mock *CacheMock[V]) CreateTxSetCmd(ctx context.Context, key string, value V, ttl time.Duration) (TxSetCmd, error)
- func (mock *CacheMock[V]) Del(ctx context.Context, key string) error
- func (mock *CacheMock[V]) Get(ctx context.Context, key string) (V, error)
- func (mock *CacheMock[V]) GetDel(ctx context.Context, key string) (V, error)
- func (mock *CacheMock[V]) Keys(ctx context.Context, pattern string, prefix Prefix) ([]string, error)
- func (mock *CacheMock[V]) Set(ctx context.Context, key string, value V, ttl time.Duration) error
- func (mock *CacheMock[V]) Tx(ctx context.Context, setCmds []TxSetCmd, delCmds []TxDelCmd) error
- type Prefix
- type TxDelCmd
- type TxSetCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] interface { Get(context.Context, string) (T, error) Set(context.Context, string, T, time.Duration) error Del(context.Context, string) error GetDel(context.Context, string) (T, error) CreateTxSetCmd(context.Context, string, T, time.Duration) (TxSetCmd, error) CreateTxDelCmd(context.Context, string) (TxDelCmd, error) Tx(context.Context, []TxSetCmd, []TxDelCmd) error Keys(context.Context, string, Prefix) ([]string, error) }
type CacheMock ¶
type CacheMock[V any] struct { T *testing.T Value V GetAssert func(t *testing.T, key string) GetErr error SetAssert func(t *testing.T, key string, value V, ttl time.Duration) SetErr error DelAssert func(t *testing.T, key string) DelErr error GetDelAssert func(t *testing.T, key string) GetDelErr error CreateTxSetCmdAssert func(t *testing.T, key string, value V, ttl time.Duration) CreateTxSetCmdErr error CreateTxDelCmdAssert func(t *testing.T, key string) CreateTxDelCmdErr error TxAssert func(t *testing.T, setCmds []TxSetCmd, delCmds []TxDelCmd) TxErr error KeysValue []string KeysAssert func(t *testing.T, pattern string, prefix Prefix) KeysErr error }
func (*CacheMock[V]) CreateTxDelCmd ¶
func (*CacheMock[V]) CreateTxSetCmd ¶
Click to show internal directories.
Click to hide internal directories.