agent

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB
	MiB
	GiB
	TiB
)

Variables

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

Functions

func Install

func Install(dir ...string) error

func InteractiveInstall

func InteractiveInstall(spawnShell bool) error

func JSONSchema added in v1.6.0

func JSONSchema(version string) (string, error)

JSONSchema builds a JSON Schema based on the Root Schema and the given version this is helpful when mapping a validation error.

func ListReleases

func ListReleases() []string

func ManualInstall

func ManualInstall(c string, options map[string]string, strictValidations bool) error

func Notify

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

func Recovery

func Recovery() error

func Reset

func Reset(dir ...string) error

func Run

func Run(opts ...Option) error

setup needs edgevpn and k3s installed locally (both k3s and k3s-agent systemd services).

func RunInstall

func RunInstall(options map[string]string) error

func Upgrade

func Upgrade(version, image string, force, debug, strictValidations bool, dirs []string) error

func Validate added in v1.6.0

func Validate(source string) error

Validate ensures that a given schema is Valid according to the Root Schema from the agent.

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 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 added in v1.5.0

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

func (WebUI) HasAddress added in v1.5.0

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