slacka

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package slacka is a package to send alert to Slack App.

Index

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 New

func New(userame, serviceName, iconURL string) *Client

New returns slacka client.

func (*Client) Debug

func (c *Client) Debug(message string) error

Debug sends a debug message to Slack Error Channel.

func (*Client) Debugf added in v0.0.2

func (c *Client) Debugf(format string, a ...interface{}) error

Debugf sends a debug message using format to Slack Error Channel.

func (*Client) Error

func (c *Client) Error(message string) error

Error sends a error message to Slack Error Channel.

func (*Client) Errorf added in v0.0.2

func (c *Client) Errorf(format string, a ...interface{}) error

Errorf sends a error message using format to Slack Error Channel.

func (*Client) Fatal

func (c *Client) Fatal(message string) error

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

func (c *Client) Fatalf(format string, a ...interface{}) error

Fatalf sends a fatal message using format to Slack Error Channel. This method doesn't call os.Exit(1).

func (*Client) Info

func (c *Client) Info(message string) error

Info sends a info message to Slack Error Channel.

func (*Client) Infof added in v0.0.2

func (c *Client) Infof(format string, a ...interface{}) error

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

func (c *Client) SetErrorURL(url string)

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

func (c *Client) SetURL(key, url string)

SetURL is a function to set Webhook URL to the client. If the key is already set, this function throws a panic.

func (*Client) Warn

func (c *Client) Warn(message string) error

Warn sends a warning message to Slack Error Channel.

func (*Client) Warnf added in v0.0.2

func (c *Client) Warnf(format string, a ...interface{}) error

Warnf sends a warn message using format to Slack Error Channel.

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.

Jump to

Keyboard shortcuts

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