notification

package
v0.0.0-...-8cfe922 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package notification can be used to send notifications to your Slack team.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotConfigured        = errgo.Newf("No notification receiver configured")
	ErrInvalidConfiguration = errgo.Newf("Invalid configuration")
)

Functions

func IsInvalidConfiguration

func IsInvalidConfiguration(err error) bool

func IsNotConfigured

func IsNotConfigured(err error) bool

func SendMessage

func SendMessage(version, build string) error

SendMessage reads the configuration file, and posts a message about Kocho's invocation to Slack.

func WriteConfig

func WriteConfig(config SlackConfiguration) error

WriteConfig writes the given SlackConfiguration to the configuration file.

Types

type SlackConfiguration

type SlackConfiguration struct {
	Token                string `json:"token"`                           // Token is the API token from Slack.
	Username             string `json:"username"`                        // Username is your username.
	NotificationUsername string `json:"notification_username,omitempty"` // NotificationUsername is the username the notification should be posted under.
	EmojiIcon            string `json:"emoji_icon,omitempty"`            // EmojiIcon is an emoji (e.g: :smile:) to use as an avatar for the notification.
	NotificationChannel  string `json:"notification_channel"`            // NotificationChannel is the channel to post to.
}

SlackConfiguration describes a configuration for posting to a Slack channel.

Jump to

Keyboard shortcuts

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