notification

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 6 Imported by: 0

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 contains metadata like the timestamp or application name.
	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

func NewService(cfg *config.Config) *Service

NewService creates a new Service with the provided config.Config.

func (*Service) Notify

func (s *Service) Notify(status, message, hash string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL