Documentation ¶
Index ¶
Constants ¶
View Source
const ( Stdout outputPanic = iota + 1 Slack Email )
Variables ¶
View Source
var CapturePanicGo = func() { if captureConfig == nil { log.Panicln("capture config is not set") } if err := recover(); err != nil { switch captureConfig.OutputPanic { case Slack: notifySlack(err) case Stdout: printToStdOut(err) default: log.Println(captureConfig.OutputPanic, " has not supported yet") } } }
Functions ¶
func InitCapture ¶
func InitCapture(c *Config)
func InitSlack ¶
func InitSlack(c *SlackClient)
func Send ¶
func Send(message SlackMessage) error
Types ¶
type Attachment ¶
type Attachment struct { Color string `json:"color,omitempty"` Fallback string `json:"fallback,omitempty"` CallbackID string `json:"callback_id,omitempty"` ID int `json:"id,omitempty"` AuthorID string `json:"author_id,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorSubname string `json:"author_subname,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Pretext string `json:"pretext,omitempty"` Text string `json:"text,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` MarkdownIn []string `json:"mrkdwn_in,omitempty"` Ts json.Number `json:"ts,omitempty"` }
type Config ¶
type Config struct { OutputPanic outputPanic ShowTrace bool SlackClient SlackClient }
type SlackClient ¶
type SlackMessage ¶
type SlackMessage struct { Username string `json:"username,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` Channel string `json:"channel,omitempty"` Text string `json:"text,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
Click to show internal directories.
Click to hide internal directories.