Package io.github.pimak.ntfy.core
package io.github.pimak.ntfy.core
-
ClassDescriptionFramework-pure alert engine: the extracted heart of the original Logback
NtfyAlertAppender, decoupled from any logging framework.Framework-neutral snapshot of a single log event, handed toAlertEngine.submit(io.github.pimak.ntfy.core.AlertEvent).One link of an exception chain: the throwable's class name and its message (either may benullin degenerate cases, mirroring the source throwable).The severity of anAlertEvent, as far as the alerting engine is concerned — the valueAlertEngineroutes on.Auth strategy for an outbound ntfy publish request, modeled as a sealed hierarchy so each mode carries only the fields it needs and knows how to build its ownAuthorizationheader.SendsAuthorization: Basic <base64(username:password)>.SendsAuthorization: Bearer <token>.Sends noAuthorizationheader at all — a valid anonymous publish.Resolves anNtfyConfigfrom the ambient environment.Self-diagnostic sink forAlertEngine.Parses the several duration spellings the ntfy configuration surface accepts into aDuration.Projects a logging framework's diagnostic context (MDC) onto the small, bounded, sanitized map ofkey -> valuepairs an alert body may carry — theinclude-mdc-keysfeature.A single ntfy notification action button, modeled as a sealed hierarchy so each action type carries only the fields it needs (mirroring theAuthModepattern).Sends an Android broadcast intent when tapped (only actioned by ntfy's Android app).Sends an HTTP request tourlwhen tapped.Opensurlin the browser/app when the action button is tapped.Generic, standalone ntfy notification client — the "send an arbitrary notification" surface, independent ofAlertEngine's log-alert lifecycle.Immutable, framework-neutral configuration for the ntfy engine and client.Fluent builder forNtfyConfig; every setter returnsthis.Stateless, never-throws HTTP publisher for the ntfy wire format.Thrown out ofAlertEngine.start()when the startup self-test fails andstartup-ping-fail-fastis enabled — the deliberate opt-in that turns a broken alerting configuration into a failed deployment rather than a silent one.Read-only, monotonic observability counters for the alert pipeline, letting operators "alert on the alerter" (e.g. a spike inPipelineCounters.failed()signalling a revoked token or a topic ACL change).An immutable, point-in-time triple of the three counters.What the opt-in startup self-test does whenAlertEngine.start()finishes activating.