flow

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(r *mux.Router, fc Controller)

Types

type Controller

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

func NewFlowController

func NewFlowController(
	p poster.Poster,
	l logger.Logger,
	pluginURL string,
	flow Flow,
	flowStore Store,
	propertyStore PropertyStore,
) Controller

type Flow

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

func NewFlow

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

type PropertyStore

type PropertyStore interface {
	SetProperty(userID, propertyName string, value interface{}) error
}

type Store

type Store interface {
	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
}

func NewFlowStore

func NewFlowStore(apiClient pluginapi.Client, 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