flow

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Start(userID string) error
	NextStep(userID string, from int, skip int) error
	GetCurrentStep(userID string) (steps.Step, int, error)
	GetFlow() Flow
	Cancel(userID string) error
}

func NewFlowController

func NewFlowController(
	l logger.Logger,
	r *mux.Router,
	p poster.Poster,
	d DialogCreater,
	pluginURL string,
	flow Flow,
	flowStore Store,
) Controller

type DialogCreater added in v0.0.23

type DialogCreater interface {
	OpenInteractiveDialog(dialog model.OpenDialogRequest) error
}

type Flow

type Flow interface {
	Name() string
	Path() string
	Steps() []steps.Step
	Step(i int) steps.Step
	Length() int
	FlowDone(userID string)
}

func NewFlow

func NewFlow(name string, stepList []steps.Step, onFlowDone func(userID string)) Flow

NewFlow creates a new flow using a an non-empty list of steps.

name must be a unique identifier for a flow within the plugin.

type Store

type Store interface {
	SetPostID(userID, flowName, stepName, postID string) error
	GetPostID(userID, flowName, stepName string) (string, error)
	RemovePostID(userID, flowName, stepName string) error

	GetCurrentStep(userID, flowName string) (int, error)
	SetCurrentStep(userID, flowName string, step int) error
	DeleteCurrentStep(userID, flowName string) error
}

func NewFlowStore

func NewFlowStore(kv *pluginapi.KVService, keyPrefix string) Store

Directories

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

Jump to

Keyboard shortcuts

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