Documentation
¶
Index ¶
- type Engine
- func (e *Engine) Exists(key string) bool
- func (e *Engine) Expire(key string) error
- func (e *Engine) Get(key string) ([]byte, error)
- func (e *Engine) IsExpired(key string) bool
- func (e *Engine) IsLocked(key string) bool
- func (e *Engine) Lock(key string) error
- func (e *Engine) Put(key string, data []byte, expires time.Time) error
- func (e *Engine) Unlock(key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine uses redis.v4 as the back end
func NewRedisRingStore ¶
func NewRedisRingStore( prefix string, ring *redis.Ring, cleanupTimeout time.Duration, ) (*Engine, error)
NewRedisRingStore creates a new redis ring for use as a store
func (*Engine) Get ¶
Get retrieves data from teh store based on the key if it exists, returns an error if the key does not exist or the redis connection fails
func (*Engine) Lock ¶
Lock sets a lock against a given key SETEX doesn't exist within this lib, it's advised to use Set for similar behavior https://github.com/go-redis/redis/blob/dc9d5006b3c319de24b2fa4de242e442553fcce2/commands.go#L726
func (*Engine) Put ¶
Put stores data against a key, else it returns an error SETEX doesn't exist within this lib, it's advised to use Set for similar behavior https://github.com/go-redis/redis/blob/dc9d5006b3c319de24b2fa4de242e442553fcce2/commands.go#L726