redisstore

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDatabase = Database(0)

DefaultDatabase is Default value for Database

View Source
const DefaultPort = Port(6379)

DefaultPort is Default value for Port

Variables

This section is empty.

Functions

func BuildRedisPool

func BuildRedisPool(redisURI string, poolSize int) (util.Cmder, error)

BuildRedisPool build new redis pool

Types

type Database

type Database int

Database is type for redis database number

type Port

type Port uint16

Port is type for Redis port number

type RedisConfig

type RedisConfig struct {
	Host     string
	Port     Port
	Database Database
	PoolSize uint
}

RedisConfig is type for redis config

func ParseRedisURI

func ParseRedisURI(redisURI string) (*RedisConfig, error)

ParseRedisURI parse RedisURI

type RedisStore

type RedisStore struct {
	util.Cmder
}

RedisStore implement store with Redis backend

func NewRedisStore

func NewRedisStore(cmder util.Cmder) *RedisStore

NewRedisStore create new RedisStore

func (*RedisStore) CheckHealth

func (rs *RedisStore) CheckHealth() error

CheckHealth ping redis and return error

func (*RedisStore) CreateHostRules

func (rs *RedisStore) CreateHostRules(hostRules models.HostRules) error

CreateHostRules create host rules if not exists

func (*RedisStore) DeleteHostRules

func (rs *RedisStore) DeleteHostRules(host string) error

DeleteHostRules if host exists

func (*RedisStore) GetHostRules

func (rs *RedisStore) GetHostRules(host string) (*models.HostRules, error)

GetHostRules implement Store.GetHostRules

func (*RedisStore) ListHostRules

func (rs *RedisStore) ListHostRules() ([]models.HostRules, error)

ListHostRules implement Store.ListHostRules

func (*RedisStore) UpdateHostRules

func (rs *RedisStore) UpdateHostRules(host string, hostRules models.HostRules) error

UpdateHostRules update host rules if it exists

Jump to

Keyboard shortcuts

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