Documentation ¶
Index ¶
- Constants
- func BuildRedisPool(redisURI string, poolSize int) (util.Cmder, error)
- type Database
- type Port
- type RedisConfig
- type RedisStore
- func (rs *RedisStore) CheckHealth() error
- func (rs *RedisStore) CreateHostRules(hostRules models.HostRules) error
- func (rs *RedisStore) DeleteHostRules(host string) error
- func (rs *RedisStore) GetHostRules(host string) (*models.HostRules, error)
- func (rs *RedisStore) ListHostRules() ([]models.HostRules, error)
- func (rs *RedisStore) UpdateHostRules(host string, hostRules models.HostRules) error
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 ¶
Types ¶
type RedisConfig ¶
RedisConfig is type for redis config
func ParseRedisURI ¶
func ParseRedisURI(redisURI string) (*RedisConfig, error)
ParseRedisURI parse RedisURI
type RedisStore ¶
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
Click to show internal directories.
Click to hide internal directories.