Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
package notification
import (
"github.com/getarcaneapp/arcane/types/v2/base"
"github.com/getarcaneapp/arcane/types/v2/imageupdate"
"github.com/getarcaneapp/arcane/types/v2/system"
)
// Provider is the type for notification provider identifiers.
type Provider string
const (
// NotificationProviderDiscord is the builtin Discord notification provider.
NotificationProviderDiscord Provider = "discord"
// NotificationProviderEmail is the builtin Email notification provider.
NotificationProviderEmail Provider = "email"
// NotificationProviderTelegram is the builtin Telegram notification provider.
NotificationProviderTelegram Provider = "telegram"
// NotificationProviderSignal is the builtin Signal notification provider.
NotificationProviderSignal Provider = "signal"
// NotificationProviderSlack is the builtin Slack notification provider.
NotificationProviderSlack Provider = "slack"
// NotificationProviderNtfy is the builtin Ntfy notification provider.
NotificationProviderNtfy Provider = "ntfy"
// NotificationProviderPushover is the builtin Pushover notification provider.
NotificationProviderPushover Provider = "pushover"
// NotificationProviderGotify is the builtin Gotify notification provider.
NotificationProviderGotify Provider = "gotify"
// NotificationProviderMatrix is the builtin Matrix webhook notification provider.
NotificationProviderMatrix Provider = "matrix"
// NotificationProviderGoogleChat is the builtin Google Chat notification provider.
NotificationProviderGoogleChat Provider = "googlechat"
// NotificationProviderGeneric is the builtin Generic webhook notification provider.
NotificationProviderGeneric Provider = "generic"
DispatchKindImageUpdate DispatchKind = "image_update"
DispatchKindBatchImageUpdate DispatchKind = "batch_image_update"
DispatchKindContainerUpdate DispatchKind = "container_update"
DispatchKindBatchContainerUpdate DispatchKind = "batch_container_update"
DispatchKindVulnerabilityFound DispatchKind = "vulnerability_found"
DispatchKindPruneReport DispatchKind = "prune_report"
DispatchKindAutoHeal DispatchKind = "auto_heal"
)
type Update struct {
// Provider is the notification provider type.
//
// Required: true
Provider Provider `json:"provider" binding:"required"`
// Enabled indicates if the notification provider is enabled.
//
// Required: true
Enabled bool `json:"enabled"`
// Config contains the provider-specific configuration.
//
// Required: true
Config base.JsonObject `json:"config" binding:"required"`
}
type Response struct {
// ID is the unique identifier of the notification settings.
//
// Required: true
ID uint `json:"id"`
// Provider is the notification provider type.
//
// Required: true
Provider Provider `json:"provider"`
// Enabled indicates if the notification provider is enabled.
//
// Required: true
Enabled bool `json:"enabled"`
// Config contains the provider-specific configuration.
//
// Required: true
Config base.JsonObject `json:"config"`
}
// TestResponse is the result of a test notification send.
type TestResponse struct {
// Message describes the test outcome.
Message string `json:"message"`
// Warning explains why a real notification of the tested kind would not
// send (provider disabled or event unsubscribed). Empty when none applies.
Warning string `json:"warning,omitempty"`
}
type DispatchKind string
type DispatchImageUpdate struct {
ImageRef string `json:"imageRef"`
UpdateInfo imageupdate.Response `json:"updateInfo"`
}
type DispatchBatchImageUpdate struct {
Updates map[string]*imageupdate.Response `json:"updates"`
}
type DispatchContainerUpdate struct {
ContainerName string `json:"containerName"`
ImageRef string `json:"imageRef"`
OldDigest string `json:"oldDigest,omitempty"`
NewDigest string `json:"newDigest,omitempty"`
}
type DispatchBatchContainerUpdate struct {
Updates []DispatchContainerUpdate `json:"updates"`
}
type DispatchVulnerabilityFound struct {
CVEID string `json:"cveId"`
CVELink string `json:"cveLink"`
Severity string `json:"severity"`
ImageName string `json:"imageName"`
FixedVersion string `json:"fixedVersion,omitempty"`
PkgName string `json:"pkgName,omitempty"`
InstalledVersion string `json:"installedVersion,omitempty"`
}
type DispatchPruneReport struct {
Result system.PruneAllResult `json:"result"`
}
type DispatchAutoHeal struct {
ContainerName string `json:"containerName"`
ContainerID string `json:"containerId"`
}
type DispatchRequest struct {
Kind DispatchKind `json:"kind"`
ImageUpdate *DispatchImageUpdate `json:"imageUpdate,omitempty"`
BatchImageUpdate *DispatchBatchImageUpdate `json:"batchImageUpdate,omitempty"`
ContainerUpdate *DispatchContainerUpdate `json:"containerUpdate,omitempty"`
BatchContainerUpdate *DispatchBatchContainerUpdate `json:"batchContainerUpdate,omitempty"`
VulnerabilityFound *DispatchVulnerabilityFound `json:"vulnerabilityFound,omitempty"`
PruneReport *DispatchPruneReport `json:"pruneReport,omitempty"`
AutoHeal *DispatchAutoHeal `json:"autoHeal,omitempty"`
}
type DispatchResponse struct {
Message string `json:"message"`
Delivered int `json:"delivered"`
}