Documentation ¶
Index ¶
- Constants
- func GetAddressPair(astring string) (host string, port int, err error)
- type AddSlaveRequest
- type CloneRequest
- type Constellation
- type ConsulConfiguredService
- type DiscoverableService
- type DiscoveredServices
- type FailoverRequest
- type LocalSentinelConfig
- type LocalService
- type MonitorRequest
- type RedisNode
- type RedisPod
- type RemoteService
- type Sentinel
- type SentinelOverrides
- type SentinelPodConfig
Constants ¶
const GCPORT = "8008"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddSlaveRequest ¶
type CloneRequest ¶
type Constellation ¶
type Constellation struct { Name string PodMap map[string]*RedisPod NumErrorPods int Connected bool LocalSentinel Sentinel SentinelConfigName string SentinelConfig LocalSentinelConfig PodAuthMap map[string]string ConfiguredSentinels map[string]interface{} CellName string }
Constellation is a construct which holds information about the constellation as well providing an interface for taking actions against it.
func GetConstellation ¶
func GetConstellation(name, cfg, cell, sentinelAddress string) (Constellation, error)
GetConstellation returns an instance of a constellation. It requires the configuration and a cell name. The cell name identifies the cluster the constellation, and hence this RedSkull instance, belongs to. In the future this will be used in clsuter coordination as well as for a protective measure against cluster merge
func (*Constellation) GetPodAuth ¶
func (c *Constellation) GetPodAuth(podname string) string
GetPodAuth will return an authstring from the local config
func (*Constellation) LoadSentinelConfigFile ¶
func (c *Constellation) LoadSentinelConfigFile() error
LoadSentinelConfigFile loads the local config file pulled from the environment variable "REDSKULL_SENTINELCONFIGFILE"
type ConsulConfiguredService ¶
type ConsulConfiguredService interface { GetBase() string SetBase(string) SetValue(string, string) error GetString(string, bool) (string, error) GetInteger(string, bool) (int, error) GetLocalAddress() string }
ConsulConfiguredService is an interface for creating services configured from Consul
type DiscoverableService ¶
type DiscoverableService interface { RegisterService() error SetPort(int) AddCheck(consul.AgentServiceCheck) EnableMaintenance(string) error DisableMaintenance() error }
DiscoverableService is a service that registers itself with consul
type DiscoveredServices ¶
type FailoverRequest ¶
type LocalSentinelConfig ¶
type LocalSentinelConfig struct { Name string Host string Port int ManagedPodConfigs map[string]SentinelPodConfig Dir string }
LocalSentinelConfig is a struct holding information about the sentinel RS is running on.
type LocalService ¶
type LocalService interface { DiscoverableService ConsulConfiguredService }
LocalService is an interface for Local build services
type MonitorRequest ¶
type RedisNode ¶
type RedisNode struct { Name string Address string Port int MaxMemory int LastStart time.Time Info structures.RedisInfoAll Slaves []*RedisNode AOFEnabled bool SaveEnabled bool PercentUsed float64 MemoryUseWarn bool MemoryUseCritical bool HasEnoughMemoryForMaster bool Auth string LastUpdate time.Time LastUpdateValid bool LastUpdateDelay time.Duration HasValidAuth bool Connected bool LatencyHistory client.LatencyHistory LatencyHistoryFastCommand client.LatencyHistory LatencyThreshold int LatencyDoctor string LatencyMonitoringEnabled bool SlowLogThreshold int64 SlowLogLength int64 SlowLogRecords []*client.SlowLog }
type RedisPod ¶
type RedisPod struct { Name string Info structures.MasterInfo Slaves []structures.InfoSlaves Master *RedisNode SentinelCount int ActiveSentinelCount int ReportedSentinelCount int AuthToken string ValidAuth bool ValidMasterConnection bool NeededSentinels int MissingSentinels bool TooManySentinels bool HasInfo bool NeedsReset bool HasValidSlaves bool }
func NewMasterFromMasterInfo ¶
func NewMasterFromMasterInfo(mi structures.MasterInfo, authtoken string) (rp RedisPod, err error)
NewMasterFromMasterInfo accepts a MasterInfo struct from libredis/client combined with an authentication token to use and returns a RedisPod instance.
type RemoteService ¶
type RemoteService struct { Name string Tag string Connected bool ConsulAddress string // contains filtered or unexported fields }
func NewRemoteService ¶
func NewRemoteService(caddr, service, tag string) *RemoteService
func (*RemoteService) Connect ¶
func (s *RemoteService) Connect(a string) error
func (*RemoteService) GetEntries ¶
func (s *RemoteService) GetEntries() (entries []string, err error)
func (*RemoteService) GetHostPort ¶
func (s *RemoteService) GetHostPort() (string, int, error)
type SentinelOverrides ¶
type SentinelOverrides struct {
BindAddress string
}