history

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(path string) map[string]node.History

Read reads a JSON file containing a map of string -> candidate. If the file cannot be read or deserialized, it returns an empty map.

func Update

func Update(candidates []node.Node, history map[string]node.History)

Update updates the LastReboot field for all the candidates named in the nodes slice and sets the Status to NotObserved. If a candidate did not previously exist, it creates a new one.

func UpdateStatus

func UpdateStatus(candidates []node.Node, history map[string]node.History)

UpdateStatus updates the history according to the list of nodes to be rebooted on the current run. If a node was in NotObserved status, it will be updated to either ObservedOffline, if it's still in the candidates slice, or ObservedOnline if it's not.

func Write

func Write(path string, candidateHistory map[string]node.History)

Write serializes a string -> candidate map to a JSON file. If the map cannot be serialized or the file cannot be written, it exits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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