Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SlackConfig ¶
type SlackConfig struct { // APIKey is Slack API key APIKey string // Channel is the name of Slack channel Channel string // User is the name of Slack user User string // Msg is the message we are matching for Msg string }
SlackConfig configures Slack API client
type SlackMonitor ¶
type SlackMonitor struct { // embedding Slack client *slack.Client // mutex *sync.Mutex // contains filtered or unexported fields }
SlackMonitor is Slack API client which monitors messages
func NewSlackMonitor ¶
func NewSlackMonitor(c *SlackConfig) (*SlackMonitor, error)
NewSlackMonitor creates new Slack message monitor
func (*SlackMonitor) Channel ¶
func (s *SlackMonitor) Channel() string
Channel returns the name of the Slack channel which we monitor
func (*SlackMonitor) MonitorAndAlert ¶
func (s *SlackMonitor) MonitorAndAlert(msgChan chan<- *alertify.Msg) error
MonitorAndAlert monitors channel and notifies alertify Bot when the preconfigured message regexp is matched
func (*SlackMonitor) String ¶
func (s *SlackMonitor) String() string
String returns the name of the monitor
func (*SlackMonitor) User ¶
func (s *SlackMonitor) User() string
User returns slack user name whose message we monitor
Click to show internal directories.
Click to hide internal directories.