slack

package
v0.0.0-...-46cfdbf Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SlackPostMessageAPI = "https://slack.com/api/chat.postMessage"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequest

type APIRequest struct {
	Channel string `json:"channel,omitempty"`
	Text    string `json:"text,omitempty"`
	TS      string `json:"thread_ts,omitempty"`
}

type APIResponse

type APIResponse struct {
	Ok    bool   `json:"ok,omitempty"`
	TS    string `json:"ts,omitempty"`
	Error string `json:"error,omitempty"`
}

type Options

type Options struct {
	ID              string `yaml:"id,omitempty"`
	SlackWebHookURL string `yaml:"slack_webhook_url,omitempty"`
	SlackUsername   string `yaml:"slack_username,omitempty"`
	SlackChannel    string `yaml:"slack_channel,omitempty"`
	SlackThreads    bool   `yaml:"slack_threads,omitempty"`
	SlackThreadTS   string `yaml:"slack_thread_ts,omitempty"`
	SlackToken      string `yaml:"slack_token,omitempty"`
	SlackFormat     string `yaml:"slack_format,omitempty"`
}

func (*Options) SendThreaded

func (options *Options) SendThreaded(message string) error

type Provider

type Provider struct {
	Slack []*Options `yaml:"slack,omitempty"`
}

func New

func New(options []*Options, ids []string) (*Provider, error)

func (*Provider) Send

func (p *Provider) Send(message, CliFormat string) error

Jump to

Keyboard shortcuts

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