forcemaster

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Election

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

Election is a stub Election that always believes to be the master.

func NewElection

func NewElection(id string) *Election

func (*Election) Await

func (ne *Election) Await(ctx context.Context) error

Await returns immediately, as the instance is always the master.

func (*Election) Close

func (ne *Election) Close(ctx context.Context) error

Close does nothing because Election is always the master.

func (*Election) Resign

func (ne *Election) Resign(ctx context.Context) error

Resign cancels the contexts obtained through WithMastership.

func (*Election) WithMastership

func (ne *Election) WithMastership(ctx context.Context) (context.Context, error)

WithMastership returns a cancelable context derived from the passed in context.

type Factory

type Factory struct{}

Factory creates Election instances.

func (Factory) NewElection

func (nf Factory) NewElection(ctx context.Context, resourceID string) (election2.Election, error)

NewElection creates a specific Election instance.

Source Files

Jump to

Keyboard shortcuts

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