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/fastlywasmly
Loading with WASM file:
% fastlywasmly -t /path/to/fastly.toml -w /path/to/yourname.wasm
Loading with bin dir (including WASM file):
% fastlywasmly -t /path/to/fastly.toml -b /path/to/bin
% go get github.com/grokify/fastlywasmly
package 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)
}