Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (c *Client) GetString(ctx context.Context, key string) (string, error)
- func (c *Client) GetStruct(ctx context.Context, key string, target interface{}) error
- func (c *Client) RLTransaction(ctx context.Context, lock string, fn func(context.Context, *Client) error) error
- func (c *Client) SetStruct(ctx context.Context, key string, any interface{}, ttl time.Duration) error
- type Options
Constants ¶
View Source
const (
KeySupportedSymbols = "supported_symbols"
)
Variables ¶
View Source
var (
ErrDoesNotExist = errors.New("value does not exist by this key")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { redis.UniversalClient // contains filtered or unexported fields }
Client wraps redis.UniversalClient
func (*Client) RLTransaction ¶
func (c *Client) RLTransaction(ctx context.Context, lock string, fn func(context.Context, *Client) error) error
RLTransaction performs pessimistic-lock transaction using Redlock algorithm https://redis.io/topics/distlock lock is the name of the lock (i.e. name of redis key used to lock the operation)
Click to show internal directories.
Click to hide internal directories.