decoder

package
v0.0.0-...-fefb669 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

package quota defined skyflow quota here

Index

Constants

This section is empty.

Variables

View Source
var DefaultQuota = Quota{
	MaxStateNameSize:           200,
	MaxStateNumber:             1000,
	MaxStateMachineDepth:       100,
	MaxParallelBranchNumber:    500,
	MaxMapBranchNumber:         500,
	MaxMapConncurrency:         100,
	MaxActivityURISize:         200,
	MaxStartExecutionInputSize: 128 * 1024,
	MaxExecuteTimes:            10000,
	MaxExecutionUUIDSize:       200,

	MaxWorkflowSize:     512 * 1024,
	MaxWorkflowURISize:  200,
	MaxStepNameSize:     200,
	MaxRunningExecution: 1000,
	MaxTitleSize:        200,

	MaxInputSize: 128 * 1024,

	MaxOutputSize: 128 * 1024,

	MaxStepDataSize: 32 * 1024,

	MaxTaskInputSize: 32 * 1024,

	MaxTaskOutputSize: 32 * 1024,
}

DefaultQuota default quota

View Source
var DefaultStateMachineHeader = states.StateMachineHeader{
	Version: "1.0",
	Type:    WorkflowType.Statemachine,
}

DefaultStateMachineHeader ...

View Source
var StandardParserConfig = ParserConfig{
	AllowActivity: true,
	AllowWait:     true,
	AllowSuspend:  true,
	AllowParallel: true,
	AllowMap:      true,
	AllowChoice:   true,
	AllowFail:     true,
	AllowSucceed:  true,
	AllowPass:     true,
}

StandardParserConfig standard model workflow

View Source
var WorkflowType = struct {
	Pipeline     string
	Statemachine string
	Stepfunction string
}{
	Pipeline:     "pipeline",
	Statemachine: "statemachine",
	Stepfunction: "stepfunction",
}

WorkflowType ...

Functions

func AddPath

func AddPath(ctx context.Context, paths ...string) context.Context

AddPath ...

func GetPath

func GetPath(ctx context.Context) []string

GetPath ...

func MergeError

func MergeError(ctx context.Context, err error) error

MergeError ...

func NewFieldPathError

func NewFieldPathError(ctx context.Context, err error) error

NewFieldPathError ...

Types

type CommonDecoder

type CommonDecoder struct {
}

CommonDecoder ...

func NewCommonDecoder

func NewCommonDecoder() *CommonDecoder

NewCommonDecoder ...

func (*CommonDecoder) AddCtxDecodePath

func (decoder *CommonDecoder) AddCtxDecodePath(ctx context.Context, paths ...string) context.Context

AddCtxDecodePath ...

func (*CommonDecoder) Decode

func (decoder *CommonDecoder) Decode(definition string) (*states.StateMachine, error)

Decode ...

func (*CommonDecoder) GetCtxDecodePath

func (decoder *CommonDecoder) GetCtxDecodePath(ctx context.Context) []string

GetCtxDecodePath ...

func (*CommonDecoder) JSONUnmarshall

func (decoder *CommonDecoder) JSONUnmarshall(data string, v any) error

JSONUnmarshall unmarshal the json string to the target object

func (*CommonDecoder) MapDecode

func (decoder *CommonDecoder) MapDecode(input any, output any) error

MapDecode decode the map to the target object

func (*CommonDecoder) NewFieldPathError

func (decoder *CommonDecoder) NewFieldPathError(ctx context.Context, err error) error

NewFieldPathError ...

type Decoder

type Decoder interface {
	Decode(definition string) (*states.StateMachine, error)
}

Decoder interface

type DecoderPath

type DecoderPath struct{}

DecoderPath ...

type ParserConfig

type ParserConfig struct {
	// AllowActivity specifies whether to allow activity Task.
	AllowActivity bool
	// AllowWait specifies whether to allow Wait State.
	AllowWait bool
	// AllowSuspend specifies whether to allow Suspend State.
	AllowSuspend bool
	// AllowParallel specifies whether to allow Parallel State.
	AllowParallel bool
	// AllowMap specifies whether to allow Map State.
	AllowMap bool
	// AllowChoice specifies whether to allow Choice State.
	AllowChoice bool
	// AllowFail specifies whether to allow Fail State.
	AllowFail bool
	// AllowSucceed specifies whether to allow Succeed State.
	AllowSucceed bool
	// AllowPass specifies whether to allow Pass State.
	AllowPass bool
}

ParserConfig ...

type Quota

type Quota struct {
	// MaxStateNameSize specifies the maximum size of the state name.
	MaxStateNameSize int
	// MaxStateLimit specifies the maximum number of states allowed in a workflow.
	// If the number of states exceeds this limit, the parser will return an error.
	// If MaxStateLimit is 0, the parser will not check the number of states.
	MaxStateNumber int
	// MaxParallelBranchNumber specifies the maximum number of branches allowed in a parallel state.
	MaxParallelBranchNumber int
	// MaxMapBranchNumber specifies the maximum number of branches allowed in a map state.
	MaxMapBranchNumber int
	// MaxMapConncurrency specifies the maximum number of branches allowed in a map state.
	MaxMapConncurrency int
	// MaxStateMachineDepth specifies the maximum depth of the state machine.
	MaxStateMachineDepth int
	// MaxActivityURISize specifies the maximum size of the activity URI.
	MaxActivityURISize int
	// MaxStartExecutionInputSize specifies the maximum size of the start execution input.
	MaxStartExecutionInputSize int
	// MaxExecuteTimes specifies the maximum number of times a workflow can be executed.
	MaxExecuteTimes int
	// MaxExecutionUUIDSize specifies the maximum size of the execution UUID.
	MaxExecutionUUIDSize int
	//  MaxWorkflowSize specifies the maximum size of the workflow.
	MaxWorkflowSize int
	// MaxWorkflowURISize specifies the maximum size of the workflow URI.
	MaxWorkflowURISize int
	// MaxStepNameSize specifies the maximum size of the step name.
	MaxStepNameSize int
	// MaxRunningExecution specifies the maximum number of running
	// executions allowed in the system.
	MaxRunningExecution int
	// MaxTitleSize specifies the maximum size of the title.
	MaxTitleSize int
	// MaxInputSize specifies the maximum size of the input.
	MaxInputSize int
	// MaxOutputSize specifies the maximum size of the output.
	MaxOutputSize int
	// MaxStepDataSize specifies the maximum size of the step stored data.
	MaxStepDataSize int
	// MaxTaskInputSize specifies the maximum size of the task input.
	MaxTaskInputSize int
	// MaxTaskOutputSize specifies the maximum size of the task output.
	MaxTaskOutputSize int
}

Quota defines the quota for the workflow parser

Jump to

Keyboard shortcuts

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