slack

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Slack

	URL        *url.URL
	HTTPClient *http.Client

	Logger *log.Logger
}

func NewClient

func NewClient(urlStr string, logger *log.Logger) (*Client, error)

func NewClientForPostFile added in v0.4.3

func NewClientForPostFile(logger *log.Logger) (*Client, error)

func (*Client) PostFile

func (c *Client) PostFile(ctx context.Context, token string, param *PostFileParam) error

func (*Client) PostText

func (c *Client) PostText(ctx context.Context, param *PostTextParam) error

type PostFileParam

type PostFileParam struct {
	Channel  string
	Content  string
	Filename string
	Filetype string
}

type PostTextParam

type PostTextParam struct {
	Channel   string `json:"channel,omitempty"`
	Username  string `json:"username,omitempty"`
	Text      string `json:"text"`
	IconEmoji string `json:"icon_emoji,omitempty"`
}

type Slack added in v0.2.2

type Slack interface {
	PostText(ctx context.Context, param *PostTextParam) error
	PostFile(ctx context.Context, token string, param *PostFileParam) error
}

Jump to

Keyboard shortcuts

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