compute

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package compute contains commands to manage Compute@Edge packages.

Index

Constants

View Source
const (
	// RustToolchainVersion is the `rustup` toolchain string for the compiler
	// that we support
	RustToolchainVersion = "1.40.0"
	// WasmWasiTarget is the Rust compilation target for Wasi capable Wasm.
	WasmWasiTarget = "wasm32-wasi"
)
View Source
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 BuildCommand

type BuildCommand struct {
	common.Base
	// contains filtered or unexported fields
}

BuildCommand produces a deployable artifact from files on the local disk.

func NewBuildCommand

func NewBuildCommand(parent common.Registerer, globals *config.Data) *BuildCommand

NewBuildCommand returns a usable command registered under the parent.

func (*BuildCommand) Exec

func (c *BuildCommand) Exec(in io.Reader, out io.Writer) (err error)

Exec implements the command interface.

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

type CargoPackage struct {
	Name string `toml:"name"`
}

CargoPackage models the package confuiguration properties of a Rust Cargo package which we are interested in and is embedded within CargoManifest.

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

func (c *Client) UpdatePackage(serviceID string, v int, path string) error

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

type DeployCommand struct {
	common.Base
	// 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.

func (*DeployCommand) Exec

func (c *DeployCommand) Exec(in io.Reader, out io.Writer) (err error)

Exec implements the command interface.

type InitCommand

type InitCommand struct {
	common.Base
	// contains filtered or unexported fields
}

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.

func (*InitCommand) Exec

func (c *InitCommand) Exec(in io.Reader, out io.Writer) (err error)

Exec implements the command interface.

type RootCommand

type RootCommand struct {
	common.Base
}

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.

func (*RootCommand) Exec

func (c *RootCommand) Exec(in io.Reader, out io.Writer) error

Exec implements the command interface.

type Rust

type Rust struct{}

Rust is an implments Toolchain for the Rust lanaguage.

func (Rust) Build

func (r Rust) Build(out io.Writer) error

Build implments the Toolchain interface and attempts to compile the package Rust source to a Wasm binary.

func (Rust) Verify

func (r Rust) Verify(out io.Writer) error

Verify implments the Toolchain interface and verifies whether the Rust language toolchain is correctly configured on the host.

type Toolchain

type Toolchain interface {
	Verify(out io.Writer) error
	Build(out io.Writer) error
}

Toolchain abstracts a Compute@Edge source language toolchain.

func GetToolchain

func GetToolchain(l string) (Toolchain, error)

GetToolchain returns a Toolchain for the provided language.

type UpdateCommand

type UpdateCommand struct {
	common.Base
	// contains filtered or unexported fields
}

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.

func (*UpdateCommand) Exec

func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) (err error)

Exec invokes the application logic for the command.

type ValidateCommand

type ValidateCommand struct {
	common.Base
	// contains filtered or unexported fields
}

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.

func (*ValidateCommand) Exec

func (c *ValidateCommand) Exec(in io.Reader, out io.Writer) error

Exec implements the command interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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