Documentation
¶
Index ¶
- type AllowedMentions
- type DefaultPayload
- type DiscordAuthor
- type DiscordEmbed
- type DiscordField
- type DiscordFooter
- type DiscordImage
- type DiscordMessage
- type DiscordThumbnail
- type SlackAction
- type SlackAttachment
- type SlackField
- type SlackPayload
- type TelegramPayload
- type WebhookData
- type WebhookDataField
- type WebhookLevel
- type WebhooksService
- func (self *WebhooksService) CreateWebhook(ctx context.Context, requesterUserID uuid.UUID, ...) (*models.WebhookResponse, error)
- func (self *WebhooksService) DeleteWebhook(ctx context.Context, requesterUserID uuid.UUID, webhookType schema.WebhookType, ...) error
- func (self *WebhooksService) DetectTargetFromURL(urlStr string) (schema.WebhookTarget, error)
- func (self *WebhooksService) GetWebhookByID(ctx context.Context, requesterUserID uuid.UUID, input *models.WebhookGetInput) (*models.WebhookResponse, error)
- func (self *WebhooksService) ListWebhooks(ctx context.Context, requesterUserID uuid.UUID, input *models.WebhookListInput) ([]*models.WebhookResponse, error)
- func (self *WebhooksService) TriggerWebhooks(ctx context.Context, level WebhookLevel, event schema.WebhookEvent, ...) error
- func (self *WebhooksService) UpdateWebhook(ctx context.Context, requesterUserID uuid.UUID, ...) (*models.WebhookResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedMentions ¶
type DefaultPayload ¶
type DefaultPayload struct {
Level WebhookLevel `json:"level"`
Event schema.WebhookEvent `json:"event"`
Data WebhookData `json:"data"`
}
type DiscordAuthor ¶
type DiscordEmbed ¶
type DiscordEmbed struct {
Title *string `json:"title,omitempty"`
Url *string `json:"url,omitempty"`
Description *string `json:"description,omitempty"`
Color *string `json:"color,omitempty"`
DiscordAuthor *DiscordAuthor `json:"author,omitempty"`
DiscordFields *[]DiscordField `json:"fields,omitempty"`
DiscordThumbnail *DiscordThumbnail `json:"thumbnail,omitempty"`
DiscordImage *DiscordImage `json:"image,omitempty"`
}
type DiscordField ¶
type DiscordFooter ¶
type DiscordFooter struct {
}
type DiscordImage ¶
type DiscordImage struct {
Url *string `json:"url,omitempty"`
}
type DiscordMessage ¶
type DiscordMessage struct {
Username *string `json:"username,omitempty"`
AvatarUrl *string `json:"avatar_url,omitempty"`
Content *string `json:"content,omitempty"`
DiscordEmbeds *[]DiscordEmbed `json:"embeds,omitempty"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
}
type DiscordThumbnail ¶
type DiscordThumbnail struct {
Url *string `json:"url,omitempty"`
}
type SlackAction ¶
type SlackAttachment ¶
type SlackAttachment struct {
Fallback *string `json:"fallback"`
Color *string `json:"color"`
PreText *string `json:"pretext"`
AuthorName *string `json:"author_name"`
AuthorLink *string `json:"author_link"`
AuthorIcon *string `json:"author_icon"`
Title *string `json:"title"`
TitleLink *string `json:"title_link"`
Text *string `json:"text"`
ImageUrl *string `json:"image_url"`
SlackFields []*SlackField `json:"fields"`
Timestamp *int64 `json:"ts"`
MarkdownIn *[]string `json:"mrkdwn_in"`
SlackActions []*SlackAction `json:"actions"`
CallbackID *string `json:"callback_id"`
ThumbnailUrl *string `json:"thumb_url"`
}
type SlackField ¶
type SlackPayload ¶
type SlackPayload struct {
Parse string `json:"parse,omitempty"`
Username string `json:"username,omitempty"`
IconUrl string `json:"icon_url,omitempty"`
IconEmoji string `json:"icon_emoji,omitempty"`
Channel string `json:"channel,omitempty"`
Text string `json:"text,omitempty"`
LinkNames string `json:"link_names,omitempty"`
SlackAttachments []SlackAttachment `json:"attachments,omitempty"`
UnfurlLinks bool `json:"unfurl_links,omitempty"`
UnfurlMedia bool `json:"unfurl_media,omitempty"`
Markdown bool `json:"mrkdwn,omitempty"`
}
type TelegramPayload ¶
type TelegramPayload struct {
ChatID string `json:"chat_id"`
Text string `json:"text"`
ParseMode string `json:"parse_mode,omitempty"`
DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"`
DisableNotification bool `json:"disable_notification,omitempty"`
ReplyToMessageID int `json:"reply_to_message_id,omitempty"`
}
type WebhookData ¶
type WebhookData struct {
Title string `json:"title"`
Url string `json:"url"`
Description string `json:"description"`
Fields []WebhookDataField `json:"fields"`
}
type WebhookDataField ¶
type WebhookLevel ¶
type WebhookLevel string
const ( WebhookLevelError WebhookLevel = "error" WebhookLevelWarning WebhookLevel = "warning" WebhookLevelInfo WebhookLevel = "info" WebhookLevelDeploymentQueued WebhookLevel = "queued" WebhookLevelDeploymentBuilding WebhookLevel = "building" WebhookLevelDeploymentSucceeded WebhookLevel = "succeeded" WebhookLevelDeploymentFailed WebhookLevel = "failed" )
func (*WebhookLevel) DecimalColor ¶
func (self *WebhookLevel) DecimalColor() *string
func (WebhookLevel) Emoji ¶
func (level WebhookLevel) Emoji() string
Emoji indicator for the ones not supporting style (telegram)
func (WebhookLevel) HexColor ¶
func (level WebhookLevel) HexColor() *string
Helper method for WebhookLevel to return Slack color
type WebhooksService ¶
type WebhooksService struct {
// contains filtered or unexported fields
}
Integrate webhooks management with internal permissions and kubernetes RBAC
func NewWebhooksService ¶
func NewWebhooksService(repo repositories.RepositoriesInterface) *WebhooksService
func (*WebhooksService) CreateWebhook ¶
func (self *WebhooksService) CreateWebhook(ctx context.Context, requesterUserID uuid.UUID, input *models.WebhookCreateInput) (*models.WebhookResponse, error)
func (*WebhooksService) DeleteWebhook ¶
func (*WebhooksService) DetectTargetFromURL ¶
func (self *WebhooksService) DetectTargetFromURL(urlStr string) (schema.WebhookTarget, error)
func (*WebhooksService) GetWebhookByID ¶
func (self *WebhooksService) GetWebhookByID(ctx context.Context, requesterUserID uuid.UUID, input *models.WebhookGetInput) (*models.WebhookResponse, error)
func (*WebhooksService) ListWebhooks ¶
func (self *WebhooksService) ListWebhooks(ctx context.Context, requesterUserID uuid.UUID, input *models.WebhookListInput) ([]*models.WebhookResponse, error)
func (*WebhooksService) TriggerWebhooks ¶
func (self *WebhooksService) TriggerWebhooks(ctx context.Context, level WebhookLevel, event schema.WebhookEvent, message WebhookData) error
func (*WebhooksService) UpdateWebhook ¶
func (self *WebhooksService) UpdateWebhook(ctx context.Context, requesterUserID uuid.UUID, input *models.WebhookUpdateInput) (*models.WebhookResponse, error)
Click to show internal directories.
Click to hide internal directories.