Documentation
¶
Index ¶
- Constants
- type AlertManagerAlert
- type Alertmanager
- type AzureDevOps
- type AzureEventHub
- type Bitbucket
- type Discord
- type Factory
- type Forwarder
- type GitHub
- type GitHubDispatch
- type GitLab
- type Gitea
- type GoogleChat
- type GoogleChatCard
- type GoogleChatCardHeader
- type GoogleChatCardSection
- type GoogleChatCardWidget
- type GoogleChatCardWidgetKeyValue
- type GoogleChatCardWidgetTextParagraph
- type GoogleChatPayload
- type Grafana
- type GraphitePayload
- type Interface
- type Lark
- type LarkCard
- type LarkConfig
- type LarkElement
- type LarkHeader
- type LarkPayload
- type LarkText
- type LarkTitle
- type MSTeams
- type MSTeamsField
- type MSTeamsPayload
- type MSTeamsSection
- type Matrix
- type MatrixPayload
- type NopNotifier
- type Opsgenie
- type OpsgenieAlert
- type PureJWT
- type Rocket
- type Sentry
- type Slack
- type SlackAttachment
- type SlackField
- type SlackPayload
- type Telegram
- type Webex
- type WebexPayload
Constants ¶
const NotificationHeader = "gotk-component"
NotificationHeader is a header sent to identify requests from the notification controller.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertManagerAlert ¶ added in v0.18.0
type Alertmanager ¶ added in v0.18.0
func NewAlertmanager ¶ added in v0.18.0
type AzureDevOps ¶ added in v0.4.0
AzureDevOps is an Azure DevOps notifier.
func NewAzureDevOps ¶ added in v0.4.0
func NewAzureDevOps(providerUID string, addr string, token string, certPool *x509.CertPool) (*AzureDevOps, error)
NewAzureDevOps creates and returns a new AzureDevOps notifier.
type AzureEventHub ¶ added in v0.14.0
AzureEventHub holds the eventhub client
func NewAzureEventHub ¶ added in v0.14.0
func NewAzureEventHub(endpointURL, token, eventHubNamespace string) (*AzureEventHub, error)
NewAzureEventHub creates a eventhub client
type Bitbucket ¶ added in v0.2.1
Bitbucket is a Bitbucket Server notifier.
type Discord ¶
Discord holds the hook URL
func NewDiscord ¶
NewDiscord validates the URL and returns a Discord object
type Factory ¶
type Factory struct {
URL string
ProxyURL string
Username string
Channel string
Token string
Headers map[string]string
CertPool *x509.CertPool
Password string
ProviderUID string
}
func NewFactory ¶
type Forwarder ¶
type Forwarder struct {
URL string
ProxyURL string
Headers map[string]string
CertPool *x509.CertPool
HMACKey []byte
}
Forwarder is an implementation of the notification Interface that posts the body as an HTTP request using an optional proxy.
func NewForwarder ¶
type GitHubDispatch ¶ added in v0.24.0
func NewGitHubDispatch ¶ added in v0.24.0
type Gitea ¶ added in v0.30.0
type Gitea struct {
BaseURL string
Token string
Owner string
Repo string
ProviderUID string
Client *gitea.Client
Debug bool
}
type GoogleChat ¶ added in v0.10.0
Slack holds the hook URL
func NewGoogleChat ¶ added in v0.10.0
func NewGoogleChat(hookURL string, proxyURL string) (*GoogleChat, error)
NewGoogleChat validates the Google Chat URL and returns a GoogleChat object
type GoogleChatCard ¶ added in v0.10.0
type GoogleChatCard struct {
Header GoogleChatCardHeader `json:"header"`
Sections []GoogleChatCardSection `json:"sections"`
}
type GoogleChatCardHeader ¶ added in v0.10.0
type GoogleChatCardSection ¶ added in v0.10.0
type GoogleChatCardSection struct {
Header string `json:"header"`
Widgets []GoogleChatCardWidget `json:"widgets"`
}
type GoogleChatCardWidget ¶ added in v0.10.0
type GoogleChatCardWidget struct {
TextParagraph *GoogleChatCardWidgetTextParagraph `json:"textParagraph"`
KeyValue *GoogleChatCardWidgetKeyValue `json:"keyValue"`
}
type GoogleChatCardWidgetKeyValue ¶ added in v0.10.0
type GoogleChatCardWidgetTextParagraph ¶ added in v0.10.0
type GoogleChatCardWidgetTextParagraph struct {
Text string `json:"text"`
}
type GoogleChatPayload ¶ added in v0.10.0
type GoogleChatPayload struct {
Cards []GoogleChatCard `json:"cards"`
}
GoogleChatPayload holds the channel and attachments
type Grafana ¶ added in v0.22.0
type Grafana struct {
URL string
Token string
ProxyURL string
CertPool *x509.CertPool
Username string
Password string
}
type GraphitePayload ¶ added in v0.22.0
type GraphitePayload struct {
When int64 `json:"when"` //optional unix timestamp (ms)
Text string `json:"text"`
Tags []string `json:"tags,omitempty"`
}
GraphiteAnnotation represents a Grafana API annotation in Graphite format
type LarkCard ¶ added in v0.16.0
type LarkCard struct {
Config LarkConfig `json:"config"`
Header LarkHeader `json:"header"`
Elements []LarkElement `json:"elements"`
}
type LarkConfig ¶ added in v0.16.0
type LarkConfig struct {
WideScreenMode bool `json:"wide_screen_mode"`
}
type LarkElement ¶ added in v0.16.0
type LarkHeader ¶ added in v0.16.0
type LarkPayload ¶ added in v0.16.0
type MSTeams ¶
MS Teams holds the incoming webhook URL
func NewMSTeams ¶
NewMSTeams validates the MS Teams URL and returns a MSTeams object
type MSTeamsField ¶
type MSTeamsPayload ¶
type MSTeamsPayload struct {
Type string `json:"@type"`
Context string `json:"@context"`
ThemeColor string `json:"themeColor"`
Summary string `json:"summary"`
Sections []MSTeamsSection `json:"sections"`
}
MSTeamsPayload holds the message card data
type MSTeamsSection ¶
type MSTeamsSection struct {
ActivityTitle string `json:"activityTitle"`
ActivitySubtitle string `json:"activitySubtitle"`
Facts []MSTeamsField `json:"facts"`
}
MSTeamsSection holds the canary analysis result
type MatrixPayload ¶ added in v0.16.0
type NopNotifier ¶
type NopNotifier struct{}
type Opsgenie ¶ added in v0.17.0
func NewOpsgenie ¶ added in v0.17.0
type OpsgenieAlert ¶ added in v0.17.0
type PureJWT ¶ added in v0.14.0
type PureJWT struct {
// contains filtered or unexported fields
}
PureJWT just contains the jwt
func NewJWTProvider ¶ added in v0.14.0
NewJWTProvider create a pureJWT method
type Rocket ¶
type Rocket struct {
URL string
ProxyURL string
Username string
Channel string
CertPool *x509.CertPool
}
Rocket holds the hook URL
type Sentry ¶ added in v0.12.0
Sentry holds the client instance
type Slack ¶
type Slack struct {
URL string
ProxyURL string
Token string
Username string
Channel string
CertPool *x509.CertPool
}
Slack holds the hook URL
type SlackAttachment ¶
type SlackAttachment struct {
Color string `json:"color"`
AuthorName string `json:"author_name"`
Text string `json:"text"`
MrkdwnIn []string `json:"mrkdwn_in"`
Fields []SlackField `json:"fields"`
}
SlackAttachment holds the markdown message body
type SlackField ¶
type SlackPayload ¶
type SlackPayload struct {
Channel string `json:"channel"`
Username string `json:"username"`
IconUrl string `json:"icon_url"`
IconEmoji string `json:"icon_emoji"`
Text string `json:"text,omitempty"`
Attachments []SlackAttachment `json:"attachments,omitempty"`
}
SlackPayload holds the channel and attachments
type Telegram ¶ added in v0.16.0
func NewTelegram ¶ added in v0.16.0
type Webex ¶ added in v0.11.0
type Webex struct {
// mandatory: this should be set to the universal webex API server https://webexapis.com/v1/messages
URL string
// mandatory: webex room ID, specifies on which webex space notifications must be sent
RoomId string
// mandatory: webex bot access token, this access token must be generated after creating a webex bot
Token string
// optional: use a proxy as needed
ProxyURL string
// optional: x509 cert is no longer needed to post to a webex space
CertPool *x509.CertPool
}
Webex holds the hook URL
func NewWebex ¶ added in v0.11.0
func NewWebex(hookURL, proxyURL string, certPool *x509.CertPool, channel string, token string) (*Webex, error)
NewWebex validates the Webex URL and returns a Webex object
func (*Webex) CreateMarkdown ¶ added in v0.23.2
type WebexPayload ¶ added in v0.11.0
type WebexPayload struct {
RoomId string `json:"roomId,omitempty"`
Markdown string `json:"markdown,omitempty"`
}
WebexPayload holds the message text