Documentation
¶
Index ¶
Constants ¶
View Source
const (
// RedisKey to identify the configuration JSON key
RedisKey = "redis"
)
Variables ¶
This section is empty.
Functions ¶
func PrepareAddr ¶
func PrepareAddr(config JSONConfigurationRedis) string
PrepareAddr to generate redis connection string
Types ¶
type CachedQueryWriteData ¶
type CachedQueryWriteData struct {
UnixTime int `json:"unixTime"`
HostIdentifier string `json:"hostIdentifier"`
QueryData types.QueryWriteData
}
CachedQueryWriteData to store in cache query logs
type JSONConfigurationRedis ¶
type JSONConfigurationRedis struct {
Host string `json:"host"`
Port string `json:"port"`
Password string `json:"password"`
ConnectionString string `json:"connectionstring"`
DB int `json:"db"`
ConnRetry int `json:"connRetry"`
}
JSONConfigurationRedis to hold all redis configuration values
func LoadConfiguration ¶
func LoadConfiguration(file, key string) (JSONConfigurationRedis, error)
LoadConfiguration to load the redis configuration file and assign to variables
type RedisManager ¶
type RedisManager struct {
Config *JSONConfigurationRedis
Client *redis.Client
}
RedisManager have access to cached data
func CreateRedisManager ¶
func CreateRedisManager(config JSONConfigurationRedis) (*RedisManager, error)
CreateRedisManager to initialize the redis manager struct
func CreateRedisManagerFile ¶
func CreateRedisManagerFile(file string) (*RedisManager, error)
CreateRedisManagerFile to initialize the redis manager struct from file
func (*RedisManager) Check ¶
func (rm *RedisManager) Check() error
Check to verify if connection is open and ready
func (*RedisManager) GetRedis ¶
func (rm *RedisManager) GetRedis() *redis.Client
GetRedis to get redis client ready
Click to show internal directories.
Click to hide internal directories.