slackhook

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package slackhook proviodes Helpers to send messages to Slack hooks. For more see https://api.slack.com/incoming-webhooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Post

func Post(hook, text string) error

Post a message to a Slack incoming webhook.

func PostCustom

func PostCustom(hook string, d Data) error

PostCustom posts a message to Slack while allowing to overwrite the webhook defaults.

Types

type Data

type Data struct {
	Text      string `json:"text"`
	Username  string `json:"username,omitempty"`
	Channel   string `json:"channel,omitempty"`
	IconEmoji string `json:"icon_emoji,omitempty"`
}

Data is sent to Slack as JSON.

Jump to

Keyboard shortcuts

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