Installation
The library
Requires Go 1.27 or later.
go get github.com/caffeine-projects/vlatteImport the packages you use: mockhttp for HTTP, mockgrpc for gRPC, and match for matchers.
| Package | What it's for |
|---|---|
mockhttp | HTTP mock servers |
mockgrpc | gRPC mock servers |
match | Request matchers, such as match.Equal, match.JSONPath and match.All |
match/matchbuild | The matcher lists of mock files, and the registry of custom matchers |
match/matchscenario | Scenario state for mock servers |
webhook | Calling a URL after a mock is served |
fault | Pipes that make an HTTP mock answer wrong |
journal | The request journal |
admin | The admin API |
recipe/<protocol>/<recipe> | Recipes that prepare a server, such as recipe/http/proxyall |
vlatte | The types every mock server shares, and the Go template engine |
The CLI
Homebrew
On macOS and Linux:
brew install caffeine-projects/tap/vlatteHomebrew installs the latest stable release. For a release candidate, use its archive or Docker image, or go install with its tag, such as @v0.2.0-rc.1.
An archive
GitHub Releases has an archive for Linux, macOS and Windows, on amd64 and arm64. Each holds the vlatte binary, which needs nothing else:
VERSION=v0.1.0-rc.1
curl -fsSL "https://github.com/caffeine-projects/vlatte/releases/download/$VERSION/vlatte_${VERSION#v}_linux_amd64.tar.gz" | tar -xz vlatteGo
Requires Go 1.27 or later.
go install github.com/caffeine-projects/vlatte/cmd/vlatte@latestDocker
The image is ghcr.io/caffeine-projects/vlatte, for linux/amd64 and linux/arm64: see Docker.
docker run --rm ghcr.io/caffeine-projects/vlatte:v0.1.0-rc.1 versionVerifying a release
The release workflow of this repository builds every archive and image, and signs them with cosign without a key: the signature names the workflow and the tag it ran for. Each archive also has an SBOM, <archive>.sbom.json, and a provenance attestation.
An archive: check the signature of checksums.txt, then the archive against it.
VERSION=v0.1.0-rc.1
ARCHIVE="vlatte_${VERSION#v}_linux_amd64.tar.gz"
gh release download "$VERSION" -R caffeine-projects/vlatte -p checksums.txt -p checksums.txt.sigstore.json -p "$ARCHIVE"
cosign verify-blob checksums.txt \
--bundle checksums.txt.sigstore.json \
--certificate-identity "https://github.com/caffeine-projects/vlatte/.github/workflows/release.yml@refs/tags/$VERSION" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
sha256sum --ignore-missing -c checksums.txt # shasum -a 256 on macOSOr, with the GitHub CLI alone, check its provenance:
gh attestation verify "$ARCHIVE" -R caffeine-projects/vlatteThe image:
cosign verify "ghcr.io/caffeine-projects/vlatte:$VERSION" \
--certificate-identity "https://github.com/caffeine-projects/vlatte/.github/workflows/release.yml@refs/tags/$VERSION" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
gh attestation verify "oci://ghcr.io/caffeine-projects/vlatte:$VERSION" -R caffeine-projects/vlatteVersions
Versions follow semantic versioning. Until v1.0.0, a minor version may change the API. A version with a suffix, such as v0.1.0-rc.1, is a release candidate. The changes of each version are on GitHub Releases.
Editor support for mock files
Mock files have JSON Schemas at stable addresses. Point your editor at them to get completion and validation: see Mock file schemas.