Documentation ¶
Index ¶
- Constants
- func Init()
- type Client
- func (client *Client) Del(ctx context.Context, key string)
- func (client *Client) Get(ctx context.Context, key string) *redis.StringCmd
- func (client *Client) ObtainLock(key string, expiration time.Duration) error
- func (client *Client) Publish(ctx context.Context, channel string, message interface{}) error
- func (client *Client) ReleaseLock(key string)
- func (client *Client) Set(ctx context.Context, key string, value interface{}, expiration time.Duration)
- func (client *Client) Subscribe(ctx context.Context, channels ...string) *redis.PubSub
Constants ¶
View Source
const ( // user session key, param is sid KEY_USER_SESSION = "app:session:%s" // key for insert user lock to prevent concurrent insert, first param is email, second is username KEY_INSERT_USER_LOCK = "app:i:u:lock:%s:%s" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.