Documentation
¶
Index ¶
- Constants
- type AzureDevOps
- type AzureEventHub
- type Bitbucket
- type Discord
- type Factory
- type Forwarder
- type GitHub
- type GitLab
- type GoogleChat
- type GoogleChatCard
- type GoogleChatCardHeader
- type GoogleChatCardSection
- type GoogleChatCardWidget
- type GoogleChatCardWidgetKeyValue
- type GoogleChatCardWidgetTextParagraph
- type GoogleChatPayload
- type Interface
- type MSTeams
- type MSTeamsField
- type MSTeamsPayload
- type MSTeamsSection
- type NopNotifier
- type PureJWT
- type Rocket
- type Sentry
- type Slack
- type SlackAttachment
- type SlackField
- type SlackPayload
- 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 AzureDevOps ¶ added in v0.4.0
AzureDevOps is a Azure DevOps notifier.
func NewAzureDevOps ¶ added in v0.4.0
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.
func NewBitbucket ¶ added in v0.2.1
NewBitbucket creates and returns a new Bitbucket 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
CertPool *x509.CertPool
}
func NewFactory ¶
type Forwarder ¶
Forwarder is an implementation of the notification Interface that posts the body as an HTTP request using an optional proxy.
func NewForwarder ¶
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 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 NopNotifier ¶
type NopNotifier struct{}
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
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 Webex ¶ added in v0.11.0
Webex holds the hook URL
type WebexPayload ¶ added in v0.11.0
type WebexPayload struct {
Text string `json:"text,omitempty"`
Markdown string `json:"markdown,omitempty"`
}
WebexPayload holds the message text