slack

package
v1.134.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

func (*Slack) Creator

func (n *Slack) Creator(params map[string]interface{}, baseInfo config.BaseInfo) (notifiers.Notifier, error)

func (*Slack) Description added in v1.6.1

func (n *Slack) Description() string

func (*Slack) Id

func (n *Slack) Id() string

func (*Slack) Name

func (n *Slack) Name() string

func (*Slack) Notify

func (n *Slack) Notify(notifyReq *models.NotifyRequest) error

type SlackAction

type SlackAction struct {
	Type         string                  `yaml:"type,omitempty"  json:"type,omitempty"`
	Text         string                  `yaml:"text,omitempty"  json:"text,omitempty"`
	URL          string                  `yaml:"url,omitempty"   json:"url,omitempty"`
	Style        string                  `yaml:"style,omitempty" json:"style,omitempty"`
	Name         string                  `yaml:"name,omitempty"  json:"name,omitempty"`
	Value        string                  `yaml:"value,omitempty"  json:"value,omitempty"`
	ConfirmField *SlackConfirmationField `yaml:"confirm,omitempty"  json:"confirm,omitempty"`
}

type SlackAttachment

type SlackAttachment struct {
	Title      string        `json:"title,omitempty"`
	TitleLink  string        `json:"title_link,omitempty"`
	Pretext    string        `json:"pretext,omitempty"`
	Text       string        `json:"text"`
	Fallback   string        `json:"fallback"`
	CallbackID string        `json:"callback_id"`
	Fields     []SlackField  `json:"fields,omitempty"`
	Actions    []SlackAction `json:"actions,omitempty"`
	ImageURL   string        `json:"image_url,omitempty"`
	ThumbURL   string        `json:"thumb_url,omitempty"`
	Footer     string        `json:"footer"`
	Color      string        `json:"color,omitempty"`
}

SlackAttachment is used to display a richly-formatted message block.

type SlackConfirmationField

type SlackConfirmationField struct {
	Text        string `yaml:"text,omitempty"  json:"text,omitempty"`
	Title       string `yaml:"title,omitempty"  json:"title,omitempty"`
	OkText      string `yaml:"ok_text,omitempty"  json:"ok_text,omitempty"`
	DismissText string `yaml:"dismiss_text,omitempty"  json:"dismiss_text,omitempty"`
}

type SlackField

type SlackField struct {
	Title string `yaml:"title,omitempty" json:"title,omitempty"`
	Value string `yaml:"value,omitempty" json:"value,omitempty"`
	Short *bool  `yaml:"short,omitempty" json:"short,omitempty"`
}

type SlackOpts

type SlackOpts struct {
	Endpoint                  string `mapstructure:"endpoint"`
	Channel                   string `mapstructure:"channel"`
	Username                  string `mapstructure:"username"`
	PretextIncident           string `mapstructure:"pretext_incident"`
	PretextScheduled          string `mapstructure:"pretext_scheduled"`
	IconEmojiIncident         string `mapstructure:"icon_emoji_incident"`
	IconEmojiScheduled        string `mapstructure:"icon_emoji_scheduled"`
	IconEmojiScheduledStarted string `mapstructure:"icon_emoji_scheduled_started"`
	IconEmojiScheduledFinish  string `mapstructure:"icon_emoji_scheduled_finish"`
	InsecureSkipVerify        bool   `mapstructure:"insecure_skip_verify"`
}

type SlackRequest

type SlackRequest struct {
	Channel     string            `json:"channel,omitempty"`
	Username    string            `json:"username,omitempty"`
	IconEmoji   string            `json:"icon_emoji,omitempty"`
	IconURL     string            `json:"icon_url,omitempty"`
	LinkNames   bool              `json:"link_names,omitempty"`
	Attachments []SlackAttachment `json:"attachments"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL