slack

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func GenerateReleaseNotes

func GenerateReleaseNotes(sections map[string][]quoad.Commit, remote GitRemoter) WebhookMessage

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

Jump to

Keyboard shortcuts

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