# sdvarlink

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

- URL: https://rossedman.io/projects/sdvarlink/

`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](https://rossedman.github.io/sdvarlink/) has guides, 15 examples and a reference for every interface.
