rockethook

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	In chan Message

	Config
	// contains filtered or unexported fields
}

Client for Rocketchat.

func New

func New(url string, config Config) *Client

New Rocketchat client.

func (*Client) Receive

func (c *Client) Receive() Message

Receive returns an incoming message from mattermost outgoing webhooks URL.

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 Rocketchat. (Allow everything when empty)
	InsecureSkipVerify bool   // disable certificate checking
}

Config for client.

type Message

type Message struct {
	Token       string `json:"token"`
	ChannelID   string `json:"channel_id"`
	ChannelName string `json:"channel_name"`
	Timestamp   string `json:"timestamp"`
	UserID      string `json:"user_id"`
	UserName    string `json:"user_name"`
	Text        string `json:"text"`
}

Message for rocketchat outgoing webhook.

Jump to

Keyboard shortcuts

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