Generated from OpenAPI ready
Typed models and request methods are generated from the API’s own committed openapi.json by an in-tree generator. Refresh with go generate ./...; CI fails if the checked-in code drifts from the spec.
A pure-Go client for the Dimail API — generated from the API's OpenAPI document, no cgo.
go-dimail is a pure-Go (no cgo) client for the Dimail API, the
mail-hosting management API of the French government's La Suite numérique platform. The
typed models and request methods are generated from the API's own OpenAPI document
(committed in the repo) by an in-tree generator, so the whole surface — 96 models
and 91 methods across users, domains, mailboxes, aliases, forwards, identities and
the admin endpoints — stays faithful to the spec and regenerates with go generate ./....
The hand-written runtime adds Basic→bearer authentication, an HTTP transport, and a typed
APIError. 100% test coverage, race-clean, CI green across 6 architectures.
Typed models and request methods are generated from the API’s own committed openapi.json by an in-tree generator. Refresh with go generate ./...; CI fails if the checked-in code drifts from the spec.
96 typed models and 91 methods — one per operation: users, domains, mailboxes (v1 + v2), aliases, forwards, allows, identities, app-passwords, the /my views, and the /system and /logs admin surface.
HTTP Basic → bearer token. Login(ctx) mints and stores a token; the client sends the bearer when set and falls back to Basic otherwise. Functional options for base URL, HTTP client, token and User-Agent.
Every non-2xx response is an *APIError carrying the status, the request, the raw body and the FastAPI detail, with NotFound() / Unauthorized() / Forbidden() / Conflict() predicates.
Pure Go, no cgo: the same test binary builds and runs identically on amd64, arm64, riscv64, loong64, ppc64le and s390x. 100% test coverage, race-clean, enforced in CI.
The Ruby-idiomatic adapter lives in the sibling org go-ruby-dimail — a Session that returns Ruby Hashes/Arrays, bound by rbgo as require "dimail".
Generated from source for reproducibility: the OpenAPI document and the
generator both live in the tree, and CI fails if the checked-in generated code drifts from the
spec. The client is CGO-free, so it cross-compiles and embeds anywhere. Its Ruby-idiomatic face —
a Hash-returning Session bound by rbgo as require "dimail" — lives in the
sibling org go-ruby-dimail.