go-ruby-dimail

The Ruby face of the Dimail API — a pure-Go gem core that rbgo binds as require "dimail".

pure Go · zero cgo require "dimail" method_missing dispatch 91 operations Hash / Array results Dimail::APIError runnable examples no Ruby-runtime dep 100% coverage 6 arches
Documentation GitHub
Documentation (MkDocs Material + mike) License: BSD-3-Clause Go 1.26.4+ Backed by go-dimail

go-ruby-dimail is the pure-Go, Ruby-runtime-independent core of the Ruby dimail gem: a client for the Dimail API, the mail-hosting management API of the French government's La Suite numérique platform. It is a thin, reflective adapter over the typed client in go-dimail: a Session exposes every one of the client's 91 operations through a single dynamic entry point that maps a Ruby-style snake_case operationId to the Go method, coerces the arguments (Ruby Hashes become request structs), and normalises the result into Ruby data. That uniform surface is what an rbgo method_missing binding drives — but nothing here depends on the Ruby runtime, so it is equally usable as a standalone Go library. 100% coverage, CI green across 6 arches.

Session & dynamic dispatch ready

A Dimail::Session (Ruby: Dimail::Client) over the typed go-dimail client. One dynamic entry point — Call("get_domain", …) — maps a snake_case operationId to the Go method via method_missing.

Every operation ready

All 91 Dimail operations are reachable: users, domains, mailboxes (v1 + v2), aliases, forwards, allows, identities, app-passwords, the /my self-service views, and the /system and /logs admin surface.

Ruby-shaped results ready

Path params are plain values, query params trailing values (omit to leave unset), a request body a Hash. Results normalise to Ruby data — a Hash, an Array of Hashes, or a scalar.

Typed errors ready

Any non-2xx raises Dimail::APIError < Dimail::Error < StandardError, carrying #status, the parsed #detail, and predicates #not_found? / #unauthorized? / #forbidden? / #conflict?.

Runnable examples ready

examples/*.rb cover login, domains, mailboxes and error handling. A Go test ties every operation the examples call back to the real generated API, so the documented Ruby surface cannot drift.

rbgo binding planned

require "dimail" — the thin method_missing shim that exposes this Session inside github.com/go-embedded-ruby (rbgo). Pending in that repo; nothing here depends on the Ruby runtime.

A sibling of go-ruby-regexp and the go-ruby-* stdlib/gem family: the interpreter-independent core of a Ruby library in pure Go, cgo disabled, so it cross-compiles and embeds anywhere. The typed transport, models and errors live in go-dimail (generated from the API's OpenAPI document); this repo is the Ruby-idiomatic, Hash-returning adapter that github.com/go-embedded-ruby binds.