state

package
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateNameAndType

func ValidateNameAndType(s State) error

Types

type Catcher

type Catcher struct {
	ErrorEquals []*string      `json:",omitempty"`
	ResultPath  *jsonpath.Path `json:",omitempty"`
	Next        *string        `json:",omitempty"`
}

type Choice

type Choice struct {
	ChoiceRule

	Next *string `json:",omitempty"`
}

type ChoiceRule

type ChoiceRule struct {
	Variable *jsonpath.Path `json:",omitempty"`

	StringEquals            *string `json:",omitempty"`
	StringLessThan          *string `json:",omitempty"`
	StringGreaterThan       *string `json:",omitempty"`
	StringLessThanEquals    *string `json:",omitempty"`
	StringGreaterThanEquals *string `json:",omitempty"`

	NumericEquals            *float64 `json:",omitempty"`
	NumericLessThan          *float64 `json:",omitempty"`
	NumericGreaterThan       *float64 `json:",omitempty"`
	NumericLessThanEquals    *float64 `json:",omitempty"`
	NumericGreaterThanEquals *float64 `json:",omitempty"`

	BooleanEquals *bool `json:",omitempty"`

	TimestampEquals            *time.Time `json:",omitempty"`
	TimestampLessThan          *time.Time `json:",omitempty"`
	TimestampGreaterThan       *time.Time `json:",omitempty"`
	TimestampLessThanEquals    *time.Time `json:",omitempty"`
	TimestampGreaterThanEquals *time.Time `json:",omitempty"`

	And []*ChoiceRule `json:",omitempty"`
	Or  []*ChoiceRule `json:",omitempty"`
	Not *ChoiceRule   `json:",omitempty"`
}

type ChoiceState

type ChoiceState struct {
	Type    *string
	Comment *string `json:",omitempty"`

	InputPath  *jsonpath.Path `json:",omitempty"`
	OutputPath *jsonpath.Path `json:",omitempty"`

	Default *string `json:",omitempty"` // Default State if no choices match

	Choices []*Choice `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*ChoiceState) Execute

func (s *ChoiceState) Execute(ctx context.Context, input interface{}) (output interface{}, next *string, err error)

func (*ChoiceState) GetType

func (s *ChoiceState) GetType() *string

func (*ChoiceState) Name

func (s *ChoiceState) Name() *string

func (*ChoiceState) SetName

func (s *ChoiceState) SetName(name *string)

func (*ChoiceState) SetType

func (s *ChoiceState) SetType(t *string)

func (*ChoiceState) Validate

func (s *ChoiceState) Validate() error

type Execution

type Execution func(context.Context, interface{}) (interface{}, *string, error)

type FailState

type FailState struct {
	Type    *string
	Comment *string `json:",omitempty"`

	Error *string `json:",omitempty"`
	Cause *string `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*FailState) Execute

func (s *FailState) Execute(_ context.Context, input interface{}) (output interface{}, next *string, err error)

func (*FailState) GetType

func (s *FailState) GetType() *string

func (*FailState) Name

func (s *FailState) Name() *string

func (*FailState) SetName

func (s *FailState) SetName(name *string)

func (*FailState) SetType

func (s *FailState) SetType(t *string)

func (*FailState) Validate

func (s *FailState) Validate() error

type ParallelState

type ParallelState struct {
	Type    *string
	Comment *string `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*ParallelState) Execute

func (s *ParallelState) Execute(_ context.Context, input interface{}) (output interface{}, next *string, err error)

func (*ParallelState) GetType

func (s *ParallelState) GetType() *string

func (*ParallelState) Name

func (s *ParallelState) Name() *string

func (*ParallelState) SetName

func (s *ParallelState) SetName(name *string)

func (*ParallelState) SetType

func (s *ParallelState) SetType(t *string)

func (*ParallelState) Validate

func (s *ParallelState) Validate() error

type PassState

type PassState struct {
	Type    *string
	Comment *string `json:",omitempty"`

	InputPath  *jsonpath.Path `json:",omitempty"`
	OutputPath *jsonpath.Path `json:",omitempty"`
	ResultPath *jsonpath.Path `json:",omitempty"`

	Result interface{} `json:",omitempty"`

	Next *string `json:",omitempty"`
	End  *bool   `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*PassState) Execute

func (s *PassState) Execute(ctx context.Context, input interface{}) (output interface{}, next *string, err error)

func (*PassState) GetType

func (s *PassState) GetType() *string

func (*PassState) Name

func (s *PassState) Name() *string

func (*PassState) SetName

func (s *PassState) SetName(name *string)

func (*PassState) SetType

func (s *PassState) SetType(t *string)

func (*PassState) Validate

func (s *PassState) Validate() error

type Retrier

type Retrier struct {
	ErrorEquals     []*string `json:",omitempty"`
	IntervalSeconds *int      `json:",omitempty"`
	MaxAttempts     *int      `json:",omitempty"`
	BackoffRate     *float64  `json:",omitempty"`
	// contains filtered or unexported fields
}

type State

type State interface {
	Execute(context.Context, interface{}) (interface{}, *string, error)
	Validate() error

	SetName(*string)
	SetType(*string)

	Name() *string
	GetType() *string
}

type SucceedState

type SucceedState struct {
	Type    *string
	Comment *string `json:",omitempty"`

	InputPath  *jsonpath.Path `json:",omitempty"`
	OutputPath *jsonpath.Path `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*SucceedState) Execute

func (s *SucceedState) Execute(ctx context.Context, input interface{}) (output interface{}, next *string, err error)

func (*SucceedState) GetType

func (s *SucceedState) GetType() *string

func (*SucceedState) Name

func (s *SucceedState) Name() *string

func (*SucceedState) SetName

func (s *SucceedState) SetName(name *string)

func (*SucceedState) SetType

func (s *SucceedState) SetType(t *string)

func (*SucceedState) Validate

func (s *SucceedState) Validate() error

type TaskState

type TaskState struct {
	Type    *string
	Comment *string `json:",omitempty"`

	InputPath  *jsonpath.Path `json:",omitempty"`
	OutputPath *jsonpath.Path `json:",omitempty"`
	ResultPath *jsonpath.Path `json:",omitempty"`
	Parameters interface{}    `json:",omitempty"`

	Resource *string `json:",omitempty"`

	Catch []*Catcher `json:",omitempty"`
	Retry []*Retrier `json:",omitempty"`

	// Maps a Lambda Handler Function
	TaskHandler interface{} `json:"-"`

	Next *string `json:",omitempty"`
	End  *bool   `json:",omitempty"`

	TimeoutSeconds   int `json:",omitempty"`
	HeartbeatSeconds int `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*TaskState) Execute

func (s *TaskState) Execute(ctx context.Context, input interface{}) (output interface{}, next *string, err error)

Input must include the Task name in $.Task

func (*TaskState) GetType

func (s *TaskState) GetType() *string

func (*TaskState) Name

func (s *TaskState) Name() *string

func (*TaskState) SetName

func (s *TaskState) SetName(name *string)

func (*TaskState) SetTaskHandler

func (s *TaskState) SetTaskHandler(resourcefn interface{})

func (*TaskState) SetType

func (s *TaskState) SetType(t *string)

func (*TaskState) Validate

func (s *TaskState) Validate() error

type WaitState

type WaitState struct {
	Type    *string
	Comment *string `json:",omitempty"`

	InputPath  *jsonpath.Path `json:",omitempty"`
	OutputPath *jsonpath.Path `json:",omitempty"`

	Seconds     *float64       `json:",omitempty"`
	SecondsPath *jsonpath.Path `json:",omitempty"`

	Timestamp     *time.Time     `json:",omitempty"`
	TimestampPath *jsonpath.Path `json:",omitempty"`

	Next *string `json:",omitempty"`
	End  *bool   `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*WaitState) Execute

func (s *WaitState) Execute(ctx context.Context, input interface{}) (output interface{}, next *string, err error)

func (*WaitState) GetType

func (s *WaitState) GetType() *string

func (*WaitState) Name

func (s *WaitState) Name() *string

func (*WaitState) SetName

func (s *WaitState) SetName(name *string)

func (*WaitState) SetType

func (s *WaitState) SetType(t *string)

func (*WaitState) Validate

func (s *WaitState) Validate() error

Jump to

Keyboard shortcuts

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