varnish-go

module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: BSD-3-Clause

README

Go SDK for Varnish

CI Go Reference

Important: this is a work-in-progress. Bugs and feature requests welcome via issues or pull requests.

All packages require libvarnishapi (varnish-dev or varnish-devel) (open-source or Enterprise) and CGo.

Packages

vtest — spawn Varnish instances for testing

Go-native alternative to the varnishtest tool. Spin up a real Varnish process, make HTTP requests against it, and inspect VSL logs — all from regular Go tests.

go get github.com/varnish/varnish-go/vtest
log — stream VSL transactions

Read and filter Varnish Shared Log transactions from a live instance or a binary file, equivalent to varnishlog.

log/tags.go exposes named variables for every known VSL tag across Varnish OSS and Enterprise (e.g. log.TagReqURL). Values are resolved at startup; tags absent from the installed Varnish version are left as zero.

go get github.com/varnish/varnish-go/log
stat — read statistics counters

Poll VSC counters from Varnish Shared Memory, equivalent to varnishstat.

go get github.com/varnish/varnish-go/stat
adm — admin socket client

Send CLI commands to a running Varnish instance, equivalent to varnishadm.

go get github.com/varnish/varnish-go/adm
version — installed Varnish version

Reports the installed Varnish edition (open-source or Enterprise), version string, and commit hash, resolved at compile time from vmod_abi.h.

go get github.com/varnish/varnish-go/version

Directories

Path Synopsis
Communicate with a running Varnish instance, the same way the varnishadm command does.
Communicate with a running Varnish instance, the same way the varnishadm command does.
Read VSL logs (like varnishlog, varnishncsa, etc.)
Read VSL logs (like varnishlog, varnishncsa, etc.)
Reads Varnish statistics (like `varnishstat` does) from the Varnish Shared Memory (VSM) using libvarnishapi's VSC (Varnish Statistics Counters) API.
Reads Varnish statistics (like `varnishstat` does) from the Varnish Shared Memory (VSM) using libvarnishapi's VSC (Varnish Statistics Counters) API.
Reports the installed Varnish edition
Reports the installed Varnish edition
Package vtest provides facilities to build one-shot instances that you can test using regular golang HTTP entities.
Package vtest provides facilities to build one-shot instances that you can test using regular golang HTTP entities.

Jump to

Keyboard shortcuts

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