Documentation
¶
Overview ¶
Package discord provide types for interacting with discord webhooks.
Index ¶
Constants ¶
View Source
const ( ColourRed = 0x992D22 ColourGreen = 0x2ECC71 ColourGrey = 0x95A5A6 )
Constants for colours.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Message string `json:"message"`
}
The APIError type represents an error returned from the discord API.
type AlertDispatcher ¶
type AlertDispatcher struct {
// contains filtered or unexported fields
}
The AlertDispatcher type is used to convert alert manager alerts into discord webhooks.
func NewAlertDispatcher ¶
func NewAlertDispatcher(webhookURL string) *AlertDispatcher
NewAlertDispatcher returns a new AlertDispatcher that will convert alert manager webhooks into discord webhooks and send them to the given URL.
func (*AlertDispatcher) Dispatch ¶
func (a *AlertDispatcher) Dispatch(ctx context.Context, webhook alertmanager.Webhook) error
Dispatch an alert manager webhook to a discord webhook.
type Embed ¶
type Embed struct { Title string `json:"title"` Description string `json:"description"` Colour int `json:"color"` Fields []Field `json:"fields"` URL string `json:"url"` Timestamp time.Time `json:"timestamp"` }
The Embed type represents embeddable data in a discord message.
Click to show internal directories.
Click to hide internal directories.