states

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFollower

func NewFollower() leadership.State

func NewLeader

func NewLeader() leadership.State

func NewUnavailable

func NewUnavailable() leadership.State

Types

type Base

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

func (*Base) Name

func (s *Base) Name() string

type Enum

type Enum int
const (
	UnavailableState Enum = iota
	FollowerState
	LeaderState
)

func (Enum) String

func (s Enum) String() string

type Follower

type Follower struct {
	Base
}

func (*Follower) DoWork

func (s *Follower) DoWork(ctx context.Context, c leadership.Candidate)

func (*Follower) OnEnterState

func (s *Follower) OnEnterState(ctx context.Context, c leadership.Candidate, previousState leadership.State)

type Leader

type Leader struct {
	Base
}

func (*Leader) DoWork

func (s *Leader) DoWork(ctx context.Context, c leadership.Candidate)

func (*Leader) OnEnterState

func (s *Leader) OnEnterState(ctx context.Context, c leadership.Candidate, previousState leadership.State)

type Unavailable

type Unavailable struct {
	Base
}

Concrete state implementations

func (*Unavailable) DoWork

func (s *Unavailable) DoWork(ctx context.Context, c leadership.Candidate)

func (*Unavailable) OnEnterState

func (s *Unavailable) OnEnterState(ctx context.Context, c leadership.Candidate, previousState leadership.State)

Jump to

Keyboard shortcuts

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