slack

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Token string
	Log   Logger
}

Config contains information about setting up a new slack client

type Logger

type Logger interface {
	Debug(...interface{})
	Warn(...interface{})
	Fatal(...interface{})
}

type Message

type Message struct {
	Channel  string
	Username string
	Text     string
	IconUrl  string
}

Message contains information about a slack message

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

Slack is the main object

func New

func New(config *Config) (*Slack, error)

New builds a slack client from the provided config

func (*Slack) GetChannels

func (s *Slack) GetChannels() ([]string, error)

GetChannels looks up and returns a slice of channel names

func (*Slack) PostMessage

func (s *Slack) PostMessage(msg *Message) error

PostMessage posts a message to a Slack channel with the provided Message parameters

Jump to

Keyboard shortcuts

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