Documentation
¶
Overview ¶
Package compute contains commands to manage Compute@Edge packages.
Index ¶
- Constants
- func GetLatestCrateVersion(client api.HTTPClient, name string) (string, error)
- func GetLatestIdealVersion(versions []*fastly.Version) (*fastly.Version, error)
- type BuildCommand
- type CargoCrateVersion
- type CargoCrateVersions
- type CargoLock
- type CargoManifest
- type CargoPackage
- type Client
- type DeployCommand
- type InitCommand
- type RootCommand
- type Rust
- type Toolchain
- type UpdateCommand
- type ValidateCommand
Constants ¶
const ( // RustToolchainVersion is the `rustup` toolchain string for the compiler // that we support RustToolchainVersion = "1.43.0" // WasmWasiTarget is the Rust compilation target for Wasi capable Wasm. WasmWasiTarget = "wasm32-wasi" )
const ManifestFilename = "fastly.toml"
ManifestFilename is the name of the package manifest file.
Variables ¶
This section is empty.
Functions ¶
func GetLatestCrateVersion ¶ added in v0.8.0
func GetLatestCrateVersion(client api.HTTPClient, name string) (string, error)
GetLatestCrateVersion fetches all versions of a given Rust crate from the crates.io HTTP API and returns the latest valid semver version.
func GetLatestIdealVersion ¶ added in v0.7.1
GetLatestIdealVersion gets the most ideal service version using the following logic: - Find the active version and return - If no active version, find the latest locked version and return - Otherwise return the latest version
Types ¶
type BuildCommand ¶
BuildCommand produces a deployable artifact from files on the local disk.
func NewBuildCommand ¶
func NewBuildCommand(parent common.Registerer, client api.HTTPClient, globals *config.Data) *BuildCommand
NewBuildCommand returns a usable command registered under the parent.
type CargoCrateVersion ¶ added in v0.8.0
type CargoCrateVersion struct {
Version string `json:"num"`
}
CargoCrateVersion models a Cargo crate version returned by the crates.io API.
type CargoCrateVersions ¶ added in v0.8.0
type CargoCrateVersions struct {
Versions []CargoCrateVersion `json:"versions"`
}
CargoCrateVersions models a Cargo crate version returned by the crates.io API.
type CargoLock ¶ added in v0.8.0
type CargoLock struct {
Package []CargoPackage
}
CargoLock models the package confuiguration properties of a Rust Cargo lock file which we are interested in and are read from the Cargo.lock file within the $PWD of the package.
type CargoManifest ¶
type CargoManifest struct {
Package CargoPackage
}
CargoManifest models the package confuiguration properties of a Rust Cargo manifest which we are interested in and are read from the Cargo.toml manifest file within the $PWD of the package.
func (*CargoManifest) Read ¶
func (m *CargoManifest) Read(filename string) error
Read the contents of the Cargo.toml manifest from filename.
type CargoPackage ¶
CargoPackage models the package confuiguration properties of a Rust Cargo package which we are interested in and is embedded within CargoManifest and CargoLock.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a HTTP client with an endpoint and token to make API requests.
func NewClient ¶
func NewClient(client api.HTTPClient, endpoint, token string) *Client
NewClient constructs a new Client.
func (*Client) UpdatePackage ¶
UpdatePackage is an HTTP API client method to update a package on a given service version. It reads the package from a given path and encodes it as multi-part form data in the request with associated content-type. TODO(ph): This should eventually be replaced by the equivilent method in the go-fastly client.
type DeployCommand ¶
DeployCommand deploys an artifact previously produced by build.
func NewDeployCommand ¶
func NewDeployCommand(parent common.Registerer, client api.HTTPClient, globals *config.Data) *DeployCommand
NewDeployCommand returns a usable command registered under the parent.
type InitCommand ¶
InitCommand initializes a Compute@Edge project package on the local machine.
func NewInitCommand ¶
func NewInitCommand(parent common.Registerer, globals *config.Data) *InitCommand
NewInitCommand returns a usable command registered under the parent.
type RootCommand ¶
RootCommand is the parent command for all subcommands in this package. It should be installed under the primary root command.
func NewRootCommand ¶
func NewRootCommand(parent common.Registerer, globals *config.Data) *RootCommand
NewRootCommand returns a new command registered in the parent.
type Rust ¶
type Rust struct {
// contains filtered or unexported fields
}
Rust is an implments Toolchain for the Rust lanaguage.
type UpdateCommand ¶
UpdateCommand calls the Fastly API to update packages.
func NewUpdateCommand ¶
func NewUpdateCommand(parent common.Registerer, client api.HTTPClient, globals *config.Data) *UpdateCommand
NewUpdateCommand returns a usable command registered under the parent.
type ValidateCommand ¶
ValidateCommand validates a package archive.
func NewValidateCommand ¶
func NewValidateCommand(parent common.Registerer, globals *config.Data) *ValidateCommand
NewValidateCommand returns a usable command registered under the parent.