args

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const OperationKeyValidation = "Validation"

OperationKeyValidation represents the key for the Operation field of an ValidationError

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	CPU       bool   `short:"c" long:"cpu" description:"Include the total CPU consumption"`
	Mem       bool   `short:"m" long:"mem" description:"Include the total RAM consumption"`
	Disk      bool   `short:"d" long:"disk" description:"Include the total CPU consumption"`
	Processes bool   `short:"p" long:"proc" description:"Include the top 10 processes"`
	Health    string `long:"health" description:"Make a healthcheck call against the URI"`
	// contains filtered or unexported fields
}

Arguments represent the flags given at program start.

func Parse

func Parse() Arguments

Parse the flags to the Arguments struct.

func (Arguments) Equals

func (a Arguments) Equals(other Arguments) bool

Equals checks for field equality

func (*Arguments) Validate

func (a *Arguments) Validate() []ValidationError

Validate the arguments.

type ValidationError

type ValidationError struct {
	e.BaseError
	Arguments
}

ValidationError is a struct to wrap the error with more information.

func (*ValidationError) Error

func (ve *ValidationError) Error() string

Jump to

Keyboard shortcuts

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