adapter

package
Version: v0.0.0-...-f5ab1f4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package adapter defines Adapter interface for mmbot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// Start starts the communication with the chat service.
	Start() (chan message.InMessage, chan error)

	// Stop terminates the communication.
	Stop()

	// Send sends a message to chat service.
	Send(msg *message.OutMessage) error

	// IncomingWebHook returns webhook. It will be disabled if nil.
	IncomingWebHook() *IncomingWebHook
}

Adapter is a client to a particular chat service.

type Config

type Config struct {
	OutgoingURL        string   // URL for incoming webhook on Mattermost
	IncomingPath       string   // Path for outgoing webhook from Mattermost
	Tokens             []string // Tokens from Mattermost
	OverrideUserName   string   // Overriding of username
	IconURL            string   // Overriding of icon URL
	InsecureSkipVerify bool     // Disable certificate checking
}

Config for an adapter.

type IncomingWebHook

type IncomingWebHook struct {
	// Mount path.
	Path string

	// Handler that receive messages.
	Handler http.HandlerFunc
}

IncomingWebHook represents incoming webhook that receive messages.

Jump to

Keyboard shortcuts

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