Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Delete(ctx context.Context, key string) error
- func (c *Client) DeleteByMatch(ctx context.Context, pattern string) error
- func (c *Client) Get(ctx context.Context, key string) (string, error)
- func (c *Client) GetStruct(ctx context.Context, key string, value interface{}) error
- func (c *Client) Set(ctx context.Context, key, value string, ttl time.Duration) error
- func (c *Client) SetStruct(ctx context.Context, key string, value interface{}, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidType represents error when invalid type provided ErrInvalidType = errors.New("invalid type provided") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents redis client
func (*Client) DeleteByMatch ¶
DeleteByMatch removes value by pattern
func (*Client) Get ¶
Get returns value by key. If key does not exist, returns empty string without error
func (*Client) GetStruct ¶
GetStruct gets value by key from cache and sets value. If key does not exist, returns nil without error. If value cannot be unmarshalled, InvalidTypeError returned
Click to show internal directories.
Click to hide internal directories.