fastlywasmly is a CLI app that will package a Fastly Compute@Edge TOML and WASM file into a Fastly tarball. It can alternately take a bin directly in place of the WASM file to load all the files in the directory and subdirectories.
It builds the tarball filename and internal folder structure using the same same approach as Fastly CLI.
% go install github.com/grokify/fastlywasmlyLoading with WASM file:
% fastlywasmly -t /path/to/fastly.toml -w /path/to/yourname.wasmLoading with bin dir (including WASM file):
% fastlywasmly -t /path/to/fastly.toml -b /path/to/bin% go get github.com/grokify/fastlywasmlypackage main
import (
"fmt"
"github.com/grokify/fastlywasmly/tarutil"
)
func main() {
outfile, err := tarutil.BuildEdgePackage(
"/path/to/fastly.toml",
"/path/to/anything.wasm or empty if using bindir only",
"/path/to/option/bin/dir or empty if using wasm only")
if err != nil {
panic(err)
}
fmt.Printf("WROTE [%s]\n", outfile)
}