slackutils

package
v0.10.28 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSlackClient

func NewSlackClient(notifications *SlackNotifications) *slackClient

func NewSlackClientForHttpClient added in v0.10.19

func NewSlackClientForHttpClient(httpClient HttpClient, notifications *SlackNotifications) *slackClient

Types

type DefaultHttpClient added in v0.10.19

type DefaultHttpClient struct{}

func (*DefaultHttpClient) PostJsonContent added in v0.10.19

func (*DefaultHttpClient) PostJsonContent(ctx context.Context, message, url string)

type HttpClient added in v0.10.19

type HttpClient interface {
	PostJsonContent(ctx context.Context, message, url string)
}

type SlackClient

type SlackClient interface {
	// Use repo-specific channel, if exists
	NotifyForRepo(ctx context.Context, repo, message string)
	// Use default channel
	Notify(ctx context.Context, message string)
}

type SlackNotifications

type SlackNotifications struct {
	DefaultUrl string            `yaml:"default_url" json:"defaultUrl"`
	RepoUrls   map[string]string `yaml:"repo_urls" json:"repoUrls"`
}

Jump to

Keyboard shortcuts

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