Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_TITLE string = "Kernel logs by fluent-bit" BLOCK_TYPE string = "header" TEXT_TYPE string = "plain_text" EMPTY_STRING string = "" DEFAULT_COLOR string = "#A9AAAA" UINT_ARR_TYPE string = "[]uint8" KEY_COLOR string = "color" BLOCK_TYPE_SECTION string = "section" TEXT_TYPE_MRKDWN string = "mrkdwn" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accessory ¶
type Accessory struct { Type *string `json:"type"` Placeholder *Text `json:"placeholder,omitempty"` ActionId *string `json:"action_id,omitempty"` Options *[]Option `json:"options,omitempty"` Value *string `json:"value,omitempty"` Url *string `json:"url,omitempty"` ImageUrl *string `json:"image_url,omitempty"` AltText *string `json:"alt_text,omitempty"` InitialDate *string `json:"initial_date,omitempty"` InitialTime *string `json:"initial_time,omitempty"` }
type Attachment ¶
type Attachment struct { Fallback *string `json:"fallback,omitempty"` Color *string `json:"color,omitempty"` PreText *string `json:"pretext,omitempty"` AuthorName *string `json:"author_name,omitempty"` AuthorLink *string `json:"author_link,omitempty"` AuthorIcon *string `json:"author_icon,omitempty"` Title *string `json:"title,omitempty"` TitleLink *string `json:"title_link,omitempty"` Text *string `json:"text,omitempty"` ImageUrl *string `json:"image_url,omitempty"` Fields []*Field `json:"fields,omitempty"` Timestamp *int64 `json:"ts,omitempty"` MarkdownIn *[]string `json:"mrkdwn_in,omitempty"` Actions []*Action `json:"actions,omitempty"` CallbackID *string `json:"callback_id,omitempty"` ThumbnailUrl *string `json:"thumb_url,omitempty"` Blocks []*Block `json:"blocks,omitempty"` }
func (*Attachment) AddAction ¶
func (attachment *Attachment) AddAction(action Action) *Attachment
func (*Attachment) AddBlock ¶
func (attachment *Attachment) AddBlock(block Block) *Attachment
func (*Attachment) AddField ¶
func (attachment *Attachment) AddField(field Field) *Attachment
type Block ¶
type Block struct { Type *string `json:"type"` Text *Text `json:"text,omitempty"` Title *Text `json:"title,omitempty"` Fields *[]Text `json:"fields,omitempty"` Accessory *Accessory `json:"accessory,omitempty"` Elements *[]Element `json:"elements,omitempty"` Label *Text `json:"label,omitempty"` ImageUrl *string `json:"image_url,omitempty"` AltText *string `json:"alt_text,omitempty"` }
type Element ¶
type Element struct { Type *string `json:"type"` Text *string `json:"text,omitempty"` Emoji *bool `json:"emoji,omitempty"` ImageUrl *string `json:"image_url,omitempty"` AltText *string `json:"alt_text,omitempty"` Placeholder *Text `json:"placeholder,omitempty"` ActionId *string `json:"action_id,omitempty"` Options *[]Option `json:"options,omitempty"` Filter *Filter `json:"filter,omitempty"` InitialConversation *string `json:"initial_conversation,omitempty"` InitialUser *string `json:"initial_user,omitempty"` InitialChannel *string `json:"initial_channel,omitempty"` Value *string `json:"value,omitempty"` InitialDate *string `json:"initial_date,omitempty"` InitialTime *string `json:"initial_time,omitempty"` }
type Payload ¶
type Payload 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"` Attachments []Attachment `json:"attachments,omitempty"` UnfurlLinks bool `json:"unfurl_links,omitempty"` UnfurlMedia bool `json:"unfurl_media,omitempty"` Markdown bool `json:"mrkdwn,omitempty"` Blocks []Block `json:"blocks,omitempty"` }
type SlackInfo ¶
type SlackInfo struct { Webhook string Channel string Field *string Title *string MaxAttachment int }
func (*SlackInfo) MakeAttachment ¶
func (s *SlackInfo) MakeAttachment(data map[interface{}]interface{}) Attachment
func (*SlackInfo) SendSlack ¶
func (s *SlackInfo) SendSlack(attachments []Attachment)
Click to show internal directories.
Click to hide internal directories.