Documentation
¶
Overview ¶
Package notifications provides notification dispatching to external providers.
Index ¶
- Constants
- func RegisterProvider(t ProviderType, factory Factory)
- type AppriseConfig
- type AppriseProvider
- type CustomScriptConfig
- type CustomScriptProvider
- type DiscordConfig
- type DiscordProvider
- type Dispatcher
- type EmailConfig
- type EmailProvider
- type EmbyConfig
- type Factory
- type GotifyConfig
- type GotifyProvider
- type JellyfinConfig
- type KodiConfig
- type KodiProvider
- type MailgunConfig
- type MailgunProvider
- type Message
- type NotifiarrConfig
- type NotifiarrProvider
- type NtfyConfig
- type NtfyProvider
- type PlexConfig
- type PlexEmbyClient
- func (c *PlexEmbyClient) TriggerEmbyScan(ctx context.Context, cfg EmbyConfig, libraryPath string) error
- func (c *PlexEmbyClient) TriggerJellyfinScan(ctx context.Context, cfg JellyfinConfig, libraryPath string) error
- func (c *PlexEmbyClient) TriggerPlexScan(ctx context.Context, cfg PlexConfig, libraryPath string) error
- type Provider
- type ProviderType
- type PushbulletConfig
- type PushbulletProvider
- type PushoverConfig
- type PushoverProvider
- type SendGridConfig
- type SendGridProvider
- type SlackConfig
- type SlackProvider
- type TelegramConfig
- type TelegramProvider
- type WebhookConfig
- type WebhookProvider
Constants ¶
const ( // Core lifecycle events. EventTest = "test" EventImportCompleted = "import_completed" EventDownloadCompleted = "download_completed" EventDownloadGrabbed = "download_grabbed" EventUpgradeAvailable = "upgrade_available" EventApplicationUpdate = "application_update" // Health events — emitted by the periodic checker. EventHealthIssue = "health_issue" EventHealthRestored = "health_restored" // Manual-interaction events — emitted when a download cannot proceed // without operator input (e.g., a magnet that resolved but couldn't be // matched to a release, an NZB that failed PAR2 verification). EventManualInteractionRequired = "manual_interaction_required" // File / library mutation events. Series-side (Sonarr parity). EventRename = "rename" EventSeriesAdd = "series_add" EventSeriesDelete = "series_delete" EventEpisodeFileDelete = "episode_file_delete" // File / library mutation events. Movie-side (Radarr parity). EventMovieAdded = "movie_added" EventMovieDelete = "movie_delete" EventMovieFileDelete = "movie_file_delete" )
Event types for alert rules. Aligned with the Sonarr/Radarr Custom Script event-type list so XMedia notifications can drive scripts originally written for the *arr stack with a single `sonarr_` → `xmedia_` env-var prefix rename.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶ added in v0.9.0
func RegisterProvider(t ProviderType, factory Factory)
RegisterProvider associates a provider type with its factory. Intended for use in init() blocks of provider implementation files. Panics on duplicate registration so misconfiguration is caught at startup.
Types ¶
type AppriseConfig ¶ added in v0.9.0
type AppriseConfig struct {
APIURL string `json:"api_url"` // e.g. http://localhost:8000/notify/<key>
Tag string `json:"tag,omitempty"`
}
AppriseConfig is the JSON shape for an Apprise endpoint.
type AppriseProvider ¶ added in v0.9.0
type AppriseProvider struct {
// contains filtered or unexported fields
}
AppriseProvider posts notifications to a self-hosted Apprise API.
func NewAppriseProvider ¶ added in v0.9.0
func NewAppriseProvider(rawConfig []byte) (*AppriseProvider, error)
NewAppriseProvider parses raw JSON config and validates the URL.
func (*AppriseProvider) Send ¶ added in v0.9.0
func (p *AppriseProvider) Send(ctx context.Context, msg *Message) error
Send POSTs the message body to the Apprise API.
func (*AppriseProvider) Test ¶ added in v0.9.0
func (p *AppriseProvider) Test(ctx context.Context) error
Test sends a test notification.
func (*AppriseProvider) Type ¶ added in v0.9.0
func (p *AppriseProvider) Type() ProviderType
Type implements Provider.
type CustomScriptConfig ¶ added in v0.9.0
type CustomScriptConfig struct {
Path string `json:"path"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
}
CustomScriptConfig holds the script path + optional timeout.
type CustomScriptProvider ¶ added in v0.9.0
type CustomScriptProvider struct {
// contains filtered or unexported fields
}
CustomScriptProvider executes a shell script when notification events fire.
func NewCustomScriptProvider ¶ added in v0.9.0
func NewCustomScriptProvider(rawConfig []byte) (*CustomScriptProvider, error)
NewCustomScriptProvider parses the JSON config and validates the script.
func (*CustomScriptProvider) Send ¶ added in v0.9.0
func (p *CustomScriptProvider) Send(ctx context.Context, msg *Message) error
Send executes the configured script with event metadata in env vars. The script's exit code is treated as success/failure (non-zero = error).
func (*CustomScriptProvider) Test ¶ added in v0.9.0
func (p *CustomScriptProvider) Test(ctx context.Context) error
Test runs the script with a simulated "test" event so the user can verify their script path and permissions are correct before relying on it.
func (*CustomScriptProvider) Type ¶ added in v0.9.0
func (p *CustomScriptProvider) Type() ProviderType
Type implements Provider.
type DiscordConfig ¶
type DiscordConfig struct {
WebhookURL string `json:"webhook_url"`
}
DiscordConfig holds the webhook URL for a Discord provider.
type DiscordProvider ¶
type DiscordProvider struct {
// contains filtered or unexported fields
}
DiscordProvider sends notifications via a Discord webhook.
func NewDiscordProvider ¶
func NewDiscordProvider(rawConfig []byte) (*DiscordProvider, error)
NewDiscordProvider creates a Discord provider from raw JSON config.
func (*DiscordProvider) Send ¶
func (p *DiscordProvider) Send(ctx context.Context, msg *Message) error
Send posts a message embed to the Discord webhook.
func (*DiscordProvider) Test ¶
func (p *DiscordProvider) Test(ctx context.Context) error
Test sends a test message to verify the webhook is functional.
func (*DiscordProvider) Type ¶
func (p *DiscordProvider) Type() ProviderType
Type returns the provider type.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher routes events to the appropriate notification providers via alert rules.
func NewDispatcher ¶
func NewDispatcher(database *db.Queries, logger *slog.Logger) *Dispatcher
NewDispatcher creates a new Dispatcher.
type EmailConfig ¶
type EmailConfig struct {
Host string `json:"host"`
Port int `json:"port"`
User string `json:"username"`
Passwd string `json:"password"` //nolint:gosec // SMTP password field, not a hardcoded secret
From string `json:"from"`
To string `json:"to"`
}
EmailConfig holds SMTP credentials for an email provider.
type EmailProvider ¶
type EmailProvider struct {
// contains filtered or unexported fields
}
EmailProvider sends notifications via SMTP email.
func NewEmailProvider ¶
func NewEmailProvider(rawConfig []byte) (*EmailProvider, error)
NewEmailProvider creates an email provider from raw JSON config.
func (*EmailProvider) Send ¶
func (p *EmailProvider) Send(_ context.Context, msg *Message) error
Send delivers an HTML email notification via SMTP with STARTTLS.
func (*EmailProvider) Test ¶
func (p *EmailProvider) Test(ctx context.Context) error
Test sends a test email to verify SMTP configuration.
func (*EmailProvider) Type ¶
func (p *EmailProvider) Type() ProviderType
Type returns the provider type.
type EmbyConfig ¶ added in v0.9.0
EmbyConfig holds Emby server configuration.
type Factory ¶ added in v0.9.0
Factory builds a Provider from raw JSON config. Each provider package registers its factory at init() time via RegisterProvider.
func LookupProvider ¶ added in v0.9.0
func LookupProvider(t ProviderType) (Factory, bool)
LookupProvider returns the factory for a given provider type, or false.
type GotifyConfig ¶ added in v0.9.0
type GotifyConfig struct {
URL string `json:"url"`
Token string `json:"token"`
Priority int `json:"priority,omitempty"`
}
GotifyConfig holds the Gotify server URL and per-app token.
type GotifyProvider ¶ added in v0.9.0
type GotifyProvider struct {
// contains filtered or unexported fields
}
GotifyProvider posts messages to a Gotify server.
func NewGotifyProvider ¶ added in v0.9.0
func NewGotifyProvider(rawConfig []byte) (*GotifyProvider, error)
NewGotifyProvider builds a Gotify provider from raw JSON config.
func (*GotifyProvider) Send ¶ added in v0.9.0
func (p *GotifyProvider) Send(ctx context.Context, msg *Message) error
Send pushes a message to Gotify.
func (*GotifyProvider) Test ¶ added in v0.9.0
func (p *GotifyProvider) Test(ctx context.Context) error
Test pushes a test message.
func (*GotifyProvider) Type ¶ added in v0.9.0
func (p *GotifyProvider) Type() ProviderType
Type implements Provider.
type JellyfinConfig ¶ added in v0.9.0
JellyfinConfig holds Jellyfin server configuration. Same shape as EmbyConfig (Jellyfin is an Emby fork that kept the v3 API surface), but kept as a distinct type for clarity at call-sites and to allow divergence if Jellyfin's API evolves.
type KodiConfig ¶ added in v0.9.0
type KodiConfig struct {
URL string `json:"url"` // e.g. http://kodi.local:8080/jsonrpc
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Image string `json:"image,omitempty"` // optional notification icon URL
}
KodiConfig holds the JSON-RPC URL plus optional basic auth.
type KodiProvider ¶ added in v0.9.0
type KodiProvider struct {
// contains filtered or unexported fields
}
KodiProvider posts JSON-RPC notifications to Kodi.
func NewKodiProvider ¶ added in v0.9.0
func NewKodiProvider(rawConfig []byte) (*KodiProvider, error)
NewKodiProvider parses raw JSON config.
func (*KodiProvider) Send ¶ added in v0.9.0
func (p *KodiProvider) Send(ctx context.Context, msg *Message) error
Send fires GUI.ShowNotification on the Kodi instance.
func (*KodiProvider) Test ¶ added in v0.9.0
func (p *KodiProvider) Test(ctx context.Context) error
Test fires a test notification.
func (*KodiProvider) Type ¶ added in v0.9.0
func (p *KodiProvider) Type() ProviderType
Type implements Provider.
type MailgunConfig ¶ added in v0.9.0
type MailgunConfig struct {
APIKey string `json:"api_key"`
Domain string `json:"domain"`
From string `json:"from"`
To string `json:"to"`
Region string `json:"region,omitempty"` // "us" (default) or "eu"
}
MailgunConfig holds the API key + sender + recipient.
type MailgunProvider ¶ added in v0.9.0
type MailgunProvider struct {
// contains filtered or unexported fields
}
MailgunProvider sends transactional email via Mailgun.
func NewMailgunProvider ¶ added in v0.9.0
func NewMailgunProvider(rawConfig []byte) (*MailgunProvider, error)
NewMailgunProvider parses raw JSON config.
func (*MailgunProvider) Send ¶ added in v0.9.0
func (p *MailgunProvider) Send(ctx context.Context, msg *Message) error
Send dispatches a plain-text email via Mailgun's HTTP API.
func (*MailgunProvider) Test ¶ added in v0.9.0
func (p *MailgunProvider) Test(ctx context.Context) error
Test sends a test email.
func (*MailgunProvider) Type ¶ added in v0.9.0
func (p *MailgunProvider) Type() ProviderType
Type implements Provider.
type Message ¶
type Message struct {
Title string
Body string
Level string // "info", "warning", "error"
Fields map[string]string
}
Message is the payload sent to a notification provider.
type NotifiarrConfig ¶ added in v0.9.0
type NotifiarrConfig struct {
APIKey string `json:"api_key"`
Application string `json:"application,omitempty"` // e.g. "xmedia"
}
NotifiarrConfig is the JSON shape for the Notifiarr provider.
type NotifiarrProvider ¶ added in v0.9.0
type NotifiarrProvider struct {
// contains filtered or unexported fields
}
NotifiarrProvider posts events to Notifiarr's passthrough endpoint.
func NewNotifiarrProvider ¶ added in v0.9.0
func NewNotifiarrProvider(rawConfig []byte) (*NotifiarrProvider, error)
NewNotifiarrProvider parses raw JSON config.
func (*NotifiarrProvider) Send ¶ added in v0.9.0
func (p *NotifiarrProvider) Send(ctx context.Context, msg *Message) error
Send posts the event to the Notifiarr passthrough endpoint.
func (*NotifiarrProvider) Test ¶ added in v0.9.0
func (p *NotifiarrProvider) Test(ctx context.Context) error
Test sends a test message.
func (*NotifiarrProvider) Type ¶ added in v0.9.0
func (p *NotifiarrProvider) Type() ProviderType
Type implements Provider.
type NtfyConfig ¶ added in v0.9.0
type NtfyConfig struct {
URL string `json:"url"` // e.g. https://ntfy.sh/my-topic
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Token string `json:"token,omitempty"` // Bearer token (newer auth)
Priority int `json:"priority,omitempty"` // 1 (min) – 5 (max)
}
NtfyConfig holds the topic URL plus optional auth.
type NtfyProvider ¶ added in v0.9.0
type NtfyProvider struct {
// contains filtered or unexported fields
}
NtfyProvider posts plaintext messages to an ntfy topic.
func NewNtfyProvider ¶ added in v0.9.0
func NewNtfyProvider(rawConfig []byte) (*NtfyProvider, error)
NewNtfyProvider parses raw JSON config.
func (*NtfyProvider) Send ¶ added in v0.9.0
func (p *NtfyProvider) Send(ctx context.Context, msg *Message) error
Send POSTs the body to the ntfy topic. Title goes in the Title header, priority in the X-Priority header.
func (*NtfyProvider) Test ¶ added in v0.9.0
func (p *NtfyProvider) Test(ctx context.Context) error
Test pushes a test message.
func (*NtfyProvider) Type ¶ added in v0.9.0
func (p *NtfyProvider) Type() ProviderType
Type implements Provider.
type PlexConfig ¶ added in v0.9.0
PlexConfig holds Plex server configuration.
type PlexEmbyClient ¶ added in v0.9.0
type PlexEmbyClient struct {
// contains filtered or unexported fields
}
PlexEmbyClient sends library update requests to Plex/Emby servers.
func NewPlexEmbyClient ¶ added in v0.9.0
func NewPlexEmbyClient(logger *slog.Logger) *PlexEmbyClient
NewPlexEmbyClient creates a new Plex/Emby notification client.
func (*PlexEmbyClient) TriggerEmbyScan ¶ added in v0.9.0
func (c *PlexEmbyClient) TriggerEmbyScan(ctx context.Context, cfg EmbyConfig, libraryPath string) error
TriggerEmbyScan sends a library scan request to an Emby server.
func (*PlexEmbyClient) TriggerJellyfinScan ¶ added in v0.9.0
func (c *PlexEmbyClient) TriggerJellyfinScan(ctx context.Context, cfg JellyfinConfig, libraryPath string) error
TriggerJellyfinScan sends a library scan request to a Jellyfin server.
func (*PlexEmbyClient) TriggerPlexScan ¶ added in v0.9.0
func (c *PlexEmbyClient) TriggerPlexScan(ctx context.Context, cfg PlexConfig, libraryPath string) error
TriggerPlexScan sends a library scan request to a Plex server.
type Provider ¶
type Provider interface {
Type() ProviderType
Send(ctx context.Context, msg *Message) error
Test(ctx context.Context) error
}
Provider sends notifications to a specific destination.
type ProviderType ¶
type ProviderType string
ProviderType identifies the kind of notification provider.
const ( ProviderDiscord ProviderType = "discord" ProviderTelegram ProviderType = "telegram" ProviderEmail ProviderType = "email" ProviderSlack ProviderType = "slack" ProviderPushover ProviderType = "pushover" ProviderWebhook ProviderType = "webhook" )
const ProviderApprise ProviderType = "apprise"
ProviderApprise lets users route XMedia notifications through a self-hosted Apprise API. Apprise itself supports ~80 downstream services (Pushover, Telegram, Slack, MS Teams, etc.) via a single configuration key. Users run the Apprise API server (caronc/apprise) and paste the per-config-key URL.
const ProviderCustomScript ProviderType = "custom_script"
ProviderCustomScript identifies the custom-script notification provider. Mirrors the Sonarr/Radarr "Custom Script" connection: XMedia executes a user-supplied script and passes event metadata via environment variables.
Env-var contract (matches Servarr's <app>_eventtype convention with xmedia_ prefix so existing community scripts work with one rename):
xmedia_eventtype — "Grab" | "Download" | "HealthIssue" | ... xmedia_movie_id — XMedia DB ID xmedia_movie_title — release-friendly title xmedia_movie_year — release year xmedia_movie_tmdbid — TMDB ID xmedia_movie_imdbid — IMDb ID xmedia_release_title — release name xmedia_release_quality — quality string (e.g. "WEBRip-1080p") xmedia_release_size — bytes xmedia_release_indexer — indexer name xmedia_download_id — download UUID xmedia_download_client — "native"
Fields beyond the above are forwarded as xmedia_field_<key>.
const ProviderGotify ProviderType = "gotify"
ProviderGotify identifies the Gotify notification provider — a self-hosted push server typically run alongside an XMedia install for headless devices.
const ProviderKodi ProviderType = "kodi"
ProviderKodi identifies the Kodi/XBMC media-center notification provider. Kodi exposes a JSON-RPC endpoint that supports GUI.ShowNotification and VideoLibrary.Scan — XMedia uses the former for grab/import alerts.
const ProviderMailgun ProviderType = "mailgun"
ProviderMailgun identifies the Mailgun transactional email provider — preferred over SMTP for users who want delivery analytics, bounce handling, and high-volume reliability.
const ProviderNotifiarr ProviderType = "notifiarr"
ProviderNotifiarr identifies the Notifiarr passthrough provider — integration with the Notifiarr community service that fans out to Discord channels, Telegram, etc. Users configure routes inside their Notifiarr account; XMedia just posts the event.
const ProviderNtfy ProviderType = "ntfy"
ProviderNtfy identifies the Ntfy.sh notification provider — a free pub/sub push service users subscribe to via topic. XMedia can target the public ntfy.sh server or a self-hosted instance.
const ProviderPushbullet ProviderType = "pushbullet"
ProviderPushbullet identifies the Pushbullet notification provider.
const ProviderSendGrid ProviderType = "sendgrid"
ProviderSendGrid identifies the SendGrid transactional email provider.
func RegisteredProviders ¶ added in v0.9.0
func RegisteredProviders() []ProviderType
RegisteredProviders returns the sorted list of registered provider types. Useful for the settings UI to enumerate available providers.
type PushbulletConfig ¶ added in v0.9.0
type PushbulletConfig struct {
AccessToken string `json:"access_token"`
DeviceIden string `json:"device_iden,omitempty"`
Email string `json:"email,omitempty"`
}
PushbulletConfig holds the access token + optional device targeting.
type PushbulletProvider ¶ added in v0.9.0
type PushbulletProvider struct {
// contains filtered or unexported fields
}
PushbulletProvider posts notes to Pushbullet.
func NewPushbulletProvider ¶ added in v0.9.0
func NewPushbulletProvider(rawConfig []byte) (*PushbulletProvider, error)
NewPushbulletProvider parses raw JSON config.
func (*PushbulletProvider) Send ¶ added in v0.9.0
func (p *PushbulletProvider) Send(ctx context.Context, msg *Message) error
Send posts a note to Pushbullet.
func (*PushbulletProvider) Test ¶ added in v0.9.0
func (p *PushbulletProvider) Test(ctx context.Context) error
Test sends a test note.
func (*PushbulletProvider) Type ¶ added in v0.9.0
func (p *PushbulletProvider) Type() ProviderType
Type implements Provider.
type PushoverConfig ¶ added in v0.9.0
type PushoverConfig struct {
AppToken string `json:"app_token"`
UserKey string `json:"user_key"`
Device string `json:"device,omitempty"`
Priority int `json:"priority,omitempty"`
}
PushoverConfig holds API credentials for Pushover.
type PushoverProvider ¶ added in v0.9.0
type PushoverProvider struct {
// contains filtered or unexported fields
}
PushoverProvider sends notifications via Pushover API.
func NewPushoverProvider ¶ added in v0.9.0
func NewPushoverProvider(rawConfig []byte) (*PushoverProvider, error)
NewPushoverProvider creates a Pushover provider from raw JSON config.
func (*PushoverProvider) Send ¶ added in v0.9.0
func (p *PushoverProvider) Send(ctx context.Context, msg *Message) error
Send posts a message to Pushover.
func (*PushoverProvider) Test ¶ added in v0.9.0
func (p *PushoverProvider) Test(ctx context.Context) error
Test sends a test message.
func (*PushoverProvider) Type ¶ added in v0.9.0
func (p *PushoverProvider) Type() ProviderType
Type returns the provider type.
type SendGridConfig ¶ added in v0.9.0
type SendGridConfig struct {
APIKey string `json:"api_key"`
From string `json:"from"`
To string `json:"to"`
}
SendGridConfig holds the API key + sender + recipient.
type SendGridProvider ¶ added in v0.9.0
type SendGridProvider struct {
// contains filtered or unexported fields
}
SendGridProvider sends transactional email via SendGrid v3 API.
func NewSendGridProvider ¶ added in v0.9.0
func NewSendGridProvider(rawConfig []byte) (*SendGridProvider, error)
NewSendGridProvider parses raw JSON config.
func (*SendGridProvider) Send ¶ added in v0.9.0
func (p *SendGridProvider) Send(ctx context.Context, msg *Message) error
Send dispatches a plain-text email via SendGrid.
func (*SendGridProvider) Test ¶ added in v0.9.0
func (p *SendGridProvider) Test(ctx context.Context) error
Test sends a test email.
func (*SendGridProvider) Type ¶ added in v0.9.0
func (p *SendGridProvider) Type() ProviderType
Type implements Provider.
type SlackConfig ¶ added in v0.9.0
type SlackConfig struct {
WebhookURL string `json:"webhook_url"`
Channel string `json:"channel,omitempty"`
Username string `json:"username,omitempty"`
}
SlackConfig holds the webhook URL for a Slack provider.
type SlackProvider ¶ added in v0.9.0
type SlackProvider struct {
// contains filtered or unexported fields
}
SlackProvider sends notifications via a Slack webhook.
func NewSlackProvider ¶ added in v0.9.0
func NewSlackProvider(rawConfig []byte) (*SlackProvider, error)
NewSlackProvider creates a Slack provider from raw JSON config.
func (*SlackProvider) Send ¶ added in v0.9.0
func (p *SlackProvider) Send(ctx context.Context, msg *Message) error
Send posts a message to the Slack webhook.
func (*SlackProvider) Test ¶ added in v0.9.0
func (p *SlackProvider) Test(ctx context.Context) error
Test sends a test message.
func (*SlackProvider) Type ¶ added in v0.9.0
func (p *SlackProvider) Type() ProviderType
Type returns the provider type.
type TelegramConfig ¶
TelegramConfig holds credentials for a Telegram bot provider.
type TelegramProvider ¶
type TelegramProvider struct {
// contains filtered or unexported fields
}
TelegramProvider sends notifications via Telegram bot API.
func NewTelegramProvider ¶
func NewTelegramProvider(rawConfig []byte) (*TelegramProvider, error)
NewTelegramProvider creates a Telegram provider from raw JSON config.
func (*TelegramProvider) Send ¶
func (p *TelegramProvider) Send(ctx context.Context, msg *Message) error
Send posts a formatted HTML message to the Telegram chat.
func (*TelegramProvider) Test ¶
func (p *TelegramProvider) Test(ctx context.Context) error
Test sends a test message to verify the bot and chat are configured correctly.
func (*TelegramProvider) Type ¶
func (p *TelegramProvider) Type() ProviderType
Type returns the provider type.
type WebhookConfig ¶ added in v0.9.0
type WebhookConfig struct {
URL string `json:"url"`
Method string `json:"method,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Secret string `json:"secret,omitempty"`
EnvVarPayload bool `json:"env_var_payload,omitempty"`
}
WebhookConfig holds settings for a generic webhook provider.
When Secret is set, every request is signed with HMAC-SHA256 over the raw JSON body. The signature is emitted in two header forms so receivers can recognize either:
- X-Hub-Signature-256: sha256=<hex> (industry standard, GitHub convention — recognized by Octokit, Probot, every generic webhook library)
- X-XMedia-Signature: sha256=<hex> (legacy XMedia-prefixed alias, retained for backwards compatibility with existing receivers)
Both carry the same digest. SHA-1 is deliberately not emitted — GitHub deprecated it; downstream receivers should use SHA-256 only.
EnvVarPayload, when true, formats the body in the same env-var-style keys the Custom Script provider uses (xmedia_eventtype, xmedia_title, xmedia_release_quality, ...). Useful when the receiver is a small shim that wraps an existing arr-stack-compatible script.
type WebhookProvider ¶ added in v0.9.0
type WebhookProvider struct {
// contains filtered or unexported fields
}
WebhookProvider sends notifications to a configurable HTTP endpoint.
func NewWebhookProvider ¶ added in v0.9.0
func NewWebhookProvider(rawConfig []byte) (*WebhookProvider, error)
NewWebhookProvider creates a generic webhook provider from raw JSON config.
func (*WebhookProvider) Send ¶ added in v0.9.0
func (p *WebhookProvider) Send(ctx context.Context, msg *Message) error
Send posts a JSON payload to the configured webhook URL.
func (*WebhookProvider) Test ¶ added in v0.9.0
func (p *WebhookProvider) Test(ctx context.Context) error
Test sends a test payload.
func (*WebhookProvider) Type ¶ added in v0.9.0
func (p *WebhookProvider) Type() ProviderType
Type returns the provider type.