flow

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedisStateStore

func RedisStateStore(log log.Ilogger)

func SqliteStateStore

func SqliteStateStore(log log.Ilogger)

Types

type FlowElement

type FlowElement struct {
	TID string
	// contains filtered or unexported fields
}

func FlowGenerator

func FlowGenerator(id string, log log.Ilogger) *FlowElement

example:

TID := "jf93n22" paymentFlow := flow.FlowGenerator(TID, p.log) paymentFlow.

If("first-validation", firstValidation, "need-wait").
Do("calculate-sth-1", func() {}).
Do("calculate-sth-2", func() {}).
IfElse("second-validation", func() bool {
	return true
}, "calculate-sth-3", "will-send-package")

paymentFlow.End()

func (*FlowElement) Do

func (f *FlowElement) Do(alias string, cb func(), exceptSteps ...string) *FlowElement

Any kind of operation which dosen't need valid and clear output you can assume this functionality as pipline

func (*FlowElement) End

func (f *FlowElement) End()

func (*FlowElement) If

func (f *FlowElement) If(alias string, condition func() bool, failure string) *FlowElement

func (*FlowElement) IfElse

func (f *FlowElement) IfElse(alias string, condition func() bool, success string, failure string) *FlowElement

Jump to

Keyboard shortcuts

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