Documentation
¶
Overview ¶
Package matterhook provides interaction with mattermost incoming/outgoing webhooks
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Url string // URL for incoming webhooks on mattermost.
In chan IMessage
Out chan OMessage
Config
// contains filtered or unexported fields
}
Client for Mattermost.
func (*Client) ServeHTTP ¶
func (c *Client) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implementation.
func (*Client) StartServer ¶
func (c *Client) StartServer()
StartServer starts a webserver listening for incoming mattermost POSTS.
type Config ¶
type Config struct {
BindAddress string // Address to listen on
Token string // Only allow this token from Mattermost. (Allow everything when empty)
InsecureSkipVerify bool // disable certificate checking
DisableServer bool // Do not start server for outgoing webhooks from Mattermost.
}
Config for client.
type IMessage ¶
type IMessage struct {
BotID string `schema:"bot_id"`
BotName string `schema:"bot_name"`
Token string `schema:"token"`
TeamID string `schema:"team_id"`
TeamDomain string `schema:"team_domain"`
ChannelID string `schema:"channel_id"`
ChannelName string `schema:"channel_name"`
Timestamp string `schema:"timestamp"`
UserID string `schema:"user_id"`
UserName string `schema:"user_name"`
PostId string `schema:"post_id"`
RawText string `schema:"raw_text"`
ServiceId string `schema:"service_id"`
Text string `schema:"text"`
TriggerWord string `schema:"trigger_word"`
FileIDs string `schema:"file_ids"`
}
IMessage for mattermost outgoing webhook. (received from mattermost)
type OMessage ¶
type OMessage struct {
Channel string `json:"channel,omitempty"`
IconURL string `json:"icon_url,omitempty"`
IconEmoji string `json:"icon_emoji,omitempty"`
UserName string `json:"username,omitempty"`
Text string `json:"text"`
Attachments []slack.Attachment `json:"attachments,omitempty"`
Type string `json:"type,omitempty"`
Props map[string]interface{} `json:"props"`
}
OMessage for mattermost incoming webhook. (send to mattermost)
Click to show internal directories.
Click to hide internal directories.