slack

package
v0.0.0-...-d92fe58 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(token string, options ClientOptions) flamingo.Client

NewClient creates a new Slack Client with the given token and options.

Types

type ClientOptions

type ClientOptions struct {
	// Debug will print extra debug log messages.
	Debug bool
	// Webhook contains the options for the slack webhook.
	Webhook WebhookOptions
}

ClientOptions are the configurable options of the slack client.

type WebhookOptions

type WebhookOptions struct {
	// Enabled will start the webhook endpoint if true.
	Enabled bool
	// Addr is the address on which the webhook will be run. Required
	// if EnableWebhook is true.
	Addr string
	// UseHTTPS will use HTTPS instead of HTTP to serve the webhook.
	// Note that using HTTPS is required by slack for receiving webhooks.
	UseHTTPS bool
	// CertFile is the path to the SSL certificate. If UseHTTPS is true it is required.
	CertFile string
	// KeyFile is the path to the SSL key. If UseHTTPS is true it is required.
	KeyFile string
}

WebhookOptions are the configurable options of the slack webhook.

type WebhookService

type WebhookService struct {
	// contains filtered or unexported fields
}

WebhookService is a service to handle slack interactive messages callbacks.

func NewWebhookService

func NewWebhookService(token string) *WebhookService

NewWebhookService returns a new WebhookService with the given token.

func (*WebhookService) Consume

func (s *WebhookService) Consume() <-chan slack.AttachmentActionCallback

Consume returns a channel where callbacks will be sent.

func (*WebhookService) ServeHTTP

func (s *WebhookService) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the actual HTTP handler of the service.

Jump to

Keyboard shortcuts

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