campaign

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package campaign encapsulates the state of a campaign.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State int

State describes the state of a campaign as its relates to the caller's leadership.

const (
	// Follower indicates the caller has called Campaign but has not yet been
	// elected.
	Follower State = iota

	// Leader indicates the caller has called Campaign and was elected.
	Leader

	// Error indicates the call to Campaign returned an error.
	Error

	// Closed indicates the campaign has been closed.
	Closed
)

func (State) String

func (i State) String() string

type Status

type Status struct {
	State State
	Err   error
}

Status encapsulates campaign state and any error encountered to provide a consistent type for the campaign watch.

func NewErrorStatus

func NewErrorStatus(err error) Status

NewErrorStatus returns an error Status with the given State.

func NewStatus

func NewStatus(s State) Status

NewStatus returns a non-error status with the given State.

Jump to

Keyboard shortcuts

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