Documentation ¶
Index ¶
- func New(opts ...RedisClientOption) fiber.Storage
- type RedisClientOption
- type RedisStorage
- func (rs *RedisStorage) Client() *redis.Client
- func (rs *RedisStorage) Close() error
- func (rs *RedisStorage) Delete(key string) error
- func (rs *RedisStorage) Get(key string) ([]byte, error)
- func (rs *RedisStorage) Reset() error
- func (rs *RedisStorage) Set(key string, val []byte, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(opts ...RedisClientOption) fiber.Storage
New returns fiber.Storage implementation only
Types ¶
type RedisClientOption ¶
type RedisClientOption func(*RedisStorage)
func WithClient ¶
func WithClient(client *redis.Client) RedisClientOption
Withclient sets entirely dev owned Client, all other options will be discarded if this is in use
func WithPassword ¶
func WithPassword(password string) RedisClientOption
WithPassword sets password for default redis client
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
RedisStorage holds client info and implements fiber.Storage interface
func NewClient ¶
func NewClient(opts ...RedisClientOption) *RedisStorage
Newclient returns fiber.Storage plus extra methods
func (*RedisStorage) Client ¶
func (rs *RedisStorage) Client() *redis.Client
Client returns redis client pointer directly for extra setup?
func (*RedisStorage) Close ¶
func (rs *RedisStorage) Close() error
Close closes the storage and will stop any running garbage collectors and open connections.
func (*RedisStorage) Delete ¶
func (rs *RedisStorage) Delete(key string) error
Delete deletes the value for the given key. It returns no error if the storage does not contain the key,
func (*RedisStorage) Get ¶
func (rs *RedisStorage) Get(key string) ([]byte, error)
Get gets the value for the given key. It returns ErrNotFound if the storage does not contain the key.
func (*RedisStorage) Reset ¶
func (rs *RedisStorage) Reset() error
Reset resets the storage and delete all keys.