reconcile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Reconcile

func Reconcile(current, desired State)

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

Types

type Hasher

type Hasher interface {
	Hash() []byte
}

Hasher 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