healer

package
v0.0.0-...-9451de5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig() (map[string]NodeHealerConfig, error)

func RemoveConfig

func RemoveConfig(pool, name string) error

func UpdateConfig

func UpdateConfig(pool string, config NodeHealerConfig) error

Types

type NodeChecks

type NodeChecks struct {
	Time   time.Time
	Checks []provision.NodeCheckResult
}

type NodeHealer

type NodeHealer struct {
	// contains filtered or unexported fields
}
var (
	HealerInstance *NodeHealer
)

func Initialize

func Initialize() (*NodeHealer, error)

func (*NodeHealer) GetNodeStatusData

func (h *NodeHealer) GetNodeStatusData(node provision.Node) (NodeStatusData, error)

func (*NodeHealer) HandleError

func (h *NodeHealer) HandleError(node provision.NodeHealthChecker) time.Duration

func (*NodeHealer) RemoveNode

func (h *NodeHealer) RemoveNode(node provision.Node) error

func (*NodeHealer) Shutdown

func (h *NodeHealer) Shutdown(ctx context.Context) error

func (*NodeHealer) String

func (h *NodeHealer) String() string

func (*NodeHealer) UpdateNodeData

func (h *NodeHealer) UpdateNodeData(nodeAddrs []string, checks []provision.NodeCheckResult) error

type NodeHealerConfig

type NodeHealerConfig struct {
	Enabled                      *bool
	MaxTimeSinceSuccess          *int
	MaxUnresponsiveTime          *int
	EnabledInherited             bool
	MaxTimeSinceSuccessInherited bool
	MaxUnresponsiveTimeInherited bool
}

type NodeHealerCustomData

type NodeHealerCustomData struct {
	Node      provision.NodeSpec
	Reason    string
	LastCheck *NodeChecks
}

type NodeStatusData

type NodeStatusData struct {
	Address     string       `bson:"_id,omitempty"`
	Checks      []NodeChecks `bson:",omitempty"`
	LastSuccess time.Time    `bson:",omitempty"`
	LastUpdate  time.Time
}

Jump to

Keyboard shortcuts

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