rockethook

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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