Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllCause = []Cause{ CauseExecute, CauseRetry, CauseCatch, }
View Source
var AllChoiceHelper = []ChoiceHelper{ ChoiceHelperStringEquals, ChoiceHelperIntEquals, ChoiceHelperIntGreaterThanEquals, ChoiceHelperIntGreaterThan, ChoiceHelperIntLessThanEquals, ChoiceHelperIntLessThan, ChoiceHelperFloatEquals, ChoiceHelperFloatGreaterThanEquals, ChoiceHelperFloatGreaterThan, ChoiceHelperFloatLessThanEquals, ChoiceHelperFloatLessThan, }
View Source
var AllErrorCode = []ErrorCode{ ErrorCodeAll, ErrorCodeTimeout, ErrorCodeRuntime, ErrorCodeTaskfailed, ErrorCodePermissions, }
View Source
var AllHTTPMethod = []HTTPMethod{ HTTPMethodGet, HTTPMethodPost, HTTPMethodPut, HTTPMethodPatch, HTTPMethodDelete, }
View Source
var AllProtocol = []Protocol{ ProtocolHTTP, ProtocolGrpc, ProtocolPubsub, ProtocolNats, ProtocolRedisStream, }
View Source
var AllStatus = []Status{ StatusPending, StatusWorking, StatusSuccess, StatusTimeout, StatusOverload, StatusFailed, }
View Source
var AllTaskType = []TaskType{ TaskTypePass, TaskTypeTask, TaskTypeWait, TaskTypeParallel, TaskTypeChoice, }
Functions ¶
This section is empty.
Types ¶
type Choice ¶
type Choice struct { Not *ChoiceOperation `json:"not"` Or []*ChoiceOperation `json:"or"` And []*ChoiceOperation `json:"and"` Variable *string `json:"variable"` Helper *ChoiceHelper `json:"helper"` String *string `json:"string"` Int *int `json:"int"` Float *float64 `json:"float"` Next *string `json:"next"` }
type ChoiceHelper ¶
type ChoiceHelper string
const ( ChoiceHelperStringEquals ChoiceHelper = "StringEquals" ChoiceHelperIntEquals ChoiceHelper = "IntEquals" ChoiceHelperIntGreaterThanEquals ChoiceHelper = "IntGreaterThanEquals" ChoiceHelperIntGreaterThan ChoiceHelper = "IntGreaterThan" ChoiceHelperIntLessThanEquals ChoiceHelper = "IntLessThanEquals" ChoiceHelperIntLessThan ChoiceHelper = "IntLessThan" ChoiceHelperFloatEquals ChoiceHelper = "FloatEquals" ChoiceHelperFloatGreaterThanEquals ChoiceHelper = "FloatGreaterThanEquals" ChoiceHelperFloatGreaterThan ChoiceHelper = "FloatGreaterThan" ChoiceHelperFloatLessThanEquals ChoiceHelper = "FloatLessThanEquals" ChoiceHelperFloatLessThan ChoiceHelper = "FloatLessThan" )
func (ChoiceHelper) IsValid ¶
func (e ChoiceHelper) IsValid() bool
func (ChoiceHelper) MarshalGQL ¶
func (e ChoiceHelper) MarshalGQL(w io.Writer)
func (ChoiceHelper) String ¶
func (e ChoiceHelper) String() string
func (*ChoiceHelper) UnmarshalGQL ¶
func (e *ChoiceHelper) UnmarshalGQL(v interface{}) error
type ChoiceOperation ¶
type ChoiceOperation struct { Variable string `json:"variable"` Helper ChoiceHelper `json:"helper"` String *string `json:"string"` Int *int `json:"int"` Float *float64 `json:"float"` }
type Endpoint ¶
type Endpoint struct { Protocol Protocol `json:"protocol"` ConnectTimeout *string `json:"connect_timeout"` DetectedErrorFromHeader []*KVItemInput `json:"detected_error_from_header"` // HTTP Method *HTTPMethod `json:"method"` URL *string `json:"url"` Headers []*KVItemInput `json:"headers"` Body *string `json:"body"` Insecure *bool `json:"insecure"` Proxy *string `json:"proxy"` // GRPC Symbol *string `json:"symbol"` // json or text Format *string `json:"format"` AddHeaders []string `json:"add_headers"` RPCHeaders []string `json:"rpc_headers"` ReflHeaders []string `json:"refl_headers"` // PUBSUB Credential *string `json:"credential"` ProjectID *string `json:"project_id"` TopicID *string `json:"topic_id"` // NATS Subject *string `json:"subject"` User *string `json:"user"` Password *string `json:"password"` Token *string `json:"token"` ClusterName *string `json:"cluster_name"` // REDIS_STREAM Queue *string `json:"queue"` Db *int `json:"db"` }
type ErrorCode ¶
type ErrorCode string
Ref: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
func (ErrorCode) MarshalGQL ¶
func (*ErrorCode) UnmarshalGQL ¶
type HTTPMethod ¶
type HTTPMethod string
const ( HTTPMethodGet HTTPMethod = "GET" HTTPMethodPost HTTPMethod = "POST" HTTPMethodPut HTTPMethod = "PUT" HTTPMethodPatch HTTPMethod = "PATCH" HTTPMethodDelete HTTPMethod = "DELETE" )
func (HTTPMethod) IsValid ¶
func (e HTTPMethod) IsValid() bool
func (HTTPMethod) MarshalGQL ¶
func (e HTTPMethod) MarshalGQL(w io.Writer)
func (HTTPMethod) String ¶
func (e HTTPMethod) String() string
func (*HTTPMethod) UnmarshalGQL ¶
func (e *HTTPMethod) UnmarshalGQL(v interface{}) error
type Job ¶
type Job struct { Comment string `json:"comment"` // json string Parameters *string `json:"parameters"` StartAt string `json:"start_at"` // How much nums of task will be execute consistently ConsistentTaskNums *int `json:"consistent_task_nums"` Tasks []*Task `json:"tasks"` // Maximum seconds of job execution Timeout *int `json:"timeout"` // Maximum number of task execution MaxTaskExecution *int `json:"max_task_execution"` }
type JobStatus ¶
type JobStatus struct { JobID string `json:"job_id" gorm:"type: varchar(255)"` Status Status `json:"status" gorm:"index; type: varchar(64)"` Timestamp time.Time `json:"timestamp"` TaskHistory []*TaskHistory `json:"task_history" gorm:"-"` }
type KVItemInput ¶
type Retry ¶
type Retry struct { ErrorOn []*ErrorCode `json:"error_on"` // An integer that represents the number of seconds before the first retry attempt Interval *int `json:"interval"` // A positive integer that represents the maximum number of retry attempts, Can be replace with variables MaxAttempts *string `json:"max_attempts"` ExcludeErrorMessage []*string `json:"exclude_error_message"` }
type Task ¶
type Task struct { Name string `json:"name"` Type TaskType `json:"type"` End *bool `json:"end"` Next *string `json:"next"` Retry *Retry `json:"retry"` Catch *Catch `json:"catch"` // Ref: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html InputPath *string `json:"input_path"` // Ref: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html ResultPath *string `json:"result_path"` // Ref: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-outputpath.html OutputPath *string `json:"output_path"` ErrorPath *string `json:"error_path"` HeaderPath *string `json:"header_path"` // Task Endpoint *Endpoint `json:"endpoint"` Timeout *int `json:"timeout"` // Wait Seconds *int `json:"seconds"` Until *time.Time `json:"until"` // Parallel Branches []*Job `json:"branches"` // Choice Choices []*Choice `json:"choices"` Default *string `json:"default"` }
Ref: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-states.html
type TaskHistory ¶
type TaskHistory struct { From string `json:"from" gorm:"type: varchar(255)"` Cause Cause `json:"cause" gorm:"type: varchar(255)"` TaskID string `json:"task_id" gorm:"type: varchar(255)"` Status Status `json:"status" gorm:"type: varchar(64)"` RetryCount *int `json:"retry_count"` ExecutedAt *time.Time `json:"executed_at"` CancelledAt *time.Time `json:"cancelled_at"` CompletedAt *time.Time `json:"completed_at"` Input scalar.Map `json:"input" gorm:"type: json"` Output scalar.Map `json:"output" gorm:"type: json"` }
type TaskType ¶
type TaskType string
Ref: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-states.html
func (TaskType) MarshalGQL ¶
func (*TaskType) UnmarshalGQL ¶
Click to show internal directories.
Click to hide internal directories.