Documentation
¶
Index ¶
- Constants
- type Attachment
- type Colour
- type Field
- type FieldList
- type Message
- type Non200ResponseError
- type SlackChannel
- func (c *SlackChannel) OnPanic(hostname string)
- func (c *SlackChannel) Run()
- func (c *SlackChannel) SendAttachment(a *Attachment) (err error)
- func (c *SlackChannel) SendError(errorToSend error, colour Colour, shortFields map[string]string, ...) (err error)
- func (c *SlackChannel) SendMessage(messageToSend string, colour Colour, shortFields map[string]string, ...) (err error)
- func (c *SlackChannel) SendRawMessage(m Message) (err error)
- func (c *SlackChannel) Shutdown()
- func (c *SlackChannel) Warning(format string, stuff ...interface{})
- type SlogHandler
- type URL
Constants ¶
View Source
const ( MAX_ERRORS = 80 NOTIFY_ERROR_COUNT = 10 )
View Source
const ( Good = "good" Warning = "warning" Danger = "danger" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
AuthorName string `json:"author_name,omitempty"`
AuthorLink string `json:"author_link,omitempty"`
AuthorIcon string `json:"author_icon,omitempty"`
Colour Colour `json:"color,omitempty"` //// Can either be one of 'good', 'warning', 'danger', or any hex color code
Fallback string `json:"fallback"`
Fields []*Field `json:"fields,omitempty"`
ImageURL string `json:"image_url,omitempty"`
MarkdownIn []string `json:"mrkdwn_in,omitempty"` /// Can either be one of 'pretext', 'text' or 'fields'
PreText string `json:"pretext,omitempty"`
Text string `json:"text,omitempty"`
Title string `json:"title,omitempty"`
TitleLink string `json:"title_link,omitempty"`
ThumbURL string `json:"thumb_url,omitempty"`
Timestamp uint64 `json:"ts,omitempty"`
}
type Field ¶
type Field struct {
Title string `json:"title"` // The title may not contain markup and will be escaped for you
Value string `json:"value"` // Text value of the field. May contain standard message markup and must be escaped as normal. May be multi-line
Short bool `json:"short,omitempty"` // Optional flag indicating whether the `value` is short enough to be displayed side-by-side with other values
}
type Message ¶
type Message struct {
Attachments []*Attachment `json:"attachments,omitempty"`
Channel string `json:"channel,omitempty"`
Markdown bool `json:"mrkdwn,omitempty"`
Text string `json:"text,omitempty"`
UserEmoji string `json:"icon_emoji,omitempty"`
UserIcon URL `json:"icon_url,omitempty"`
UserName string `json:"username,omitempty"`
}
type Non200ResponseError ¶
type Non200ResponseError struct {
Code int
// contains filtered or unexported fields
}
func (*Non200ResponseError) Error ¶
func (x *Non200ResponseError) Error() string
type SlackChannel ¶
type SlackChannel struct {
URL URL // The URL returned by slack's webhook integration thing
UserName string
UserIcon URL
UserEmoji string
Channel string
// contains filtered or unexported fields
}
func (*SlackChannel) OnPanic ¶
func (c *SlackChannel) OnPanic(hostname string)
func (*SlackChannel) Run ¶
func (c *SlackChannel) Run()
func (*SlackChannel) SendAttachment ¶
func (c *SlackChannel) SendAttachment(a *Attachment) (err error)
func (*SlackChannel) SendMessage ¶
func (*SlackChannel) SendRawMessage ¶
func (c *SlackChannel) SendRawMessage(m Message) (err error)
func (*SlackChannel) Shutdown ¶
func (c *SlackChannel) Shutdown()
func (*SlackChannel) Warning ¶
func (c *SlackChannel) Warning(format string, stuff ...interface{})
type SlogHandler ¶
type SlogHandler struct {
// contains filtered or unexported fields
}
func NewSlogHandler ¶
func NewSlogHandler(channel *SlackChannel, baseFields map[string]string) *SlogHandler
Click to show internal directories.
Click to hide internal directories.