lib

package
v0.0.0-...-be95f36 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const GCPORT = "8008"

Variables

This section is empty.

Functions

func GetAddressPair

func GetAddressPair(astring string) (host string, port int, err error)

GetAddressPair is a convenience function for converting an ip and port into the ip:port string. Probably need to move this to the common package

Types

type AddSlaveRequest

type AddSlaveRequest struct {
	Podname      string
	SlaveAddress string
	SlavePort    int
	SlaveAuth    string
}

type CloneRequest

type CloneRequest struct {
	Origin   string
	Clone    string
	Role     string
	Reconfig bool
	Promote  bool
}

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 DiscoveredServices interface {
	Refresh() error
	GetHostPort() (string, error)
}

type FailoverRequest

type FailoverRequest struct {
	Podname   string
	ReturnNew bool
}

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 MonitorRequest struct {
	Podname       string
	MasterAddress string
	AuthToken     string
	MasterPort    int
	Quorum        int
}

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.

func NewPod

func NewPod(name, address string, port int, auth string) (rp RedisPod, err error)

NewPod will return a RedisPod construct. It requires the nae, address, port, and authentication token.

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 Sentinel

type Sentinel struct {
	Name           string
	Host           string
	Port           int
	Connection     *client.Redis
	Errors         int
	Info           structures.RedisInfoAll
	PodMap         map[string]RedisPod
	Pods           []RedisPod
	PodsInError    []RedisPod
	KnownSentinels map[string]*Sentinel
	DialConfig     client.DialConfig
}

type SentinelOverrides

type SentinelOverrides struct {
	BindAddress string
}

type SentinelPodConfig

type SentinelPodConfig struct {
	IP        string
	Port      int
	Name      string
	AuthToken string
}

SentinelPodConfig is a struct carrying information about a Pod's config as pulled from the sentinel config file.

Jump to

Keyboard shortcuts

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