task

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package task defines commonly used tasks across plugins. Plugins can share these common tasks and use them in their state machines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Iterate added in v0.2.0

func Iterate(p *dt.Plugin, label string, opts OptsIterate) []dt.State

Iterate through a set of options allowing the user to select one before continuing.

func New

func New(p *dt.Plugin, t Type, label string) []dt.State

New returns a slice of States for inclusion into a StateMachine.SetStates() call.

func ResetIterate added in v0.2.0

func ResetIterate(p *dt.Plugin, in *dt.Msg)

ResetIterate should be called from within your plugin's SetOnReset function if you use the Iterable task.

Types

type OptsIterate added in v0.2.0

type OptsIterate struct {
	// IterableMemKey is the key in memory where the iterable items exist.
	// The iterable memory must be a []string.
	IterableMemKey string

	// ResultMemKey is the key in memory where the selected item's index is
	// stored. Use this key to access the results of the Iterable task.
	ResultMemKeyIdx string
}

OptsIterate holds the options for an iterable task.

type Type

type Type int

Type references the type of task to perform. Valid options are constant.

const (
	// RequestAddress for a given user.
	RequestAddress Type = iota + 1
)

Jump to

Keyboard shortcuts

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