radix

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCache

type RedisCache struct {
	// contains filtered or unexported fields
}

RedisCache stores our Redis Pool

func New

func New(config RedisConfig) (*RedisCache, error)

Creates a new Redis cache instance, connecting to the given server and AUTHing with the provided password. If the password is an empty string, the AUTH command will not be run.

func (*RedisCache) Close

func (r *RedisCache) Close()

func (*RedisCache) Flush

func (r *RedisCache) Flush() error

func (*RedisCache) Insert

func (r *RedisCache) Insert(key string, value []byte, ttl time.Duration) error

Insert will SET the key in Redis with an expiry TTL

func (*RedisCache) Len

func (r *RedisCache) Len() uint

func (*RedisCache) Pool

func (r *RedisCache) Pool() *pool.Pool

func (*RedisCache) Retrieve

func (r *RedisCache) Retrieve(key string) ([]byte, error)

func (*RedisCache) Size

func (r *RedisCache) Size() uint64

type RedisConfig

type RedisConfig struct {
	Network string
	Address string
	Auth    string
	DB      int
	Size    int
}

RedisConfig contains the configuration for the redis storage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL