checklists

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckJSON

type CheckJSON struct {
	// ignored, included because JSON doesn't have comments
	Notes string
	// matches the ID() of the chkutil.Check object, used in construction process
	ID string
	// the parameters to the check. To be validated upon check construction.
	Parameters []string
}

chkutil.CheckJSON is the check that gets unmarshalled out of the JSON configuration file. Because this prohibits type safety

type Checklist

type Checklist struct {
	Name, Notes string
	Checks      []chkutil.Check // list of chkutil.Checks to run
	Origin      string          // where did it come from?
}

Checklist is a struct that provides a concise way of thinking about doing several checks and then returning some kind of output.

func ChecklistFromBytes

func ChecklistFromBytes(data []byte) (chklst Checklist, err error)

ChecklistFromBytes takes a bytestring of utf8 encoded JSON and turns it into a checklist struct. Used by all checklist constructors below. It validates the number of parameters that each check has.

func ChecklistFromFile

func ChecklistFromFile(path string) (chklst Checklist, err error)

ChecklistFromFile reads the file at the path and parses its utf8 encoded json data, turning it into a checklist struct.

func ChecklistFromStdin

func ChecklistFromStdin() (chklst Checklist, err error)

ChecklistFromStdin reads the stdin pipe and parses its utf8 encoded json data, turning it into a checklist struct.

func ChecklistFromURL

func ChecklistFromURL(urlstr string, cache bool) (chklst Checklist, err error)

checklistsFromDir reads data retrieved from the URL and parses its utf8 encoded json data, turning it into a checklist struct. It also optionally caches this data at remoteCheckDir, currently "/var/run/distributive/".

func ChecklistsFromDir

func ChecklistsFromDir(dirpath string) (chklsts []Checklist, err error)

ChecklistsFromDir reads all of the files in the path and parses their utf8 encoded json data, turning it into a checklist struct.

func (*Checklist) MakeReport

func (chklst *Checklist) MakeReport() (anyFailed bool, report string)

MakeReport runs all checks concurrently, and produces a user-facing string summary of their run.

type ChecklistJSON

type ChecklistJSON struct {
	Name, Notes string
	Checklist   []CheckJSON
}

chkutil.ChecklsitJSON

Jump to

Keyboard shortcuts

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