slack

package
v0.0.0-...-dc1fca4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Fallback string  `json:"fallback"`
	Text     string  `json:"text,omitempty"`
	PreText  string  `json:"pretext,omitempty"`
	Color    string  `json:"color,omitempty"`
	Fields   []Field `json:"fields,omitempty"`
}

type Client

type Client struct {
	WebhookURL      string `json:"webhook_url,omitempty"`
	DefaultChannel  string `json:"channel,omitempty"`
	DefaultUsername string `json:"username,omitempty"`
	DefaultEmoji    string `json:"emoji,omitempty"`
}

func New

func New(url string) *Client

func (*Client) Send

func (c *Client) Send(n *Notification) error

func (*Client) SendError

func (c *Client) SendError(format string, args ...interface{}) error

func (*Client) SendInfo

func (c *Client) SendInfo(format string, args ...interface{}) error

func (*Client) SendSuccess

func (c *Client) SendSuccess(format string, args ...interface{}) error

func (*Client) SendWarning

func (c *Client) SendWarning(format string, args ...interface{}) error

type Field

type Field struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short,omitempty"`
}

type Notification

type Notification struct {
	Text        string       `json:"text"`
	Channel     string       `json:"channel,omitempty"`
	Username    string       `json:"username,omitempty"`
	Emoji       string       `json:"icon_emoji,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

Jump to

Keyboard shortcuts

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