slack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisplayName      = "Slack"
	HandlerKey       = "slack"
	MessageDirection = "in"
)

Variables

This section is empty.

Functions

func BuildInboundMessageBytes

func BuildInboundMessageBytes(ctx *fasthttp.RequestCtx) []byte

func Normalize

func Normalize(bytes []byte) (cc.Message, error)

Types

type Handler

type Handler struct {
	Config  config.Configuration
	Adapter adapters.Adapter
}

FastHttp request handler constructor for Slack inbound webhook

func NewHandler

func NewHandler(config config.Configuration, adapter adapters.Adapter) Handler

FastHttp request handler constructor for Slack in bound webhook

func (Handler) HandleFastHTTP

func (h Handler) HandleFastHTTP(ctx *fasthttp.RequestCtx)

HandleFastHTTP is the method to respond to a fasthttp request.

func (Handler) HandlerKey

func (h Handler) HandlerKey() string

func (Handler) MessageDirection

func (h Handler) MessageDirection() string

type SlackWebhookMessage

type SlackWebhookMessage struct {
	Username  string `json:"username"`
	IconEmoji string `json:"icon_emoji"`
	IconURL   string `json:"icon_url"`
	Text      string `json:"text"`
}

func SlackWebhookMessageFromBytes

func SlackWebhookMessageFromBytes(bytes []byte) (SlackWebhookMessage, error)

Jump to

Keyboard shortcuts

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