Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
Block is a single block of a notification.
func NewSection ¶ added in v0.2.43
NewSection creates a new section block.
type Error ¶ added in v0.2.43
type Error string
Error is a custom error type for Slack notifications.
const ( // ErrNilBlock is returned when a block is nil. ErrNilBlock Error = "nil block" // ErrNilText is returned when a text is nil. ErrNilText Error = "nil text" // ErrInvalidBlockType is returned when a block type is invalid. ErrInvalidBlockType Error = "invalid block type" // ErrInvalidBlockTextType is returned when a block text type is invalid. ErrInvalidBlockTextType Error = "invalid block text type" // ErrInvalidBlockTextStyle is returned when a block text style is invalid. ErrInvalidBlockTextStyle Error = "invalid block text style" // ErrInvalidBlockTextEmoji is returned when a block text emoji is invalid. ErrInvalidBlockTextEmoji Error = "invalid block text emoji" )
Slack notification errors.
type Notification ¶
type Notification struct {
Blocks []Block `json:"blocks"`
}
Notification is the main struct for sending notifications to Slack.
func NewNotification ¶
func NewNotification(blocks ...Block) (*Notification, error)
NewNotification creates a new notification.
type Style ¶
type Style struct { Bold *bool `json:"bold,omitempty"` Italic *bool `json:"italic,omitempty"` Strike *bool `json:"strike,omitempty"` }
Style is a style block of a notification.
Click to show internal directories.
Click to hide internal directories.