Skip to content

chore: propagate main into development - #8

Merged
Wikid82 merged 10 commits into
developmentfrom
main
Aug 17, 2026
Merged

chore: propagate main into development#8
Wikid82 merged 10 commits into
developmentfrom
main

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR carrying commits pushed directly to main (hotfixes, CI-generated
commits) down into development. nightly is intentionally skipped — it picks
these up via the daily development sync instead.

Triggered by push 3cc375e to main.

Wikid82 and others added 10 commits August 17, 2026 01:09
Register/New/RegisteredTypes at the module root, mirroring the
database/sql self-registration idiom: Register panics on a nil factory
or duplicate name (programmer error, caught at init time); New returns
an error (never panics) for an unregistered provider type. Thread-safe
via a sync.RWMutex-guarded map.

This is the enabling mechanism for per-provider init()-based
registration landing in follow-up commits.
StringField/StringSliceField extract plain string/[]string values out
of a Factory's generic map[string]any config, tolerating missing or
wrong-typed keys by returning the zero value rather than erroring —
each provider's register.go decides which zero values are actually
required. Avoids duplicating the same type-assert boilerplate across
eight register.go files.
Each package gains an init()-time notify.Register("<name>", factory)
call in a new register.go, adapting the generic map[string]any config
into the package's typed Config via the shared regconfig helpers. The
existing typed New(cfg, wrapper) constructors are unchanged.
…egistry

Same init()-time notify.Register pattern as discord/slack, adapted to
each package's own Config fields (gotify/ntfy: url+token; pushover:
user_key+api_token+base_url).
Same init()-time notify.Register pattern as the other providers,
adapted to each package's own Config fields (telegram: bot_token+
chat_id+base_url; webhook: url).
Highest-design-risk registration: email.Config carries non-serializable
Mailer/TemplateRenderer interfaces and a TemplateName closure, so its
factory takes these directly out of the map[string]any config (under
"mailer"/"renderer"/"template_name") rather than JSON-round-tripping
plain data like the seven HTTP providers. "mailer" is the one required
key; a missing or wrong-typed value returns an error, never a panic.
One-line "import _ .../providers/all" gets every built-in provider
registered, for consumers that want zero-touch discovery over
hand-picked imports. Includes a count-check test (asserting exactly 8
registered types) that acts as the CI safety net for the one step in
adding a new provider with no compiler enforcement — forgetting to add
it to this bundle.
- ARCHITECTURE.md (new): module layer overview, the Sender contract,
  a step-by-step "adding a new provider" guide (layout, Config/New
  conventions, the Register/factory template, providers/all wiring,
  naming/test conventions, error-handling conventions), registry
  internals, and a versioning note — precise enough for a human
  contributor or a coding agent to add a provider without guessing.
- README.md: new "Provider registry" section covering notify.Register/
  New, the providers/all quick-start, and a pointer to the fuller docs.
- docs/INTEGRATION.md (new): Five Ws and One H guide for integrating
  this module into an unrelated project, with a full go-get-to-dispatch
  code walkthrough.
Adds the [0.2.0] entry documenting the provider registry addition,
explaining why it's a minor bump despite being purely additive at the
Go-API level (init()-time global registration side effect,
panic-on-duplicate-name as a new failure mode). Also retroactively
splits the prior catch-all "Unreleased" entry into a proper [0.1.0]
section, since that content already shipped under the existing v0.1.0
tag and was never moved out of Unreleased.
feat: add self-registering provider factory (v0.2.0)
@Wikid82
Wikid82 marked this pull request as ready for review August 17, 2026 02:16
@Wikid82
Wikid82 merged commit ccab655 into development Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant