Documentation
¶
Overview ¶
Package compute contains commands to manage Compute@Edge packages.
Index ¶
- Constants
- type AssemblyScript
- type BuildCommand
- type CargoCrateVersion
- type CargoCrateVersions
- type CargoManifest
- type CargoMetadata
- type CargoPackage
- type DeployCommand
- type InitCommand
- type Language
- type LanguageOptions
- type PublishCommand
- type RootCommand
- type Rust
- type Toolchain
- type UpdateCommand
- type ValidateCommand
Constants ¶
const IgnoreFilePath = ".fastlyignore"
IgnoreFilePath is the filepath name of the Fastly ignore file.
const ManifestFilename = "fastly.toml"
ManifestFilename is the name of the package manifest file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssemblyScript ¶ added in v0.18.0
type AssemblyScript struct{}
AssemblyScript implements Toolchain for the AssemblyScript language.
func NewAssemblyScript ¶ added in v0.18.0
func NewAssemblyScript() *AssemblyScript
NewAssemblyScript constructs a new AssemblyScript.
func (AssemblyScript) Build ¶ added in v0.18.0
func (a AssemblyScript) Build(out io.Writer, verbose bool) error
Build implements the Toolchain interface and attempts to compile the package AssemblyScript source to a Wasm binary.
func (AssemblyScript) Initialize ¶ added in v0.18.0
func (a AssemblyScript) Initialize(out io.Writer) error
Initialize implements the Toolchain interface and initializes a newly cloned package by installing required dependencies.
type BuildCommand ¶
type BuildCommand struct { common.Base // NOTE: these are public so that the "publish" composite command can set the // values appropriately before calling the Exec() function. PackageName string Lang string IncludeSrc bool Force bool // contains filtered or unexported fields }
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 CargoManifest ¶
type CargoManifest struct {
Package CargoPackage
}
CargoManifest models the package configuration 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(fpath string) error
Read the contents of the Cargo.toml manifest from filename.
type CargoMetadata ¶ added in v0.13.0
type CargoMetadata struct { Package []CargoPackage `json:"packages"` TargetDirectory string `json:"target_directory"` }
CargoMetadata models information about the workspace members and resolved dependencies of the current package via `cargo metadata` command output.
func (*CargoMetadata) Read ¶ added in v0.13.0
func (m *CargoMetadata) Read() error
Read the contents of the Cargo.lock file from filename.
type CargoPackage ¶
type CargoPackage struct { Name string `toml:"name" json:"name"` Version string `toml:"version" json:"version"` Dependencies []CargoPackage `toml:"-" json:"dependencies"` }
CargoPackage models the package configuration properties of a Rust Cargo package which we are interested in and is embedded within CargoManifest and CargoLock.
type DeployCommand ¶
type DeployCommand struct { common.Base // NOTE: these are public so that the "publish" composite command can set the // values appropriately before calling the Exec() function. Path string Version common.OptionalInt // contains filtered or unexported fields }
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, client api.HTTPClient, globals *config.Data) *InitCommand
NewInitCommand returns a usable command registered under the parent.
type Language ¶ added in v0.18.0
type Language struct { Name string DisplayName string StarterKits []config.StarterKit SourceDirectory string IncludeFiles []string Toolchain }
Language models a Compute@Edge source language.
func NewLanguage ¶ added in v0.18.0
func NewLanguage(options *LanguageOptions) *Language
NewLanguage constructs a new Language from a LangaugeOptions.
type LanguageOptions ¶ added in v0.18.0
type LanguageOptions struct { Name string DisplayName string StarterKits []config.StarterKit SourceDirectory string IncludeFiles []string Toolchain Toolchain }
LanguageOptions models configuration options for a Language.
type PublishCommand ¶ added in v0.27.0
PublishCommand produces and deploys an artifact from files on the local disk.
func NewPublishCommand ¶ added in v0.27.0
func NewPublishCommand(parent common.Registerer, globals *config.Data, build *BuildCommand, deploy *DeployCommand) *PublishCommand
NewPublishCommand returns a usable command registered under the parent.
func (*PublishCommand) Exec ¶ added in v0.27.0
Exec implements the command interface.
NOTE: unlike other non-aggregate commands that initialize a new text.Progress type for displaying progress information to the user, we don't use that in this command because the nested commands overlap the output in non-deterministic ways. It's best to leave those nested commands to handle the progress indicator.
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 implements Toolchain for the Rust language.
func NewRust ¶ added in v0.18.0
func NewRust(client api.HTTPClient, config *config.Data) *Rust
NewRust constructs a new Rust.
func (Rust) Build ¶
Build implements the Toolchain interface and attempts to compile the package Rust source to a Wasm binary.
func (Rust) IncludeFiles ¶ added in v0.18.0
IncludeFiles implements the Toolchain interface and returns a list of additional files to include in the package archive for Rust packages.
func (Rust) Initialize ¶ added in v0.18.0
Initialize implements the Toolchain interface and initializes a newly cloned package. It is a noop for Rust as the Cargo toolchain handles these steps.
func (Rust) SourceDirectory ¶ added in v0.18.0
SourceDirectory implements the Toolchain interface and returns the source directory for Rust packages.
type Toolchain ¶
type Toolchain interface { Initialize(out io.Writer) error Verify(out io.Writer) error Build(out io.Writer, verbose bool) error }
Toolchain abstracts a Compute@Edge source language toolchain.
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.