slack

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exiting = false

Exiting is a flag indicating that the server is exiting

View Source
var WaitGroup sync.WaitGroup

WaitGroup is the wait group to synchronize slack rtm shutdowns

Functions

func Init

func Init(c *Config) error

Init initializes the slack client

func ListenForMessages added in v1.1.0

func ListenForMessages(messageMap map[*regexp.Regexp]chan<- *Message)

ListenForMessages opens an RTM connection to slack and listens for any messages in the configured channel which matches any of the regexps and sends the message to the mapped channel

func MentionsRegexp added in v1.1.0

func MentionsRegexp() (*regexp.Regexp, error)

MentionsRegexp returns a regexp matching messages which mention the configured user

func PostLogMessage

func PostLogMessage(message, level string) error

PostLogMessage posts a formatted log message to slack

Types

type Config

type Config struct {
	Token           string
	Channel         string
	Username        string
	Emoji           string
	DeployUsernames *util.StringSet
}

Config is the slack configuration

type Message added in v1.1.0

type Message struct {
	Timestamp string // this is guaranteed to be unique per channel
	Text      string
	Matches   []string
	Username  string
}

Message is a slack message from the configured channel

Jump to

Keyboard shortcuts

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