rest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel contains a REST client

func New added in v0.6.0

func New(config Config) *Channel

New returns an initialized REST client/channel

func (*Channel) ReceiveMessage

func (c *Channel) ReceiveMessage(body []byte) (*messages.Receive, error)

ReceiveMessage for REST

func (*Channel) ReceiveMessages

func (c *Channel) ReceiveMessages(receiveChan chan messages.Receive)

ReceiveMessages uses event queues to receive messages. Starts a long running process

func (*Channel) SendMessage

func (c *Channel) SendMessage(response *messages.Response) error

SendMessage for REST

func (*Channel) ValidateCallback added in v0.6.0

func (c *Channel) ValidateCallback(r *http.Request) bool

ValidateCallback validates a callback to the channel

type Config added in v0.6.0

type Config struct {
	CallbackToken string `mapstructure:"callback_token"`
}

Config models REST channel configuration

type MessageIn

type MessageIn struct {
	Sender string `json:"sender"`
	Text   string `json:"text"`
}

MessageIn from REST client

Jump to

Keyboard shortcuts

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