console

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NICStateNotFound = iota
	NICStateDown
	NICStateLowerDown
	NICStateUP
)
View Source
const (
	ErrMsgVLANShouldBeANumberInRange string = "VLAN ID should be a number 1 ~ 4094."
	ErrMsgMTUShouldBeANumber         string = "MTU should be a number."
	NtpSettingName                   string = "ntp-servers"
	ErrMsgNoDefaultRoute             string = "No default route found. Please check the router setting on the DHCP server."
)
View Source
const (
	ElementalConfigDir  = "/tmp/elemental"
	ElementalConfigFile = "config.yaml"
)
View Source
const (
	EventInstallStarted  = "STARTED"
	EventInstallSuceeded = "SUCCEEDED"
	EventInstallFailed   = "FAILED"
	PasswordMask         = "******"
)
View Source
const (
	WebhookMaxRetries = 3
)

Variables

View Source
var (
	ErrMsgModeCreateContainsServerURL   = fmt.Sprintf("ServerURL need to be empty in %s mode", config.ModeCreate)
	ErrMsgModeJoinServerURLNotSpecified = fmt.Sprintf("ServerURL can't empty in %s mode", config.ModeJoin)
	ErrMsgModeUnknown                   = "unknown mode"
	ErrMsgTokenNotSpecified             = "token not specified"
	ErrMsgISOURLNotSpecified            = "iso_url is required in automatic installation"

	ErrMsgMgmtInterfaceNotSpecified    = "no management interface specified"
	ErrMsgMgmtInterfaceInvalidMethod   = "management network must configure with either static or DHCP method"
	ErrMsgMgmtInterfaceStaticNoDNS     = "DNS servers are required for static IP address"
	ErrMsgInterfaceNotSpecified        = "no interface specified"
	ErrMsgInterfaceNotSpecifiedForMgmt = "no interface specified for management network"
	ErrMsgInterfaceNotFound            = "interface not found"
	ErrMsgInterfaceIsLoop              = "interface is a loopback interface"
	ErrMsgDeviceNotSpecified           = "no device specified"
	ErrMsgDeviceNotFound               = "device not found"
	ErrMsgDeviceTooSmall               = fmt.Sprintf("device size too small. At least %dG is required", config.SingleDiskMinSizeGiB)
	ErrMsgNoCredentials                = "no SSH authorized keys or passwords are set"
	ErrMsgForceMBROnLargeDisk          = "disk size too large for MBR partitioning table"
	ErrMsgForceMBROnUEFI               = "cannot force MBR on UEFI system"

	ErrMsgNetworkMethodUnknown = "unknown network method"

	ErrMsgSystemSettingsUnknown = "unknown system settings: %s"

	ErrMsgManagementInterfaceNotFound = "" /* 175-byte string literal not displayed */
	ErrMsgUnsupportedSchemeVersion    = "" /* 139-byte string literal not displayed */

	ErrContainerdRegistrySettingNotValidJSON = "could not parse containerd-registry as JSON"
)

Functions

func IsValidEvent

func IsValidEvent(event string) bool

func IsValidHTTPMethod

func IsValidHTTPMethod(method string) bool

func RunConsole

func RunConsole() error

RunConsole starts the console

Types

type ConfigValidator

type ConfigValidator struct {
}

func (ConfigValidator) Validate

func (v ConfigValidator) Validate(cfg *config.HarvesterConfig) error

type Console

type Console struct {
	*gocui.Gui
	// contains filtered or unexported fields
}

Console is the structure of the harvester console

func NewConsole

func NewConsole() (*Console, error)

NewConsole initialize the console

func (*Console) AddElement

func (c *Console) AddElement(name string, element widgets.Element)

AddElement adds an element with name

func (*Console) CloseElement

func (c *Console) CloseElement(name string)

func (*Console) CloseElements

func (c *Console) CloseElements(names ...string)

func (*Console) GetElement

func (c *Console) GetElement(name string) (widgets.Element, error)

GetElement gets an element by name

func (*Console) ShowElement added in v1.0.1

func (c *Console) ShowElement(name string) error

ShowElement shows the element by name

type RenderedWebhook

type RenderedWebhook struct {
	config.Webhook
	RenderedURL     string
	RenderedPayload string
	Valid           bool
}

func (*RenderedWebhook) DebugOutput added in v1.1.2

func (p *RenderedWebhook) DebugOutput(format string)

func (*RenderedWebhook) Handle

func (p *RenderedWebhook) Handle() error

type RendererWebhooks

type RendererWebhooks []RenderedWebhook

func PrepareWebhooks

func PrepareWebhooks(hooks []config.Webhook, context map[string]string) (RendererWebhooks, error)

func (RendererWebhooks) Handle

func (hooks RendererWebhooks) Handle(event string)

type Spinner

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

func NewFocusSpinner added in v0.2.3

func NewFocusSpinner(g *gocui.Gui, panel string, prefix string) *Spinner

func NewSpinner

func NewSpinner(g *gocui.Gui, panel string, prefix string) *Spinner

func (*Spinner) Start

func (s *Spinner) Start()

func (*Spinner) Stop

func (s *Spinner) Stop(err bool, message string)

type TaskResult

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

type UserInputData

type UserInputData struct {
	ServerURL            string
	SSHKeyURL            string
	Password             string
	PasswordConfirm      string
	Address              string
	DNSServers           string
	NTPServers           string
	HasCheckedNTPServers bool
}

type ValidatorInterface

type ValidatorInterface interface {
	Validate(cfg *config.HarvesterConfig) error
}

Jump to

Keyboard shortcuts

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