types

package
v0.0.0-...-b2a27bc Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitializingStatus = "initializing"
	RunningStatus      = "running"
	SucceedStatus      = "succeed"
	FailedStatus       = "failed"
	ErrorStatus        = "error"
	PausedStatus       = "paused"
	CanceledStatus     = "canceled"

	TriggerEvent       = "flow.execute.trigger"
	ExecuteFinishEvent = "flow.execute.finish"
	ExecuteFailedEvent = "flow.execute.failed"
	ExecuteErrorEvent  = "flow.execute.error"
	ExecutePauseEvent  = "flow.execute.pause"
	ExecuteResumeEvent = "flow.execute.resume"
	ExecuteCancelEvent = "flow.execute.cancel"

	PolicyFastFailed = "fastFailed"
	PolicyPaused     = "paused"
	PolicyContinue   = "continue"
)
View Source
const (
	DecodeTypeJsonPath = "jsonpath"
	DecodeTypeRegular  = "regular"
)
View Source
const (
	EncodeTypeGoTpl = "gotemplate"
)

Variables

This section is empty.

Functions

func IsFinishedStatus

func IsFinishedStatus(sts string) bool

Types

type ControlPolicy

type ControlPolicy struct {
	FailedPolicy string
}

type Decoder

type Decoder struct {
	DecodeType string `json:"decode_type"`
	InputTask  string `json:"input_task"`
	Pattern    string `json:"pattern"`
}

type Encoder

type Encoder struct {
	EncodeType string `json:"encode_type"`
	Template   string `json:"template"`
}

type Flow

type Flow interface {
	GetID() string
	GetStatus() string
	SetStatus(string)
	GetMessage() string
	SetMessage(string)
	GetExecutor() string
	GetControlPolicy() ControlPolicy
	Tasks() []Task
}

type FlowSpec

type FlowSpec struct {
	ID            string        `json:"id"`
	Describe      string        `json:"describe"`
	Executor      string        `json:"executor"`
	Scheduler     string        `json:"scheduler"`
	Status        string        `json:"status"`
	Message       string        `json:"message"`
	ControlPolicy ControlPolicy `json:"control_policy"`
	Tasks         []TaskSpec    `json:"tasks"`
	OnFailure     []TaskSpec    `json:"on_failure"`
}

func (*FlowSpec) GetMessage

func (f *FlowSpec) GetMessage() string

func (*FlowSpec) GetStatus

func (f *FlowSpec) GetStatus() string

func (*FlowSpec) SetMessage

func (f *FlowSpec) SetMessage(msg string)

func (*FlowSpec) SetStatus

func (f *FlowSpec) SetStatus(status string)

type Http

type Http struct {
	URL         string            `json:"url"`
	Method      string            `json:"method"`
	ContentType string            `json:"content_type"`
	Body        string            `json:"body"`
	Query       map[string]string `json:"query"`
	Headers     map[string]string `json:"headers"`
	Insecure    bool              `json:"insecure"`
}

type NextTask

type NextTask struct {
	OnSucceed string `json:"on_succeed,omitempty"`
	OnFailed  string `json:"on_failed,omitempty"`
}

type Script

type Script struct {
	Content string            `json:"content"`
	Command []string          `json:"command"`
	Env     map[string]string `json:"env"`
}

type Spec

type Spec struct {
	Type       string            `json:"type"`
	Http       *Http             `json:"http,omitempty"`
	Translate  *Translate        `json:"translate,omitempty"`
	Script     *Script           `json:"script,omitempty"`
	Parameters map[string]string `json:"parameters"`
}

type Task

type Task interface {
	GetName() string
	GetStatue() string
	SetStatue(string)
	GetMessage() string
	SetMessage(string)
	Next() NextTask
}

type TaskSpec

type TaskSpec struct {
	Name          string   `json:"name"`
	Status        string   `json:"status"`
	Message       string   `json:"message"`
	OperatorSpec  Spec     `json:"operator_spec"`
	Next          NextTask `json:"next,omitempty"`
	RetryOnFailed int      `json:"retry_on_failed,omitempty"`
}

func (*TaskSpec) GetMessage

func (t *TaskSpec) GetMessage() string

func (*TaskSpec) GetStatus

func (t *TaskSpec) GetStatus() string

func (*TaskSpec) SetMessage

func (t *TaskSpec) SetMessage(msg string)

func (*TaskSpec) SetStatus

func (t *TaskSpec) SetStatus(status string)

type Translate

type Translate struct {
	Encoder *Encoder `json:"encoder,omitempty"`
	Decoder *Decoder `json:"decoder,omitempty"`
}

Jump to

Keyboard shortcuts

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