memory

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package memory implements an in-memory variant of the Decider to allow for quick local/single-process testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decider

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

Decider implements leaderelection.Decider

func NewDecider

func NewDecider() *Decider

NewDecider returns a new, initialized instance

func (*Decider) ReadCurrent

func (d *Decider) ReadCurrent(ctx context.Context) (*entry.RaceEntry, error)

ReadCurrent should provide the latest version of RaceEntry available and put any additional information needed to ensure transactional behavior in the Token-field.

func (*Decider) WriteEntry

func (d *Decider) WriteEntry(ctx context.Context, entry *entry.RaceEntry) (entry.LeaderToken, error)

WriteEntry accepts writes with the correct incarnation The interface{} return value is a new token if the write succeeded.

Jump to

Keyboard shortcuts

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