slackhook

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 6 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, post func(string, string, io.Reader) (*http.Response, error)) error

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

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