Documentation
¶
Index ¶
Constants ¶
const ( Info level = iota // Informational messages Success // Successful operations Warning // Warning messages indicating potential issues Failure // Error messages indicating failure of operations )
Variables ¶
var ErrInvalidTemplate = errors.New("invalid notification template")
ErrInvalidTemplate is returned when the configured notification body template fails to parse or execute.
var ErrNotifyFailed = errors.New("request to apprise failed")
ErrNotifyFailed is returned when the Apprise request fails due to invalid notify URLs or unreachable service.
Functions ¶
func GetRevision ¶ added in v0.32.1
func Send ¶
func Send(level level, title, message string, metadata Metadata, opts ...SendOption) error
Send sends a notification using the Apprise service based on the provided configuration and parameters.
func SetAppriseConfig ¶
SetAppriseConfig sets the configuration for the Apprise notification service. bodyTemplate is an optional Go text/template rendering the notification body; an empty string keeps the built-in format (defaultTemplate). An invalid template is rejected.
Types ¶
type SendOption ¶ added in v0.103.0
type SendOption func(*sendOptions)
SendOption customizes how a notification is rendered/sent.
func WithoutBodyTemplate ¶ added in v0.103.0
func WithoutBodyTemplate() SendOption
WithoutBodyTemplate renders the notification with the built-in body format, ignoring any configured APPRISE_NOTIFY_BODY_TEMPLATE. Use it for app-level notifications (e.g. the "new version available" ping) that are not tied to a deployment and therefore carry no stack/context/revision the template expects.
type TemplateData ¶ added in v0.103.0
type TemplateData struct {
Level string // notification level: info, success, warning or failure
Emoji string // level emoji (ℹ️/✅/⚠️/❌)
Title string // notification title, e.g. "Deployment completed"
Message string // core notification message
IsReconciliation bool // true when triggered by a reconciliation event
Metadata // embedded metadata fields
}
TemplateData is the data exposed to a user-configured notification body template. Metadata is embedded, so its fields (Repository, Stack, Revision, JobID, ...) are referenced directly, e.g. {{.Stack}} or {{.Repository}}.
func (TemplateData) DefaultBody ¶ added in v0.103.0
func (d TemplateData) DefaultBody() string
DefaultBody renders the built-in notification body: the message text followed by structured metadata. It backs defaultTemplate and is exposed to user templates as {{ .DefaultBody }}.