slack

package
v0.0.0-...-eca9d05 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-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"`
	Pretext  string   `json:"pretext"`
	Color    string   `json:"color"`
	Fields   []*Field `json:"fields"`
}

func (*Attachment) AddField

func (a *Attachment) AddField(f *Field)

func (*Attachment) NewField

func (a *Attachment) NewField() *Field

type Client

type Client struct {
	Url string
}

func NewClient

func NewClient(url string) *Client

func (*Client) SendMessage

func (c *Client) SendMessage(msg *Message) error

type Field

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

type Message

type Message struct {
	Text        string        `json:"text"`
	Username    string        `json:"username"`
	IconUrl     string        `json:"icon_url"`
	IconEmoji   string        `json:"icon_emoji"`
	Channel     string        `json:"channel"`
	UnfurlLinks bool          `json:"unfurl_links"`
	Attachments []*Attachment `json:"attachments"`
}

func (*Message) AddAttachment

func (m *Message) AddAttachment(a *Attachment)

func (*Message) NewAttachment

func (m *Message) NewAttachment() *Attachment

type SlackError

type SlackError struct {
	Code int
	Body string
}

func (*SlackError) Error

func (e *SlackError) Error() string

Jump to

Keyboard shortcuts

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