Documentation
¶
Overview ¶
Package notification provides integration with external communication platforms like Discord to broadcast deployment status.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscordEmbed ¶
type DiscordEmbed struct {
// Title is the main heading of the embed card.
Title string `json:"title"`
// Description is the body text of the embed, supporting basic markdown.
Description string `json:"description"`
// Color is the hexadecimal integer color code for the left side of the embed.
Color int `json:"color"`
Footer struct {
Text string `json:"text"`
} `json:"footer"`
}
DiscordEmbed represents a single rich-content card in a Discord message.
type DiscordPayload ¶
type DiscordPayload struct {
// Embeds is the list of rich cards to display in the Discord message.
Embeds []DiscordEmbed `json:"embeds"`
}
DiscordPayload defines the top-level structure for a Discord webhook request, which essentially consists of a list of embeds.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles the dispatching of notifications to external webhooks.
func NewService ¶
NewService creates a new Service with the provided config.Config.
func (*Service) Notify ¶
Notify sends a formatted alert to Discord based on the deployment status. It maps config.StatusSuccess, config.StatusFailed, and config.StatusRollback to specific colors and creates an informative embed message.