caches

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: GPL-3.0 Imports: 5 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
}

func NewRedisCache

func NewRedisCache(opts RedisOptions) (*RedisCache, error)

func (*RedisCache) Delete

func (c *RedisCache) Delete(key string) (err error)

func (*RedisCache) Exists

func (c *RedisCache) Exists(key string) (bool, error)

func (*RedisCache) Get

func (c *RedisCache) Get(key string) (s string, err error)

func (*RedisCache) IncrBy

func (c *RedisCache) IncrBy(key string, value int64) (result int64, err error)

func (*RedisCache) Redis

func (c *RedisCache) Redis() *redis.Client

func (*RedisCache) Set

func (c *RedisCache) Set(key string, value string, expiresIn int) (err error)

type RedisOptions

type RedisOptions struct {
	Host     string `yaml:"host" mapstructure:"host"`
	Port     int    `yaml:"port" mapstructure:"port"`
	Password string `yaml:"password" mapstructure:"password"`
	DB       int    `yaml:"db" mapstructure:"db"`
	PoolSize int    `yaml:"pool_size" mapstructure:"pool_size"`
}

Jump to

Keyboard shortcuts

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