http

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: MPL-2.0 Imports: 53 Imported by: 0

Documentation

Overview

Package http implements the HTTP frontend.

Index

Constants

View Source
const (
	TargetMetal = "metal"
	TargetCloud = "cloud"
	TargetSBC   = "sbc"
)

Target constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frontend

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

Frontend is the HTTP frontend.

func NewFrontend

func NewFrontend(
	logger *zap.Logger,
	schematicFactory *schematic.Factory,
	assetBuilder *asset.Builder,
	artifactsManager *artifacts.Manager,
	secureBootService *secureboot.Service,
	opts Options,
) (*Frontend, error)

NewFrontend creates a new HTTP frontend.

func (*Frontend) Handler

func (f *Frontend) Handler() http.Handler

Handler returns the HTTP handler.

type Options

type Options struct {
	ExternalURL    *url.URL
	ExternalPXEURL *url.URL

	InstallerInternalRepository name.Repository
	InstallerExternalRepository name.Repository

	CacheSigningKey crypto.PrivateKey

	RemoteOptions []remote.Option
}

Options configures the HTTP frontend.

type WizardParams

type WizardParams struct {
	Target         string
	Version        string
	Arch           string
	Platform       string
	Board          string
	SecureBoot     string
	Extensions     []string
	Cmdline        string
	CmdlineSet     bool
	OverlayOptions string

	SelectedTarget         string
	SelectedVersion        string
	SelectedArch           string
	SelectedPlatform       string
	SelectedBoard          string
	SelectedSecureBoot     string
	SelectedExtensions     []string
	SelectedCmdline        string
	SelectedOverlayOptions string

	// Dynamically set fields.
	PlatformMeta metadata.Platform
	BoardMeta    metadata.SBC
}

WizardParams encapsulates the parameters of the wizard.

Some fields might be not set if we haven't reached that step yet.

func WizardParamsFromRequest

func WizardParamsFromRequest(r *http.Request) WizardParams

WizardParamsFromRequest extracts the wizard parameters from the request.

func (WizardParams) URLValues

func (p WizardParams) URLValues() url.Values

URLValues returns the URL values of the wizard parameters.

Jump to

Keyboard shortcuts

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