slack

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateReleaseNotes

func GenerateReleaseNotes(changelog map[string][]quoad.Commit, remote GitRemoter) []slack.Block

GenerateReleaseNotes creates a string from release notes that conforms with the Slack formatting. Expected format can be found in testdata.

Types

type Block

type Block struct {
	Type     string    `json:"type"`
	Section  content   `json:"text,omitempty"`
	Elements []content `json:"elements,omitempty"`
}

Block holds the different blocks uses in the Slack block API Hmm... omitempty doesn't omit zero structs https://github.com/golang/go/issues/11939

type GitRemoter

type GitRemoter interface {
	GetRemoteURL() string
	Host() string
	Project() string
}

type Slack

type Slack struct {
	WebHookURL string
}

Slack is the struct holding all the methods to work with the Slack integration.

func (*Slack) Publish

func (s *Slack) Publish(commits map[string][]quoad.Commit, remote GitRemoter) error

Publish pushes the release notes to Slack via provided Webhook. https://api.slack.com/reference/messaging/payload

type WebhookMessage

type WebhookMessage struct {
	Blocks []Block `json:"blocks"`
}

WebhookMessage is the specific structure that Slack uses for the Webhook API

Jump to

Keyboard shortcuts

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