Documentation
¶
Overview ¶
Package mmhook implements an adapter that uses Mattermost Webhooks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for Mattermost.
func (*Client) IncomingWebHook ¶
func (c *Client) IncomingWebHook() *adapter.IncomingWebHook
IncomingWebHook returns webhook. It will be disabled if nil.
func (*Client) Send ¶
func (c *Client) Send(msg *message.OutMessage) error
Send sends a message to Mattermost.
func (*Client) ServeHTTP ¶
func (c *Client) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler interface. ServeHTTP receives a message from Mattermost outgoing webhook.
type InMessage ¶
type InMessage struct {
ChannelID string `schema:"channel_id"`
ChannelName string `schema:"channel_name"`
TeamDomain string `schema:"team_domain"`
TeamID string `schema:"team_id"`
Text string `schema:"text"`
Timestamp string `schema:"timestamp"`
Token string `schema:"token"`
TriggerWord string `schema:"trigger_word"`
UserID string `schema:"user_id"`
UserName string `schema:"user_name"`
}
InMessage represents a message from Mattermost outgouing webhook. (received from Mattermost)
type OutMessage ¶
type OutMessage struct {
Text string `json:"text,omitempty"`
Channel string `json:"channel,omitempty"`
UserName string `json:"username,omitempty"`
IconURL string `json:"icon_url,omitempty"`
}
OutMessage represents a message to Mattermost incomig webhook. (send to Mattermost)
Click to show internal directories.
Click to hide internal directories.