reconcile

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHashMismatch      = errors.New("checksum mismatch")
	ErrDeepEqualMismatch = errors.New("reflect.Deepequal mismatch")
)

Functions

func Reconcile

func Reconcile(current, desired State, verbose bool)

Reconcile takes two states and applies updates to them until they are the same

Types

type Checksumed added in v1.1.0

type Checksumed interface {
	Sum() []byte
}

Checksumed returns a unique Hash for an object for comparison

type State

type State interface {
	Add(key string, v interface{})
	Update(key string, v interface{})
	Get(key string) interface{}
	Delete(key string)
	Walk(f StateWalkFunc)
}

State represents the interface which Reconciler Accepts

type StateWalkFunc

type StateWalkFunc func(key string, v interface{})

StateWalkFunc walks a state. Walk should be hierarchical to ensure no cascading updates occur.

Jump to

Keyboard shortcuts

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