Documentation ¶
Index ¶
- Constants
- Variables
- func Run(checklist []Check) error
- type Check
- type Checker
- func CommandExecutor(prog string, args ...string) Checker
- func InterfaceCanDoDHCPv6(ifname string) Checker
- func InterfaceExists(ifname string) Checker
- func InterfaceHasGlobalAddresses(ifname string) Checker
- func InterfaceHasLinkLocalAddress(ifname string) Checker
- func LinkAutoneg(ifname string, expected bool) Checker
- func LinkSpeed(ifname string, minSpeed int) Checker
- type Remediator
Constants ¶
const ( ColorBlack = "\x1b[0;30m" ColorRed = "\x1b[0;31m" ColorGreen = "\x1b[0;32m" ColorYellow = "\x1b[0;33m" ColorBlue = "\x1b[0;34m" ColorMagenta = "\x1b[0;35m" ColorGrey = "\x1b[0;36m" ColorNone = "\x1b[0m" )
foreground colours
Variables ¶
var DefaultShell = "elvish"
DefaultShell is used by EmergencyShell
Functions ¶
Types ¶
type Check ¶
type Check struct { Name string Run Checker Remediate Remediator StopOnError bool }
Check is a type that implements a netboot check
type Checker ¶
type Checker func() error
Checker is the type of checking functions
func CommandExecutor ¶
CommandExecutor returns a check that runs the provided command and arguments.
func InterfaceCanDoDHCPv6 ¶
InterfaceCanDoDHCPv6 checks whether DHCPv6 succeeds on an interface, and if it has a valid netboot URL.
func InterfaceExists ¶
InterfaceExists returns a Checker that verifies if an interface is present on the system
func InterfaceHasGlobalAddresses ¶
InterfaceHasGlobalAddresses returns a Checker that verifies if an interface has at least one global address.
func InterfaceHasLinkLocalAddress ¶
InterfaceHasLinkLocalAddress returns a Checker that verifies if an interface has a configured link-local address.
func LinkAutoneg ¶
LinkAutoneg checks if the link auto-negotiation state, and return an error if it's not the expected state.
type Remediator ¶
type Remediator func() error
Remediator is the type of remediation functions
func CommandExecutorRemediation ¶
func CommandExecutorRemediation(prog string, args ...string) Remediator
CommandExecutorRemediation is like CommandExecutor, but returns a Remediator.
func EmergencyShell ¶
func EmergencyShell(banner string) Remediator
EmergencyShell is a remediation that prints the given banner, and then calls an emergency shell.
func InterfaceRemediate ¶
func InterfaceRemediate(ifname string) Remediator
InterfaceRemediate returns a Remediator that tries to fix a missing interface issue.