Documentation ¶
Index ¶
- type Conf
- type Redis
- func (r *Redis) Check(namespace, id string, counterKey string) (models.OTP, error)
- func (r *Redis) Close(namespace, id string) error
- func (r *Redis) Delete(namespace, id string) error
- func (r *Redis) Ping() error
- func (r *Redis) Set(namespace, id string, otp models.OTP) (models.OTP, error)
- func (r *Redis) SetAddress(namespace, id, address string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { Host string `json:"host"` Port int `json:"port"` Username string `json:"username"` Password string `json:"password"` DB int `json:"db"` MaxActive int `json:"max_active"` MaxIdle int `json:"max_idle"` Timeout time.Duration `json:"timeout"` KeyPrefix string `json:"key_prefix"` // If this is set, 'check' and 'close' events will be PUBLISHed to // to this Redis key (Redis PubSub). PublishKey string `json:"publish_key"` }
Conf contains Redis configuration fields.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis implements a Redis Store.
func (*Redis) Check ¶
Check checks the attempt count and TTL duration against an ID. Passing counterKey increments the attempt counter.
func (*Redis) Close ¶
Close closes an OTP and marks it as done (verified). After this, the OTP has to expire after a TTL or be deleted.
func (*Redis) SetAddress ¶
SetAddress sets (updates) the address on an existing OTP.
Click to show internal directories.
Click to hide internal directories.