go-unifi

Reference

Curated reference for the go-unifi exported API — client, configuration, errors, resources, and the Official OpenAPI surface.

This section is a curated reference. It documents the parts of the API you reach for most — how to build a client, every configuration field, the error model, and the two API surfaces — with the structure, defaults, and gotchas you cannot get from a flat symbol list.

For exhaustive, always-current detail (every resource struct, every field, every method signature), the source of truth is pkg.go.dev. These pages link there liberally rather than re-typing hundreds of generated fields that would drift out of date.

Most resource types are generated from the controller's own API definitions, so they are far better browsed on pkg.go.dev than transcribed here. The curated pages cover the hand-written, stable surface; pkg.go.dev covers the long tail.

Pages

Conventions

  • Every client method takes a context.Context as its first argument.
  • Internal (legacy) methods address a site by its name string ("default"); the Official surface addresses a site by uuid.UUID (resolve it with c.Official().Sites().ResolveID). See Choosing a surface.
  • Errors are wrapped with %w; match sentinels and typed errors with errors.Is / errors.As. See Errors.

On this page