Documentation ¶
Overview ¶
Package slacka is a package to send alert to Slack App.
Index ¶
- type Client
- func (c *Client) Debug(message string) error
- func (c *Client) Debugf(format string, a ...interface{}) error
- func (c *Client) Error(message string) error
- func (c *Client) Errorf(format string, a ...interface{}) error
- func (c *Client) Fatal(message string) error
- func (c *Client) Fatalf(format string, a ...interface{}) error
- func (c *Client) Info(message string) error
- func (c *Client) Infof(format string, a ...interface{}) error
- func (c *Client) Send(urlKey, message string, options ...WebhookOption) error
- func (c *Client) SetErrorURL(url string)
- func (c *Client) SetURL(key, url string)
- func (c *Client) Warn(message string) error
- func (c *Client) Warnf(format string, a ...interface{}) error
- type WebhookOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client struct of slacka package.
func (*Client) Debugf ¶ added in v0.0.2
Debugf sends a debug message using format to Slack Error Channel.
func (*Client) Errorf ¶ added in v0.0.2
Errorf sends a error message using format to Slack Error Channel.
func (*Client) Fatal ¶
Fatal sends a fatal message to Slack Error Channel. This method doesn't call os.Exit(1).
func (*Client) Fatalf ¶ added in v0.0.2
Fatalf sends a fatal message using format to Slack Error Channel. This method doesn't call os.Exit(1).
func (*Client) Infof ¶ added in v0.0.2
Infof sends a info message using format to Slack Error Channel.
func (*Client) Send ¶
func (c *Client) Send(urlKey, message string, options ...WebhookOption) error
Send is a function to send message to Slack.
func (*Client) SetErrorURL ¶
SetErrorURL is a function to set Webhook URL for error alert to the client. If the error alert URL is already set, this function throws a panic.
func (*Client) SetURL ¶
SetURL is a function to set Webhook URL to the client. If the key is already set, this function throws a panic.
type WebhookOption ¶
type WebhookOption func(*slack.WebhookMessage)
WebhookOption changes some parameters of the webhook message.
func WebhookIconURL ¶ added in v0.0.4
func WebhookIconURL(iconURL string) WebhookOption
WebhookIconURL changes icon url of the webhook message.
func WebhookUsername ¶
func WebhookUsername(username string) WebhookOption
WebhookUsername changes username of the webhook message.