ip

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTIVATED = "ACTIVATED"
	STANDBY   = "STANDBY"
	FAILING   = "FAILING"
	BOOTING   = "BOOTING"
)
View Source
const (
	FaultEvent              = "fault"
	ElectedEvent            = "elected"
	DemotedEvent            = "demoted"
	HealthCheckFailEvent    = "health_check_fail"
	HealthCheckSuccessEvent = "health_check_success"
)

Variables

This section is empty.

Functions

func NewManager

func NewManager(ctx context.Context, config config.Config, ip models.IP, client *clientv3.Client, leaseManager locker.EtcdLeaseManager) (*manager, error)

func NewStateMachine

func NewStateMachine(ctx context.Context, opts NewStateMachineOpts) *fsm.FSM

Types

type Manager

type Manager interface {
	Start(context.Context)
	Stop(ctx context.Context, stopper func(context.Context) error)
	CancelStopping(context.Context) bool
	Status() string
	IP() models.IP
	TryGetLock(context.Context)
}

type NewStateMachineOpts

type NewStateMachineOpts struct {
	ActivatedCallback func(ctx context.Context, e *fsm.Event)
	StandbyCallback   func(ctx context.Context, e *fsm.Event)
	FailingCallback   func(ctx context.Context, e *fsm.Event)
}

Jump to

Keyboard shortcuts

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