slackapi

package
v0.0.0-...-f1068a2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceType = "slackapi"

ServiceType of the Slack API service

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	types.DefaultService

	// The URL which should be given to an outgoing slack webhook - Populated by Go-NEB after Service registration.
	WebhookURL  string `json:"webhook_url"`
	RoomID      string `json:"room_id"`
	MessageType string `json:"message_type"`
	// contains filtered or unexported fields
}

Service contains the Config fields for the Slack API service.

This service will send HTML formatted messages into a room when an outgoing slack webhook hits WebhookURL.

Example JSON request:

{
  "room_id": "!someroomid:some.domain.com",
  "message_type": "m.text"
}

func (*Service) OnReceiveWebhook

func (s *Service) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli *gomatrix.Client)

OnReceiveWebhook receives requests from a slack outgoing webhook and possibly sends requests to Matrix as a result.

This requires that the WebhookURL is given to an outgoing slack webhook (see https://api.slack.com/outgoing-webhooks)

func (*Service) Register

func (s *Service) Register(oldService types.Service, client *gomatrix.Client) error

Register joins the configured room and sets the public WebhookURL

Jump to

Keyboard shortcuts

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