flow

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(h *httputils.Handler, flow Flow, store FlowStore)

Types

type EmptyStep

type EmptyStep struct {
	Title   string
	Message string
}

func (*EmptyStep) GetPropertyName

func (s *EmptyStep) GetPropertyName() string

func (*EmptyStep) IsEmpty

func (s *EmptyStep) IsEmpty() bool

func (*EmptyStep) PostSlackAttachment

func (s *EmptyStep) PostSlackAttachment(flowHandler string, i int) *model.SlackAttachment

func (*EmptyStep) ResponseSlackAttachment

func (s *EmptyStep) ResponseSlackAttachment(value bool) *model.SlackAttachment

func (*EmptyStep) ShouldSkip

func (s *EmptyStep) ShouldSkip(value bool) int

type Flow

type Flow interface {
	Step(i int) Step
	URL() string
	Length() int
	StepDone(userID string, step int, value bool)
	FlowDone(userID string)
}

type FlowStore

type FlowStore interface {
	SetProperty(userID, propertyName string, value bool) 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
}

type SimpleStep

type SimpleStep struct {
	Title                string
	Message              string
	PropertyName         string
	TrueButtonMessage    string
	FalseButtonMessage   string
	TrueResponseMessage  string
	FalseResponseMessage string
	TrueSkip             int
	FalseSkip            int
}

func (*SimpleStep) GetPropertyName

func (s *SimpleStep) GetPropertyName() string

func (*SimpleStep) IsEmpty

func (s *SimpleStep) IsEmpty() bool

func (*SimpleStep) PostSlackAttachment

func (s *SimpleStep) PostSlackAttachment(flowHandler string, i int) *model.SlackAttachment

func (*SimpleStep) ResponseSlackAttachment

func (s *SimpleStep) ResponseSlackAttachment(value bool) *model.SlackAttachment

func (*SimpleStep) ShouldSkip

func (s *SimpleStep) ShouldSkip(value bool) int

type Step

type Step interface {
	PostSlackAttachment(flowHandler string, i int) *model.SlackAttachment
	ResponseSlackAttachment(value bool) *model.SlackAttachment
	GetPropertyName() string
	ShouldSkip(value bool) int
	IsEmpty() bool
}

Jump to

Keyboard shortcuts

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