Documentation
¶
Index ¶
- Constants
- func DownloadAndExtract(client *Client, targetVersion string, upgradeConfirmCb DownloadConfirmCB, ...) (*paths.Path, string, error)
- func DownloadImage(client *Client, targetVersion string, upgradeConfirmCb DownloadConfirmCB, ...) (*paths.Path, string, error)
- func ExtractImage(archive, temp *paths.Path) error
- func Flash(ctx context.Context, imagePath *paths.Path, version string, forceYes bool, ...) error
- func FlashBoard(ctx context.Context, downloadedImagePath string, version string, ...) error
- func SetTempDir(prefix string, tempDir string) (*paths.Path, error)
- type Client
- type DownloadConfirmCB
- type HTTPDoer
- type Manifest
- type Option
- type Release
Constants ¶
View Source
const DownloadDiskSpace = uint64(12)
View Source
const ExtractDiskSpace = uint64(10)
View Source
const GiB = uint64(1024 * 1024 * 1024)
Variables ¶
This section is empty.
Functions ¶
func DownloadAndExtract ¶
func DownloadImage ¶
func ExtractImage ¶
func ExtractImage(archive, temp *paths.Path) error
func FlashBoard ¶
func SetTempDir ¶ added in v0.4.0
SetTempDir returns a temporary directory inside the user's cache directory (default). The tempDir parameter is used to change the download/extraction directory. The caller is responsible for removing the directory when no longer needed.
Types ¶
type Client ¶
type Client struct {
HTTPClient HTTPDoer
Headers map[string]string // Optional headers to add to each request
}
Client holds the base URL, command name, allows custom HTTP client, and optional headers.
func (*Client) GetInfoManifest ¶
GetInfoManifest fetches and decodes the Debian images info.json.
type DownloadConfirmCB ¶
DownloadConfirmCB is a function that is called when a Debian image is ready to be downloaded.
type Option ¶
type Option func(*Client)
Option is a functional option for configuring Client.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client for the Client.
func WithHeaders ¶
WithHeaders sets custom headers for the Client.
Click to show internal directories.
Click to hide internal directories.