flow

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(r *mux.Router, flow Flow, store FlowStore)

Types

type Flow

type Flow interface {
	Steps() []steps.Step
	Step(i int) steps.Step
	URL() string
	Length() int
	StepDone(userID string, step int, value interface{})
	FlowDone(userID string)
}

func NewFlow added in v0.1.2

func NewFlow(stepList []steps.Step, url string, fc FlowController, onFlowDone func(userID string)) Flow

type FlowController

type FlowController interface {
	RegisterFlow(Flow, FlowStore)
	Start(userID string) error
	NextStep(userID string, from int, value interface{}) error
	GetCurrentStep(userID string) (steps.Step, int, error)
	GetHandlerURL() string
	Cancel(userID string) error
}

func NewFlowController

func NewFlowController(p poster.Poster, l logger.Logger, pluginURL string) FlowController

type FlowStore

type FlowStore interface {
	SetProperty(userID, propertyName string, value interface{}) error
	SetPostID(userID, propertyName, postID string) error
	GetPostID(userID, propertyName string) (string, error)
	RemovePostID(userID, propertyName string) error
	GetCurrentStep(userID string) (int, error)
	SetCurrentStep(userID string, step int) error
	DeleteCurrentStep(userID string) error
}

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