Documentation ¶
Index ¶
- Constants
- type AdaptiveCard
- type AdaptiveCardActionItem
- type AdaptiveCardActionSetItem
- type AdaptiveCardImageItem
- type AdaptiveCardImageSetItem
- type AdaptiveCardItem
- type AdaptiveCardOpenURLActionItem
- type AdaptiveCardTextBlockItem
- type AdaptiveCardsAttachment
- type AdaptiveCardsMessage
- type Config
- type Notifier
Constants ¶
const ( ImageSizeSmall = "small" ImageSizeMedium = "medium" ImageSizeLarge = "large" TextColorDark = "dark" TextColorLight = "light" TextColorAccent = "accent" TextColorGood = "good" TextColorWarning = "warning" TextColorAttention = "attention" TextSizeSmall = "small" TextSizeMedium = "medium" TextSizeLarge = "large" TextSizeExtraLarge = "extraLarge" TextSizeDefault = "default" TextWeightLighter = "lighter" TextWeightBolder = "bolder" TextWeightDefault = "default" )
const FullValidConfigForTesting = `{
"url": "http://localhost",
"message" : "test-message",
"title" : "test-title",
"sectiontitle" : "test-second-title"
}`
FullValidConfigForTesting is a string representation of a JSON object that contains all fields supported by the notifier Config. It can be used without secrets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdaptiveCard ¶
type AdaptiveCard struct { Body []AdaptiveCardItem Schema string Type string Version string }
AdaptiveCard repesents an Adaptive Card. https://adaptivecards.io/explorer/AdaptiveCard.html
func NewAdaptiveCard ¶
func NewAdaptiveCard() AdaptiveCard
NewAdaptiveCard returns a prepared Adaptive Card.
func (*AdaptiveCard) AppendItem ¶
func (c *AdaptiveCard) AppendItem(i AdaptiveCardItem)
AppendItem appends an item, such as text or an image, to the Adaptive Card.
func (*AdaptiveCard) MarshalJSON ¶
func (c *AdaptiveCard) MarshalJSON() ([]byte, error)
type AdaptiveCardActionItem ¶
type AdaptiveCardActionSetItem ¶
type AdaptiveCardActionSetItem struct {
Actions []AdaptiveCardActionItem
}
AdaptiveCardActionSetItem is an ActionSet.
func (AdaptiveCardActionSetItem) MarshalJSON ¶
func (i AdaptiveCardActionSetItem) MarshalJSON() ([]byte, error)
type AdaptiveCardImageItem ¶
AdaptiveCardImageItem is an Image.
func (AdaptiveCardImageItem) MarshalJSON ¶
func (i AdaptiveCardImageItem) MarshalJSON() ([]byte, error)
type AdaptiveCardImageSetItem ¶
type AdaptiveCardImageSetItem struct { Images []AdaptiveCardImageItem Size string }
AdaptiveCardImageSetItem is an ImageSet.
func (*AdaptiveCardImageSetItem) AppendImage ¶
func (i *AdaptiveCardImageSetItem) AppendImage(image AdaptiveCardImageItem)
AppendImage appends an image to image set.
func (AdaptiveCardImageSetItem) MarshalJSON ¶
func (i AdaptiveCardImageSetItem) MarshalJSON() ([]byte, error)
type AdaptiveCardItem ¶
AdaptiveCardItem is an interface for adaptive card items such as containers, elements and inputs.
type AdaptiveCardOpenURLActionItem ¶
AdaptiveCardOpenURLActionItem is an Action.OpenUrl action.
func (AdaptiveCardOpenURLActionItem) MarshalJSON ¶
func (i AdaptiveCardOpenURLActionItem) MarshalJSON() ([]byte, error)
type AdaptiveCardTextBlockItem ¶
type AdaptiveCardTextBlockItem struct { Color string Size string Text string Weight string Wrap bool }
AdaptiveCardTextBlockItem is a TextBlock.
func (AdaptiveCardTextBlockItem) MarshalJSON ¶
func (i AdaptiveCardTextBlockItem) MarshalJSON() ([]byte, error)
type AdaptiveCardsAttachment ¶
type AdaptiveCardsAttachment struct { Content AdaptiveCard `json:"content"` ContentType string `json:"contentType"` ContentURL string `json:"contentUrl,omitempty"` }
AdaptiveCardsAttachment contains an adaptive card.
type AdaptiveCardsMessage ¶
type AdaptiveCardsMessage struct { Attachments []AdaptiveCardsAttachment `json:"attachments"` Summary string `json:"summary,omitempty"` // Summary is the text shown in notifications Type string `json:"type"` }
AdaptiveCardsMessage represents a message for adaptive cards.
func NewAdaptiveCardsMessage ¶
func NewAdaptiveCardsMessage(card AdaptiveCard) AdaptiveCardsMessage
NewAdaptiveCardsMessage returns a message prepared for adaptive cards. https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using#send-adaptive-cards-using-an-incoming-webhook more info https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#microsoft-teams-webhook