state

package
v0.0.0-...-f0721d9 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map map[string]State

func NewMap

func NewMap() *Map

func (Map) Add

func (m Map) Add(key string, s State)

func (Map) Delete

func (m Map) Delete(key string)

func (Map) Search

func (m Map) Search(key string) bool

type Sla

type Sla struct {
	Firsttime      int64 `json:"firsttime"`
	Uptime         int64 `json:"uptime"`
	UptimeFailable int64 `json:"uptimeFailable"`
	UptimeSemisync int64 `json:"uptimeSemisync"`
}

type State

type State struct {
	ErrType string
	ErrDesc string
	ErrFrom string
}

type StateHttp

type StateHttp struct {
	ErrNumber string `json:"number"`
	ErrDesc   string `json:"desc"`
	ErrFrom   string `json:"from"`
}

type StateMachine

type StateMachine struct {
	CurState *Map
	OldState *Map

	Firsttime      int64
	Uptime         int64
	UptimeFailable int64
	UptimeSemisync int64

	sync.Mutex
	// contains filtered or unexported fields
}

func (*StateMachine) AddState

func (SM *StateMachine) AddState(key string, s State)

func (*StateMachine) CanMonitor

func (SM *StateMachine) CanMonitor() bool

CanMonitor checks if the current state contains errors and allows monitoring

func (*StateMachine) ClearState

func (SM *StateMachine) ClearState()

Clear copies the current map to argument map and clears it

func (*StateMachine) DeleteState

func (SM *StateMachine) DeleteState(key string)

func (*StateMachine) GetHeartbeats

func (SM *StateMachine) GetHeartbeats() int64

func (*StateMachine) GetOpenErrors

func (SM *StateMachine) GetOpenErrors() []StateHttp

func (*StateMachine) GetOpenWarnings

func (SM *StateMachine) GetOpenWarnings() []StateHttp

func (*StateMachine) GetSla

func (SM *StateMachine) GetSla() Sla

func (*StateMachine) GetStates

func (SM *StateMachine) GetStates() []string

func (*StateMachine) GetUptime

func (SM *StateMachine) GetUptime() string

func (*StateMachine) GetUptimeFailable

func (SM *StateMachine) GetUptimeFailable() string

func (*StateMachine) GetUptimeSemiSync

func (SM *StateMachine) GetUptimeSemiSync() string

func (*StateMachine) Init

func (SM *StateMachine) Init()

func (*StateMachine) IsDiscovered

func (SM *StateMachine) IsDiscovered() bool

func (*StateMachine) IsFailable

func (SM *StateMachine) IsFailable() bool

func (*StateMachine) IsInFailover

func (SM *StateMachine) IsInFailover() bool

func (*StateMachine) IsInState

func (SM *StateMachine) IsInState(key string) bool

func (*StateMachine) RemoveFailoverState

func (SM *StateMachine) RemoveFailoverState()

func (*StateMachine) ResetUptime

func (SM *StateMachine) ResetUptime()

func (*StateMachine) SetFailoverState

func (SM *StateMachine) SetFailoverState()

func (*StateMachine) SetMasterUpAndSync

func (SM *StateMachine) SetMasterUpAndSync(IsSemiSynced bool, IsNotDelay bool)

func (*StateMachine) SetSla

func (SM *StateMachine) SetSla(mySla Sla)

func (*StateMachine) UnDiscovered

func (SM *StateMachine) UnDiscovered()

Jump to

Keyboard shortcuts

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