Documentation
¶
Index ¶
- Constants
- func EventKey(event *eventv1.Event) string
- func GetAlertMetadata(ctx context.Context) (metav1.ObjectMeta, bool)
- func NewJWTProvider(jwt string) azcore.TokenCredential
- func SetRetryBackoff(minWait, maxWait time.Duration) (restore func())
- func WithAlertMetadata(ctx context.Context, metadata metav1.ObjectMeta) context.Context
- type AlertManagerAlert
- type AlertManagerTime
- type Alertmanager
- type AzureDevOps
- type AzureEventHub
- type Bitbucket
- type BitbucketServer
- type DataDog
- type Discord
- type Factory
- type Forwarder
- type GitHub
- type GitHubClient
- type GitHubClientOption
- func WithGitHubAddress(addr string) GitHubClientOption
- func WithGitHubFetchUserLogin() GitHubClientOption
- func WithGitHubProvider(name, namespace string) GitHubClientOption
- func WithGitHubProxyURL(proxyURL *url.URL) GitHubClientOption
- func WithGitHubSecretData(data map[string][]byte) GitHubClientOption
- func WithGitHubTLSConfig(cfg *tls.Config) GitHubClientOption
- func WithGitHubToken(token string) GitHubClientOption
- func WithGitHubTokenCache(tokenCache *cache.TokenCache) GitHubClientOption
- type GitHubDispatch
- type GitHubPullRequestComment
- type GitLab
- type GitLabMergeRequestComment
- type Gitea
- type GiteaClient
- type GiteaClientOption
- func WithGiteaAddress(addr string) GiteaClientOption
- func WithGiteaContext(ctx context.Context) GiteaClientOption
- func WithGiteaFetchUserLogin() GiteaClientOption
- func WithGiteaProxyURL(proxyURL *url.URL) GiteaClientOption
- func WithGiteaTLSConfig(cfg *tls.Config) GiteaClientOption
- func WithGiteaToken(token string) GiteaClientOption
- type GiteaPullRequestComment
- type GoogleChat
- type GoogleChatCard
- type GoogleChatCardHeader
- type GoogleChatCardSection
- type GoogleChatCardWidget
- type GoogleChatCardWidgetKeyValue
- type GoogleChatCardWidgetTextParagraph
- type GoogleChatPayload
- type GooglePubSub
- type Grafana
- type GraphitePayload
- type Incidentio
- type IncidentioPayload
- 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 Mastodon
- type MastodonPayload
- type Matrix
- type MatrixPayload
- type NATS
- type OTLPTracer
- type Opsgenie
- type OpsgenieAlert
- type Option
- func WithCertPool(certPool *x509.CertPool) Option
- func WithChannel(channel string) Option
- func WithCommitStatus(commitStatus string) Option
- func WithDefaultServiceAccount(serviceAccountName string) Option
- func WithEventKey(key string) Option
- func WithHeaders(headers map[string]string) Option
- func WithPassword(password string) Option
- func WithProviderName(name string) Option
- func WithProviderNamespace(namespace string) Option
- func WithProviderUID(uid string) Option
- func WithProxyURL(proxyURL *url.URL) Option
- func WithSPIFFEBroker(client fluxbroker.Interface) Option
- func WithSecretData(data map[string][]byte) Option
- func WithServiceAccount(serviceAccountName string) Option
- func WithTLSConfig(tlsConfig *tls.Config) Option
- func WithTimeout(timeout time.Duration) Option
- func WithToken(token string) Option
- func WithTokenCache(cache *cache.TokenCache) Option
- func WithTokenClient(kubeClient client.Client) Option
- func WithURL(url string) Option
- func WithUsername(username string) Option
- type PagerDuty
- type PureJWT
- type Rocket
- type Sentry
- type Slack
- type SlackAttachment
- type SlackField
- type SlackPayload
- type Telegram
- type TelegramPayload
- type Webex
- type WebexPayload
- type Zoom
- type ZoomBodyItem
- type ZoomContent
- type ZoomField
- type ZoomHead
- type ZoomPayload
- type ZoomSubHead
- type Zulip
Constants ¶
const NotificationHeader = "gotk-component"
NotificationHeader is a header sent to identify requests from the notification controller.
const OperationPost = "post"
OperationPost is the operation name used in cache event metrics
Variables ¶
This section is empty.
Functions ¶
func EventKey ¶ added in v1.10.0
EventKey generates a unique key identifying an event. The key is calculated by concatenating specific event attributes and hashing them using SHA-256, and is returned as a hex-encoded string. It is the identity of an event across the controller: the event server uses it to rate limit duplicate events and notifiers may use it as an idempotency token.
The event attributes are prefixed with an identifier to avoid collisions between different event attributes.
func GetAlertMetadata ¶ added in v1.7.0
func GetAlertMetadata(ctx context.Context) (metav1.ObjectMeta, bool)
func NewJWTProvider ¶ added in v0.14.0
func NewJWTProvider(jwt string) azcore.TokenCredential
NewJWTProvider create a pureJWT method
func SetRetryBackoff ¶ added in v1.10.0
SetRetryBackoff overrides retry waits for newly created clients, for tests only. Call it from a non-parallel parent test before starting parallel subtests, and register the returned restore function with the parent's Cleanup.
func WithAlertMetadata ¶ added in v1.7.0
Types ¶
type AlertManagerAlert ¶ added in v0.18.0
type AlertManagerAlert struct {
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt AlertManagerTime `json:"startsAt"`
EndsAt AlertManagerTime `json:"endsAt,omitempty"`
}
type AlertManagerTime ¶ added in v1.3.0
AlertManagerTime takes care of representing time.Time as RFC3339. See https://prometheus.io/docs/alerting/0.27/clients/
func (AlertManagerTime) MarshalJSON ¶ added in v1.3.0
func (a AlertManagerTime) MarshalJSON() ([]byte, error)
func (AlertManagerTime) String ¶ added in v1.3.0
func (a AlertManagerTime) String() string
func (*AlertManagerTime) UnmarshalJSON ¶ added in v1.3.0
func (a *AlertManagerTime) UnmarshalJSON(jsonRepr []byte) error
type Alertmanager ¶ added in v0.18.0
type Alertmanager struct {
URL string
ProxyURL *url.URL
TLSConfig *tls.Config
Token string
Username string
Password string
}
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(ctx context.Context, commitStatus string, addr string, token string, tlsConfig *tls.Config, proxy *url.URL, serviceAccountName, providerName, providerNamespace string, tokenClient client.Client, tokenCache *cache.TokenCache, spiffeBroker fluxbroker.Interface, defaultServiceAccount string) (*AzureDevOps, error)
NewAzureDevOps creates and returns a new AzureDevOps notifier.
type AzureEventHub ¶ added in v0.14.0
type AzureEventHub struct {
ProducerClient *eventhub.ProducerClient
}
AzureEventHub holds the eventhub client
func NewAzureEventHub ¶ added in v0.14.0
func NewAzureEventHub(ctx context.Context, endpointURL, token, eventHubNamespace string, proxy *url.URL, serviceAccountName, providerName, providerNamespace string, tokenClient client.Client, tokenCache *cache.TokenCache, spiffeBroker fluxbroker.Interface, defaultServiceAccount string) (*AzureEventHub, error)
NewAzureEventHub creates a eventhub client
type Bitbucket ¶ added in v0.2.1
Bitbucket is a Bitbucket Cloud notifier.
type BitbucketServer ¶ added in v1.2.0
type BitbucketServer struct {
CommitStatus string
Url *url.URL
ProviderAddress string
Username string
Password string
Token string
Client *retryablehttp.Client
}
BitbucketServer is a notifier for BitBucket Server and Data Center.
type DataDog ¶ added in v1.1.0
type DataDog struct {
// contains filtered or unexported fields
}
func NewDataDog ¶ added in v1.1.0
func NewDataDog(address string, proxyUrl *url.URL, tlsConfig *tls.Config, token string) (*DataDog, error)
NewDataDog creates a new DataDog provider by mapping the notification provider API to sensible values for the DataDog API. url: The DataDog API endpoint to use. Examples: https://api.datadoghq.com, https://api.datadoghq.eu, etc. token: The DataDog API key (not the application key). headers: A map of extra tags to add to the event
type Discord ¶
type Discord struct {
URL string
ProxyURL *url.URL
Username string
Channel string
TLSConfig *tls.Config
}
Discord holds the hook URL
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
NewFactory creates a new notifier factory with optional configurations.
func (*Factory) GitHubClientOptions ¶ added in v1.8.0
func (o *Factory) GitHubClientOptions() []GitHubClientOption
GitHubClientOptions returns the GitHub client options derived from notifierOptions. This handles the token/password fallback logic and converts factory options to GitHub client options.
func (*Factory) GiteaClientOptions ¶ added in v1.8.0
func (o *Factory) GiteaClientOptions() []GiteaClientOption
GiteaClientOptions returns the Gitea client options derived from notifierOptions. This handles the token/password fallback logic and converts factory options to Gitea client options.
type Forwarder ¶
type Forwarder struct {
URL string
ProxyURL *url.URL
Headers map[string]string
TLSConfig *tls.Config
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 GitHubClient ¶ added in v1.8.0
type GitHubClient struct {
UserLogin string
AppSlug string
Owner string
Repo string
Client *gogithub.Client
}
GitHubClient holds the GitHub client and repository information.
func NewGitHubClient ¶ added in v1.8.0
func NewGitHubClient(ctx context.Context, opts ...GitHubClientOption) (*GitHubClient, error)
NewGitHubClient creates a new GitHubClientInfo with the provided options.
type GitHubClientOption ¶ added in v1.8.0
type GitHubClientOption func(*gitHubClientOptions)
GitHubClientOption is a functional option for configuring GitHub client creation.
func WithGitHubAddress ¶ added in v1.8.0
func WithGitHubAddress(addr string) GitHubClientOption
WithGitHubAddress sets the GitHub repository address.
func WithGitHubFetchUserLogin ¶ added in v1.8.0
func WithGitHubFetchUserLogin() GitHubClientOption
WithGitHubFetchUserLogin enables fetching the authenticated user's login. This is needed for providers that need to identify their own comments/actions.
func WithGitHubProvider ¶ added in v1.8.0
func WithGitHubProvider(name, namespace string) GitHubClientOption
WithGitHubProvider sets the provider name and namespace for token caching.
func WithGitHubProxyURL ¶ added in v1.8.0
func WithGitHubProxyURL(proxyURL *url.URL) GitHubClientOption
WithGitHubProxyURL sets the proxy URL.
func WithGitHubSecretData ¶ added in v1.8.0
func WithGitHubSecretData(data map[string][]byte) GitHubClientOption
WithGitHubSecretData sets the secret data for GitHub App authentication.
func WithGitHubTLSConfig ¶ added in v1.8.0
func WithGitHubTLSConfig(cfg *tls.Config) GitHubClientOption
WithGitHubTLSConfig sets the TLS configuration.
func WithGitHubToken ¶ added in v1.8.0
func WithGitHubToken(token string) GitHubClientOption
WithGitHubToken sets the authentication token.
func WithGitHubTokenCache ¶ added in v1.8.0
func WithGitHubTokenCache(tokenCache *cache.TokenCache) GitHubClientOption
WithGitHubTokenCache sets the token cache for GitHub App authentication.
type GitHubDispatch ¶ added in v0.24.0
func NewGitHubDispatch ¶ added in v0.24.0
func NewGitHubDispatch(ctx context.Context, opts ...GitHubClientOption) (*GitHubDispatch, error)
type GitHubPullRequestComment ¶ added in v1.8.0
type GitHubPullRequestComment struct {
Owner string
Repo string
UserLogin string
AppSlug string
Client *github.Client
// contains filtered or unexported fields
}
func NewGitHubPullRequestComment ¶ added in v1.8.0
func NewGitHubPullRequestComment(ctx context.Context, providerUID string, opts ...GitHubClientOption) (*GitHubPullRequestComment, error)
type GitLabMergeRequestComment ¶ added in v1.8.0
type GitLabMergeRequestComment struct {
ProjectID string
Username string
Client *gitlab.Client
// contains filtered or unexported fields
}
func NewGitLabMergeRequestComment ¶ added in v1.8.0
type Gitea ¶ added in v0.30.0
type GiteaClient ¶ added in v1.8.0
GiteaClient holds the Gitea client and repository information.
func NewGiteaClient ¶ added in v1.8.0
func NewGiteaClient(opts ...GiteaClientOption) (*GiteaClient, error)
NewGiteaClient creates a new GiteaClient with the provided options.
type GiteaClientOption ¶ added in v1.8.0
type GiteaClientOption func(*giteaClientOptions)
GiteaClientOption is a functional option for configuring Gitea client creation.
func WithGiteaAddress ¶ added in v1.8.0
func WithGiteaAddress(addr string) GiteaClientOption
WithGiteaAddress sets the Gitea repository address.
func WithGiteaContext ¶ added in v1.10.0
func WithGiteaContext(ctx context.Context) GiteaClientOption
WithGiteaContext sets the context for construction and subsequent API calls.
func WithGiteaFetchUserLogin ¶ added in v1.8.0
func WithGiteaFetchUserLogin() GiteaClientOption
WithGiteaFetchUserLogin enables fetching the authenticated user's login. This is needed for providers that need to identify their own comments.
func WithGiteaProxyURL ¶ added in v1.8.0
func WithGiteaProxyURL(proxyURL *url.URL) GiteaClientOption
WithGiteaProxyURL sets the proxy URL.
func WithGiteaTLSConfig ¶ added in v1.8.0
func WithGiteaTLSConfig(cfg *tls.Config) GiteaClientOption
WithGiteaTLSConfig sets the TLS configuration.
func WithGiteaToken ¶ added in v1.8.0
func WithGiteaToken(token string) GiteaClientOption
WithGiteaToken sets the authentication token.
type GiteaPullRequestComment ¶ added in v1.8.0
type GiteaPullRequestComment struct {
Owner string
Repo string
Username string
Client *gitea.Client
// contains filtered or unexported fields
}
func NewGiteaPullRequestComment ¶ added in v1.8.0
func NewGiteaPullRequestComment(providerUID string, opts ...GiteaClientOption) (*GiteaPullRequestComment, error)
type GoogleChat ¶ added in v0.10.0
type GoogleChat struct {
URL string
ProxyURL *url.URL
Username string
Channel string
TLSConfig *tls.Config
}
Slack holds the hook URL
func NewGoogleChat ¶ added in v0.10.0
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 GooglePubSub ¶ added in v1.0.0
type GooglePubSub struct {
// contains filtered or unexported fields
}
GooglePubSub holds a Google Pub/Sub client and target topic.
func NewGooglePubSub ¶ added in v1.0.0
func NewGooglePubSub(opts *notifierOptions) (*GooglePubSub, error)
NewGooglePubSub creates a Google Pub/Sub client tied to a specific project and topic using the provided client options.
type Grafana ¶ added in v0.22.0
type Grafana struct {
URL string
Token string
ProxyURL *url.URL
TLSConfig *tls.Config
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"`
}
GraphitePayload represents a Grafana API annotation in Graphite format
type Incidentio ¶ added in v1.10.0
Incidentio holds the endpoint URL of an incident.io HTTP alert source and its API token.
func NewIncidentio ¶ added in v1.10.0
func NewIncidentio(endpointURL string, proxyURL *url.URL, tlsConfig *tls.Config, token string) (*Incidentio, error)
NewIncidentio validates the alert source endpoint URL and token and returns an Incidentio object.
func (*Incidentio) Post ¶ added in v1.10.0
Post event to the incident.io HTTP alert source. Error events fire an alert, any other severity resolves it. The involved object UID is used as the deduplication key so that a recovery event resolves the alert previously fired for the same object, and objects with the same kind/namespace/name on different clusters never share a key.
type IncidentioPayload ¶ added in v1.10.0
type IncidentioPayload struct {
Title string `json:"title"`
Status string `json:"status"`
DeduplicationKey string `json:"deduplication_key"`
Description string `json:"description,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
IncidentioPayload is the alert event format accepted by the incident.io HTTP alert source endpoint (POST /v2/alert_events/http/{alert_source_config_id}).
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 Mastodon ¶ added in v1.10.0
type Mastodon struct {
// URL is the fully resolved statuses endpoint of the server.
URL string
ProxyURL *url.URL
Token string
TLSConfig *tls.Config
// EventKey is sent as the Idempotency-Key header when set.
EventKey string
}
Mastodon holds the server URL and OAuth access token for posting statuses to a Mastodon account.
func NewMastodon ¶ added in v1.10.0
func NewMastodon(serverURL string, proxyURL *url.URL, tlsConfig *tls.Config, token string, eventKey string) (*Mastodon, error)
NewMastodon validates the Mastodon server URL and returns a Mastodon object. The address may be the server root URL, in which case the statuses API path is appended. The event key is the identity of the event computed by the event server and is sent as the Idempotency-Key.
type MastodonPayload ¶ added in v1.10.0
type MastodonPayload struct {
Status string `json:"status"`
}
MastodonPayload is the JSON form accepted by the statuses endpoint. Visibility is intentionally not set so that statuses are posted with the default posting privacy configured on the account.
type Matrix ¶ added in v0.16.0
type Matrix struct {
Token string
URL string
RoomId string
TLSConfig *tls.Config
ProxyURL *url.URL
}
type MatrixPayload ¶ added in v0.16.0
type NATS ¶ added in v1.2.0
type NATS struct {
// contains filtered or unexported fields
}
NATS holds a NATS client and target subject.
func NewNATS ¶ added in v1.2.0
func NewNATS(server string, subject string, username string, password string, secretData map[string][]byte) (*NATS, error)
NewNATS creates a new NATS notifier with support for multiple authentication methods.
Authentication methods (in priority order):
- User Credentials (JWT + NKey): Pass the .creds file content via credsData parameter
- NKey: Pass the NKey seed via nkeySeed parameter
- Username/Password: Pass via username and password parameters
Parameters:
- server: NATS server URL (e.g., "nats://localhost:4222")
- subject: NATS subject to publish events to
- username: Username for basic authentication (optional)
- password: Password for basic authentication (optional)
- credsData: User credentials file content (JWT + NKey) for NATS 2.0+ authentication (optional)
- nkeySeed: NKey seed for NKey-based authentication (optional)
Returns an error if server or subject is empty.
type OTLPTracer ¶ added in v1.7.0
type OTLPTracer struct {
// contains filtered or unexported fields
}
func NewOTLPTracer ¶ added in v1.7.0
type Opsgenie ¶ added in v0.17.0
type Opsgenie struct {
URL string
ProxyURL *url.URL
TLSConfig *tls.Config
ApiKey string
ProviderUID string
}
func NewOpsgenie ¶ added in v0.17.0
type OpsgenieAlert ¶ added in v0.17.0
type Option ¶ added in v1.6.0
type Option func(*notifierOptions)
Option represents a functional option for configuring a notifier.
func WithCertPool ¶ added in v1.6.0
WithCertPool sets the certificate pool for the notifier.
func WithChannel ¶ added in v1.6.0
WithChannel sets the channel for the notifier.
func WithCommitStatus ¶ added in v1.6.0
WithCommitStatus sets the custom commit status for the notifier.
func WithDefaultServiceAccount ¶ added in v1.10.0
WithDefaultServiceAccount sets the default service account for the notifier, used when .spec.serviceAccountName is not specified.
func WithEventKey ¶ added in v1.10.0
WithEventKey sets the key identifying the event being dispatched.
func WithHeaders ¶ added in v1.6.0
WithHeaders sets the headers for the notifier.
func WithPassword ¶ added in v1.6.0
WithPassword sets the password for the notifier.
func WithProviderName ¶ added in v1.6.0
WithProviderName sets the provider name for the notifier.
func WithProviderNamespace ¶ added in v1.6.0
WithProviderNamespace sets the provider namespace for the notifier.
func WithProviderUID ¶ added in v1.8.0
WithProviderUID sets the provider UID for the notifier.
func WithProxyURL ¶ added in v1.6.0
WithProxyURL sets the proxy URL for the notifier.
func WithSPIFFEBroker ¶ added in v1.10.0
func WithSPIFFEBroker(client fluxbroker.Interface) Option
WithSPIFFEBroker sets the client used to fetch JWT-SVIDs for the `spiffe` credential provider.
func WithSecretData ¶ added in v1.6.0
WithSecretData sets the secret data for the notifier.
func WithServiceAccount ¶ added in v1.6.0
WithServiceAccount sets the service account for the notifier.
func WithTLSConfig ¶ added in v1.7.0
WithTLSConfig sets the TLS configuration for the notifier.
func WithTimeout ¶ added in v1.10.0
WithTimeout sets the provider timeout for clients without context support.
func WithTokenCache ¶ added in v1.6.0
func WithTokenCache(cache *cache.TokenCache) Option
WithTokenCache sets the token cache for the notifier.
func WithTokenClient ¶ added in v1.6.0
WithTokenClient sets the token client for the notifier.
func WithUsername ¶ added in v1.6.0
WithUsername sets the username for the notifier.
type PagerDuty ¶ added in v1.0.0
func NewPagerDuty ¶ added in v1.0.0
type PureJWT ¶ added in v0.14.0
type PureJWT struct {
// contains filtered or unexported fields
}
PureJWT just contains the jwt
func (*PureJWT) GetToken ¶ added in v0.14.0
func (j *PureJWT) GetToken(ctx context.Context, options policy.TokenRequestOptions) (azcore.AccessToken, error)
GetToken uses a JWT token, we assume that we will get new tokens when needed, thus no Expiry defined
type Rocket ¶
type Rocket struct {
URL string
ProxyURL *url.URL
Username string
Channel string
TLSConfig *tls.Config
}
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 *url.URL
Token string
Username string
Channel string
TLSConfig *tls.Config
}
Slack holds the hook URL
type SlackAttachment ¶
type SlackAttachment struct {
Fallback string `json:"fallback"`
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
type Telegram struct {
ProxyURL *url.URL
Channel string
Token string
TLSConfig *tls.Config
// contains filtered or unexported fields
}
func NewTelegram ¶ added in v0.16.0
type TelegramPayload ¶ added in v1.7.0
type TelegramPayload struct {
ChatID string `json:"chat_id"` // Unique identifier for the target chat
MessageThreadID string `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
Text string `json:"text"` // Text of the message to be sent
ParseMode string `json:"parse_mode"` // Mode for parsing entities in the message text
}
TelegramPayload represents the payload sent to Telegram Bot API Reference: https://core.telegram.org/bots/api#sendmessage
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 *url.URL
TLSConfig *tls.Config
}
Webex holds the hook URL
func NewWebex ¶ added in v0.11.0
func NewWebex(hookURL string, proxyURL *url.URL, tlsConfig *tls.Config, 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
type Zoom ¶ added in v1.10.0
Zoom holds the incoming webhook URL and verification token for a Zoom Team Chat Incoming Webhook chatbot connection.
type ZoomBodyItem ¶ added in v1.10.0
type ZoomContent ¶ added in v1.10.0
type ZoomContent struct {
Head ZoomHead `json:"head"`
Body []ZoomBodyItem `json:"body"`
}
type ZoomHead ¶ added in v1.10.0
type ZoomHead struct {
Text string `json:"text"`
SubHead *ZoomSubHead `json:"sub_head,omitempty"`
}
type ZoomPayload ¶ added in v1.10.0
type ZoomPayload struct {
Content ZoomContent `json:"content"`
}
ZoomPayload is the rich message format accepted by the Incoming Webhook endpoint when called with `?format=full`.
type ZoomSubHead ¶ added in v1.10.0
type ZoomSubHead struct {
Text string `json:"text"`
}
Source Files
¶
- alertmanager.go
- auth_helpers.go
- azure_devops.go
- azure_eventhub.go
- azure_helpers.go
- bitbucket.go
- bitbucketserver.go
- client.go
- datadog.go
- discord.go
- eventkey.go
- factory.go
- forwarder.go
- git_change_request_comment.go
- gitea.go
- gitea_helpers.go
- gitea_pull_request_comment.go
- github.go
- github_dispatch.go
- github_helpers.go
- github_pull_request_comment.go
- gitlab.go
- gitlab_merge_request_comment.go
- google_chat.go
- google_helpers.go
- google_pubsub.go
- grafana.go
- incidentio.go
- lark.go
- markdown.go
- mastodon.go
- matrix.go
- nats.go
- notifier.go
- opsgenie.go
- otel.go
- pagerduty.go
- rocket.go
- sentry.go
- slack.go
- teams.go
- telegram.go
- util.go
- webex.go
- zoom.go
- zulip.go