controller

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// UpdateSectionHardware targets hardware (firmware) controller updates.
	UpdateSectionHardware = models.UpdateSectionHardware
	// UpdateSectionSoftware targets software controller updates.
	UpdateSectionSoftware = models.UpdateSectionSoftware
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller is the controller-level API facade. Controller-scoped operations that do not belong to a site are served through it.

func New

func New(controllerURL, username, password string, opts ...Option) (*Controller, error)

New creates a Controller for the controller at controllerURL and performs the initial login. New has no context; the initial login uses context.Background.

func (*Controller) Close

func (cl *Controller) Close() error

Close releases pooled idle connections.

func (*Controller) ControllerInfo

func (cl *Controller) ControllerInfo(ctx context.Context) (models.ControllerInfo, error)

models.ControllerInfo fetches unauthenticated controller diagnostic information.

func (*Controller) ControllerVersion

func (cl *Controller) ControllerVersion(ctx context.Context) (models.Version, error)

ControllerVersion returns the controller software version.

func (*Controller) FirmwareUpdates

func (cl *Controller) FirmwareUpdates(ctx context.Context) (models.ControllerUpdateInfo, error)

FirmwareUpdates checks for controller firmware updates.

func (*Controller) GetControllerUpgradeStatus

func (cl *Controller) GetControllerUpgradeStatus(ctx context.Context) (*models.HardwareUpgradeStatus, error)

GetControllerUpgradeStatus returns the status of an ongoing hardware controller firmware upgrade.

func (*Controller) InstallControllerFirmware

func (cl *Controller) InstallControllerFirmware(ctx context.Context, targetVersion string) error

InstallControllerFirmware installs controller firmware to the given target version.

func (*Controller) Reboot

func (cl *Controller) Reboot(ctx context.Context) error

Reboot reboots the controller.

func (*Controller) SetCertificate

func (cl *Controller) SetCertificate(ctx context.Context, keyPEM, certPEM string) error

SetCertificate uploads a PEM certificate and its unencrypted private key, then makes them the controller's HTTPS certificate. It changes only the certificate setting.

func (*Controller) Shutdown

func (cl *Controller) Shutdown(ctx context.Context) error

Shutdown shuts the controller down.

func (*Controller) Site

func (cl *Controller) Site(ctx context.Context, siteID string) (models.Site, error)

Site returns the site with the given controller site ID.

func (*Controller) SiteByName

func (cl *Controller) SiteByName(ctx context.Context, name string) (models.Site, error)

SiteByName resolves a site by display name.

func (*Controller) SiteClient

func (cl *Controller) SiteClient(ctx context.Context, siteID string) (*site.SiteClient, error)

SiteClient validates the site and returns a site-scoped client handle.

func (*Controller) Sites

func (cl *Controller) Sites(ctx context.Context) ([]models.Site, error)

Sites lists the sites the current user can administer.

func (*Controller) UpdateFirmwareChannel

func (cl *Controller) UpdateFirmwareChannel(ctx context.Context, section UpdateSection, channel string) error

UpdateFirmwareChannel selects the firmware release channel to check.

type Option

type Option func(*options)

Option customizes a Controller.

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient sets the *http.Client used for controller requests.

func WithInsecureSkipVerify

func WithInsecureSkipVerify() Option

WithInsecureSkipVerify enables TLS certificate verification skipping.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the timeout applied to controller requests.

type SiteClient

type SiteClient = site.SiteClient

SiteClient is the site-scoped API handle, defined in the site package.

type UpdateSection

type UpdateSection = models.UpdateSection

UpdateSection is the firmware update section, defined in the models package.

Directories

Path Synopsis
internal
testutil
Package testutil provides shared mock-controller test helpers for the controller and site package tests.
Package testutil provides shared mock-controller test helpers for the controller and site package tests.

Jump to

Keyboard shortcuts

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