checklists

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckWrapper added in v0.3.0

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

Little unobtrusive wrapper to chkutils.Check to untie that bind us ;)

func (*CheckWrapper) ID added in v0.3.0

func (cw *CheckWrapper) ID() string

func (*CheckWrapper) New added in v0.3.0

func (cw *CheckWrapper) New(parameters []string) (chkutil.Check, error)

func (*CheckWrapper) Status added in v0.3.0

func (cw *CheckWrapper) Status() (code int, msg string, err error)

type CheckYAML added in v0.3.0

type CheckYAML struct {
	// matches the ID() of the chkutil.Check object, used in construction process
	ID string `json:"id"`
	// the parameters to the check. To be validated upon check construction.
	Parameters []string `json:"parameters"`
}

CheckYAML is the check that gets unmarshalled out of the YAML configuration file.

type Checklist

type Checklist struct {
	Name   string
	Checks []*CheckWrapper // list of (wrapped) 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 FromBytes added in v0.3.0

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

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

func FromDirectory added in v0.3.0

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

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

func FromFile added in v0.3.0

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

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

func FromStdin added in v0.3.0

func FromStdin() (chklst Checklist, err error)

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

func FromURL added in v0.3.0

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

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

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 ChecklistYAML added in v0.3.0

type ChecklistYAML struct {
	Name      string      `json:"name"`
	Checklist []CheckYAML `json"checklist"`
}

ChecklistYAML is the representation of a checklist that's parsed from the YAML, before being converted into an internal representation.

Jump to

Keyboard shortcuts

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