← Projects

Project · Go · MIT

sdvarlink active

Typed Go clients for systemd's Varlink APIs, generated from systemd's own interface definitions.

shell
go get github.com/rossedman/sdvarlink@latest

sdvarlink gives Go programs typed, generated clients for systemd’s io.systemd.* Varlink interfaces. It does for Varlink what go-systemd does for D-Bus.

  • Generated from systemd’s IDL. Every io.systemd.* interface in systemd v257, v258 and v260, with structs, enums, errors and upstream doc comments.
  • Streaming as Go iterators. Methods that stream return iter.Seq2; break or cancel the context to stop.
  • File-descriptor passing as *os.File fields over SCM_RIGHTS, with clear ownership rules.
  • Typed errors that work with errors.Is and errors.As, and feature detection with Supports.
  • varlinktest, a fake server for testing without systemd, with record and replay.

Pure Go, no cgo. The docs site has guides, 15 examples and a reference for every interface.

Writing about sdvarlink

  1. Introducing sdvarlink and vlx: systemd's Varlink APIs from Go and the Terminal systemd is moving its APIs from D-Bus to Varlink. sdvarlink gives Go programs typed, generated clients for them, and vlx is a terminal explorer for finding, reading and calling them. 10 min read