sentinel

package
v0.0.0-...-a22f26f Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SentinelMarkedUp      = 1
	SentinelMarkedDown    = 2
	SentinelMarkedAlive   = 3
	SentinelMarkedUnknown = 4
)
View Source
const (
	SentinelReconnectionPeriod = time.Second * 5
	MonitorPingInterval        = time.Second * 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Notify(event SentinelEvent)
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(sentinel types.Sentinel, manager Manager, redisConnection redis.RedisConnection, tcpKeepAlive int) (*Monitor, error)

func (*Monitor) StartMonitoringMasterEvents

func (m *Monitor) StartMonitoringMasterEvents(switchmasterchannel chan types.MasterSwitchedEvent, connectionChannel chan types.ConnectionEvent) error

type SentinelAdded

type SentinelAdded struct {
	Sentinel types.Sentinel
}

func (SentinelAdded) GetSentinel

func (s SentinelAdded) GetSentinel() types.Sentinel

type SentinelClustersMonitoredUpdate

type SentinelClustersMonitoredUpdate struct {
	Sentinel types.Sentinel
	Clusters []string
}

func (SentinelClustersMonitoredUpdate) GetSentinel

type SentinelEvent

type SentinelEvent interface {
	GetSentinel() types.Sentinel
}

type SentinelInfo

type SentinelInfo struct {
	SentinelLocation string    `json:"sentinelLocation"`
	LastUpdated      time.Time `json:"lastUpdated"`
	Clusters         []string  `json:"clusters"`
	State            int       `json:"state"`
}

type SentinelLost

type SentinelLost struct {
	Sentinel types.Sentinel
}

func (SentinelLost) GetSentinel

func (s SentinelLost) GetSentinel() types.Sentinel

type SentinelManager

type SentinelManager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(switchmasterchannel chan types.MasterSwitchedEvent, cm *configuration.ConfigurationManager) *SentinelManager

func (*SentinelManager) GetCurrentTopology

func (m *SentinelManager) GetCurrentTopology() types.MasterDetailsCollection

func (*SentinelManager) GetState

func (m *SentinelManager) GetState(request TopologyRequest)

func (*SentinelManager) Notify

func (m *SentinelManager) Notify(event SentinelEvent)

type SentinelPing

type SentinelPing struct {
	Sentinel types.Sentinel
}

func (SentinelPing) GetSentinel

func (s SentinelPing) GetSentinel() types.Sentinel

type SentinelState

type SentinelState struct {
	// contains filtered or unexported fields
}

func NewSentinelState

func NewSentinelState(fn StartMonitoringSentinel) SentinelState

func (SentinelState) GetState

func (s SentinelState) GetState(request TopologyRequest)

func (SentinelState) Notify

func (s SentinelState) Notify(event SentinelEvent)

type SentinelTopology

type SentinelTopology struct {
	Sentinels map[string]*SentinelInfo `json:"sentinels"`
}

func (SentinelTopology) FindSentinelInfo

func (topology SentinelTopology) FindSentinelInfo(sentinel types.Sentinel) (*SentinelInfo, bool)

type SentinelUnknown

type SentinelUnknown struct {
	Sentinel types.Sentinel
}

func (SentinelUnknown) GetSentinel

func (s SentinelUnknown) GetSentinel() types.Sentinel

type StartMonitoringSentinel

type StartMonitoringSentinel func(types.Sentinel)

type Throttle

type Throttle struct {
	// contains filtered or unexported fields
}

func NewThrottle

func NewThrottle(in chan types.MasterSwitchedEvent, out chan types.MasterSwitchedEvent) *Throttle

type TopologyRequest

type TopologyRequest struct {
	ReplyChannel chan SentinelTopology
}

Jump to

Keyboard shortcuts

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