slack

package
v0.0.0-...-3f1c2bf Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Text   string  `json:"text"`
	Color  string  `json:"color"`
	Fields []Field `json:"fields"`
}

type Block

type Block struct {
	Type string `json:"type"`
	Text *Text  `json:"text,omitempty"`
}

type Body

type Body struct {
	Blocks      []Block      `json:"blocks,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

type Field

type Field struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

type Slack

type Slack struct {
	Client     *slack.Client
	Token      string
	ChannelID  string
	WebhookURL string
	SlackOff   bool
	Color      string
}

func NewSlackClient

func NewSlackClient(slackOff bool) Slack

NewSlackClient creates new slack client

func (Slack) CreateDividerSection

func (s Slack) CreateDividerSection() *slack.DividerBlock

CreateDividerSection creates a new division block

func (Slack) CreateSimpleSection

func (s Slack) CreateSimpleSection(text string) *slack.SectionBlock

CreateSimpleSection creates simple section with text

func (Slack) CreateTitleSection

func (s Slack) CreateTitleSection(text string) *slack.SectionBlock

CreateTitleSection creates title section

func (Slack) SendAPITestResultMessage

func (s Slack) SendAPITestResultMessage(metrics []schemas.MetricResult) error

SendAPITestResultMessage sends API test message

func (Slack) SendAPITestResultMessageWithWebHook

func (s Slack) SendAPITestResultMessageWithWebHook(metrics []schemas.MetricResult) error

SendAPITestResultMessageWithWebHook sends API test result with slack webhook

func (Slack) SendMessage

func (s Slack) SendMessage(msgOpt ...slack.MsgOption) error

SendMessage really sends message with token

func (Slack) SendMessageWithWebHook

func (s Slack) SendMessageWithWebHook(msg string) error

SendMessageWithWebhook is for WebhookURL

func (Slack) SendSimpleMessage

func (s Slack) SendSimpleMessage(message string) error

SendSimpleMessage creates and sends simple message

func (Slack) SendSummaryMessage

func (s Slack) SendSummaryMessage(config schemas.Config, stacks []schemas.Stack, app string) error

SendSummaryMessage sends summary of deployment

func (Slack) SendSummaryMessageWithWebHook

func (s Slack) SendSummaryMessageWithWebHook(config schemas.Config, stacks []schemas.Stack, app string) error

SendSummaryMessageWithWebHook sends summary message

func (Slack) ValidClient

func (s Slack) ValidClient() bool

ValidClient validates slack variables

type Text

type Text struct {
	Type string `json:"type,omitempty"`
	Text string `json:"text,omitempty"`
}

Jump to

Keyboard shortcuts

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