Go client
The Go client (go get github.com/aramirez087/Varta/clients/go) is a first-class peer of the Rust varta-client crate. It tracks the same wire-format contract, passes the same tools/vlp-test-vectors.json conformance suite, and interoperates with the same varta-watch observer binary.
Install
go get github.com/aramirez087/Varta/clients/go
Requires Go 1.21+. The base module (UDS + plaintext UDP) has no registry dependencies. ConnectSecureUDP adds golang.org/x/crypto.
20-line example
package main
import (
"log"
"time"
varta "github.com/aramirez087/Varta/clients/go"
)
func main() {
// Connect once. path must match --socket on your observer.
agent, err := varta.Connect("/run/varta/varta.sock")
if err != nil {
log.Fatal(err)
}
defer agent.Close()
for {
if outcome := agent.Beat(varta.StatusOK, 0); outcome.IsDropped() {
// Four-way taxonomy mirrors the Rust client:
log.Printf("varta: dropped (%s)", outcome.DropReason())
}
time.Sleep(500 * time.Millisecond)
}
}
For payload encoding, fork-safety, the panic-handler subpackage, the full transport comparison, and the complete API parity matrix see the package README:
clients/go/README.md.
Transports
| Transport | Status | Notes |
|---|---|---|
| Unix Domain Sockets | Supported | varta.Connect(path). Stdlib-only. Classified BeatOrigin::KernelAttested only on observer platforms with pathname-UDS peer credentials; macOS observers treat pathname UDS as socket-mode-only, so recovery is refused. |
| Plaintext UDP | Supported | varta.ConnectUDP(host, port). Connected-mode socket. Beats classified NetworkUnverified; recovery refused. |
| Secure UDP (ChaCha20-Poly1305) | Supported | varta.ConnectSecureUDP(host, port, key). Adds golang.org/x/crypto. |
| Master-key secure UDP | Supported | varta.ConnectSecureUDPWithMaster(host, port, masterKey) |
Stability
- Wire format: VLP v0.2, governed by the spec.
- Go API: independent semver, tracked in
clients/go/CHANGELOG.md.