slack

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: Apache-2.0 Imports: 7 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 ListenForMentions

func ListenForMentions(mentions chan<- *Mention)

ListenForMentions opens an RTM connection to slack and listens for any mentions of the configured user in the configured channel

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 []string
}

Config is the slack configuration

type Mention

type Mention struct {
	Timestamp string // this is guaranteed to be unique per channel
	Text      string
	Username  string
}

Mention is a mention of the vili bot from the configured channel

Jump to

Keyboard shortcuts

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