Documentation ¶
Index ¶
- func AttachSentinelToMaster(sentinel Client, masterIP string, cluster *Cluster) error
- func ConfigureSentinel(client Client, cluster *Cluster) error
- func IsWorkingInstance(client Client) (bool, error)
- func SentinelMonitorCommand(sentinel Client, masterName string, masterIP string, redisPort string) *redis.StringCmd
- func SentinelSetCommand(client Client, masterName string, key string, value string) *redis.StringCmd
- func SetupCluster(cluster *Cluster)
- type Client
- type Cluster
- type Config
- type ConfigRedis
- type Redis
- type Sentinel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachSentinelToMaster ¶
AttachSentinelToMaster Configures a sentinel to monitor a master
func ConfigureSentinel ¶
ConfigureSentinel Configures the sentinel with settings
func IsWorkingInstance ¶
IsWorkingInstance Checks that a registered IP is up and running. Blocking
func SentinelMonitorCommand ¶
func SentinelMonitorCommand( sentinel Client, masterName string, masterIP string, redisPort string, ) *redis.StringCmd
SentinelMonitorCommand Configures sentinal instance to monitor a new master
func SentinelSetCommand ¶
func SentinelSetCommand( client Client, masterName string, key string, value string, ) *redis.StringCmd
SentinelSetCommand Configures sentinel instance with key value
func SetupCluster ¶
func SetupCluster(cluster *Cluster)
SetupCluster Works with the registered entities and starts the cluster when ready
Types ¶
type Client ¶
type Client interface { String() string Ping() *redis.StatusCmd Options() *redis.Options SlaveOf(host, port string) *redis.StatusCmd Process(redis.Cmder) error Close() error }
Client Interface to our Redis library
func ConnectToClient ¶
ConnectToClient Connects to a Redis server
func ConnectToRedis ¶
ConnectToRedis Connects to a Redis server
type Cluster ¶
Cluster information that
func NewCluster ¶
NewCluster Creates a new Redis cluster object configured with config
func (*Cluster) AddSentinel ¶
AddSentinel Adds a sentinel registration via IP address
func (*Cluster) IsFunctional ¶
IsFunctional Test the cluster to see if it has a defined and functioning master
type Config ¶
type Config struct { Master string `json:"master"` Redis ConfigRedis `json:"redis"` Sentinel struct { Hostname string `json:"hostname"` Port int `json:"port"` Config map[string]interface{} `json:"config"` } `json:"sentinel"` }
Config Configuration structure pulled from JSON file
func (*Config) ConvertToString ¶
ConvertToString Takes an interface value and ensures it's a string
type ConfigRedis ¶
type ConfigRedis struct { Hostname string `json:"hostname"` Port int `json:"port"` Password string `json:"password"` }
ConfigRedis Configuration structure of Redis instance
func (*ConfigRedis) MarshalJSON ¶
func (r *ConfigRedis) MarshalJSON() ([]byte, error)
MarshalJSON Converts our password to a blank on output