agent

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB
	MiB
	GiB
	TiB
)

Variables

View Source
var DefaultBanner = []byte{}/* 12853 elements not displayed */

Functions

func CurrentImage

func CurrentImage() (string, error)

func Install

func Install(sourceImgURL string, dir ...string) error

func InteractiveInstall

func InteractiveInstall(debug, spawnShell bool, sourceImgURL string) error

func ListAllReleases added in v2.6.3

func ListAllReleases(includePrereleases bool) ([]string, error)

func ListNewerReleases added in v2.6.3

func ListNewerReleases(includePrereleases bool) ([]string, error)

func ManualInstall

func ManualInstall(c, sourceImgURL, device string, reboot, poweroff, strictValidations bool) error

func Notify

func Notify(event string, dirs []string) error

func Recovery

func Recovery() error

func Reset

func Reset(reboot, unattended, resetOem bool, dir ...string) error

func Run

func Run(opts ...Option) error

Run starts the agent provider emitting the bootstrap event.

func RunInstall

func RunInstall(c *config.Config) error

func Upgrade

func Upgrade(
	source string, force, strictValidations bool, dirs []string, preReleases, upgradeRecovery bool) error

Types

type BrandingText

type BrandingText struct {
	InteractiveInstall string `yaml:"interactive-install"`
	Install            string `yaml:"install"`
	Reset              string `yaml:"reset"`
	Recovery           string `yaml:"recovery"`
}

type Config

type Config struct {
	Fast     bool         `yaml:"fast,omitempty"`
	WebUI    WebUI        `yaml:"webui"`
	Branding BrandingText `yaml:"branding"`
}

func LoadConfig

func LoadConfig(path ...string) (*Config, error)

type ExtraConfigReset added in v2.7.8

type ExtraConfigReset struct {
	Reset struct {
		ResetOem        bool `json:"reset-oem,omitempty"`
		ResetPersistent bool `json:"reset-persistent,omitempty"`
		Reboot          bool `json:"reboot,omitempty"`
	} `json:"reset"`
}

ExtraConfigReset is the struct that holds the reset options that come from flags and events

type ExtraConfigUpgrade added in v2.7.8

type ExtraConfigUpgrade struct {
	Upgrade struct {
		Recovery       bool `json:"recovery,omitempty"`
		RecoverySystem struct {
			URI string `json:"uri,omitempty"`
		} `json:"recovery-system,omitempty"`
		System struct {
			URI string `json:"uri,omitempty"`
		} `json:"system,omitempty"`
	} `json:"upgrade,omitempty"`
}

ExtraConfigUpgrade is the struct that holds the upgrade options that come from flags and events

type Option

type Option func(o *Options) error

Option is a generic option for the Agent.

var ForceAgent Option = func(o *Options) error {
	o.Force = true
	return nil
}

ForceAgent forces the agent to run.

var RestartAgent Option = func(o *Options) error {
	o.Restart = true
	return nil
}

RestartAgent makes the agent restart on error.

func WithAPI

func WithAPI(address string) Option

WithAPI sets the API address used to talk to EdgeVPN and co-ordinate node bootstrapping.

func WithDirectory

func WithDirectory(dirs ...string) Option

WithDirectory sets the Agent config directories.

type Options

type Options struct {
	APIAddress string
	Dir        []string
	Force      bool
	Restart    bool
}

Options yields the options for the running agent.

func (*Options) Apply

func (o *Options) Apply(opts ...Option) error

Apply applies option to the options struct.

type WebUI

type WebUI struct {
	Disable       bool   `yaml:"disable"`
	ListenAddress string `yaml:"listen_address"`
}

func (WebUI) HasAddress

func (w WebUI) HasAddress() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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