https://github.com/grokify/fastlywasmly
Compute@Edge Packager
https://github.com/grokify/fastlywasmly
fastly fastly-compute-at-edge
Last synced: 2 months ago
JSON representation
Compute@Edge Packager
- Host: GitHub
- URL: https://github.com/grokify/fastlywasmly
- Owner: grokify
- License: mit
- Created: 2022-05-25T05:02:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-11T06:10:10.000Z (about 1 year ago)
- Last Synced: 2024-03-11T07:27:36.457Z (about 1 year ago)
- Topics: fastly, fastly-compute-at-edge
- Language: Go
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FastlyWasmly
[![Build Status][build-status-svg]][build-status-url]
[![Go Report Card][goreport-svg]][goreport-url]
[![Docs][docs-godoc-svg]][docs-godoc-url]
[![License][license-svg]][license-url][build-status-svg]: https://github.com/grokify/fastlywasmly/workflows/test/badge.svg?branch=main
[build-status-url]: https://github.com/grokify/fastlywasmly/actions/workflows/go_build.yaml
[goreport-svg]: https://goreportcard.com/badge/github.com/grokify/fastlywasmly
[goreport-url]: https://goreportcard.com/report/github.com/grokify/fastlywasmly
[docs-godoc-svg]: https://pkg.go.dev/badge/github.com/grokify/fastlywasmly
[docs-godoc-url]: https://pkg.go.dev/github.com/grokify/fastlywasmly
[license-svg]: https://img.shields.io/badge/license-MIT-fastlywasmly.svg
[license-url]: https://github.com/grokify/fastlywasmly/blob/master/LICENSE`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.
## Usage as CLI
### Installation
```bash
% go install github.com/grokify/fastlywasmly
```### Usage
Loading with WASM file:
```bash
% fastlywasmly -t /path/to/fastly.toml -w /path/to/yourname.wasm
```Loading with bin dir (including WASM file):
```bash
% fastlywasmly -t /path/to/fastly.toml -b /path/to/bin
```## Usage as Library
### Installation
```bash
% go get github.com/grokify/fastlywasmly
```### Usage
```go
package mainimport (
"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)
}
```