freetextfetcher

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextActionKey  = "id"
	ContextMessageKey = "message"
	ContextPayloadKey = "payload"

	ContextNewMessage = "new_message"
	ContextNewPayload = "new_payload"

	CancelAction = "cancel"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FreetextFetcher

type FreetextFetcher interface {
	MessageHasBeenPosted(c *plugin.Context, post *model.Post, api plugin.API, l logger.Logger, botUserID string, pluginURL string)
	StartFetching(userID string, payload string)
	UpdateHooks(validate func(string) string, onFetch func(string, string), onCancel func(string))
	URL() string
}

func NewFreetextFetcher

func NewFreetextFetcher(
	baseURL string,
	store FreetextStore,
	validate func(string) string,
	onFetch func(string, string),
	onCancel func(string),
	r *mux.Router,
	p poster.Poster,
) FreetextFetcher

type FreetextStore

type FreetextStore interface {
	StartFetching(userID, fetcherID, payload string) error
	StopFetching(userID string) error
	ShouldProcessFreetext(userID, fetcherID string) (bool, string, error)
}

func NewFreetextStore

func NewFreetextStore(apiClient pluginapi.Client, keyPrefix string) FreetextStore

type Manager

type Manager interface {
	MessageHasBeenPosted(c *plugin.Context, post *model.Post, api plugin.API, l logger.Logger, botUserID string, pluginURL string)
	Clear()
}

func GetManager

func GetManager() Manager

Directories

Path Synopsis
Package mock_freetext_fetcher is a generated GoMock package.
Package mock_freetext_fetcher is a generated GoMock package.

Jump to

Keyboard shortcuts

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