boot

package
v0.0.0-...-30ff302 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDevice is the default boot device
	DefaultDevice = Device("default")
	// ForcePXE is used to configure pxe as the boot device
	ForcePXE = Device("pxe")
	// ForceDisk is used to configure disk as the boot device
	ForceDisk = Device("disk")
	// ForceBIOS is used to configure bios as the boot device
	ForceBIOS = Device("bios")
)

Variables

This section is empty.

Functions

func RegisterDriver

func RegisterDriver(factory DriverFactory, driver string)

RegisterDriver is called by implementations in order to register their factory function for each device they can control

func SetupLogging

func SetupLogging(l log.Logger)

Types

type Device

type Device string

Device describe bootable devices

type Driver

type Driver interface {
	SetBootOptions(Options) error

	Close() error
}

Driver is the interface to control boot

func NewDriver

func NewDriver(ctx context.Context, name string, opts DriverOptions) (Driver, error)

NewDriver instantiates a new driver by calling the registered factory function

func NewDriverFromGinContext

func NewDriverFromGinContext(c *gin.Context) Driver

NewDriverFromGinContext creates a new Driver using info in the http request

type DriverFactory

type DriverFactory func(context.Context, DriverOptions) (Driver, error)

DriverFactory is used to instantiate a new Driver

type DriverOptions

type DriverOptions struct {
	Address  string
	Username string
	Password string
	ID       string
	Cipher   int
}

DriverOptions contain the basic options needed to connect to device

type Options

type Options struct {
	// Device is the boot device to force.
	Device Device `json:"device" binding:"required"`

	// Persistent controls whether Device should apply to all future boots.
	Persistent bool `json:"persistent,omitempty"`

	// EFI controls whether the the next boot should be in EFI mode.
	EFI bool `json:"efi,omitempty"`
}

Options contain values relevant for boot actions

Jump to

Keyboard shortcuts

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