Documentation
¶
Overview ¶
Package iproto defines API payloads, internal RPC messages, and task configuration schemas.
Index ¶
- Constants
- func DAGDependencies(routing *SStepRouting) xdag.DependencySpec
- type ApprovalCallbackConfig
- type ApprovalConfig
- type ApprovalCreate
- type ApprovalDecision
- type ApprovalRequest
- type ApprovalScalar
- type MkdirConfig
- type Replay
- type ReplayList
- type SEnv
- type SEnvs
- type SFileListRes
- type SFileRes
- type SFilesRes
- type SHealthyz
- type SPageReq
- type SPageRes
- type SRetryPolicy
- type SStepEdge
- type SStepLogRes
- type SStepLogsRes
- type SStepOptions
- type SStepReq
- type SStepRes
- type SStepRouting
- type SStepsReq
- type SStepsRes
- type SSystemConfig
- type SSystemDisk
- type STaskCreateRes
- type STaskListDetailRes
- type STaskReq
- type STaskRes
- type STasksRes
- type STimeRes
- type SVersion
- type SVersionGO
- type SVersionGit
- type SVersionUser
- type TaskControl
- type TaskSubmission
- type TouchConfig
- type WebShellSession
- type WorkerPoolMessage
- type WorkerPoolSizeQuery
Constants ¶
const ( XTaskName = "X-Task-Name" XTaskState = "X-Task-STATE" )
Variables ¶
This section is empty.
Functions ¶
func DAGDependencies ¶
func DAGDependencies(routing *SStepRouting) xdag.DependencySpec
DAGDependencies converts a step DAG definition to xdag dependencies.
Types ¶
type ApprovalCallbackConfig ¶
type ApprovalCallbackConfig struct {
URL string `json:"url"`
Approved string `json:"approved"`
Rejected string `json:"rejected"`
}
ApprovalCallbackConfig defines where and how approval decisions are reported.
type ApprovalConfig ¶
type ApprovalConfig struct {
Request struct {
URL string `json:"url"`
Method string `json:"method"`
Headers map[string]ApprovalScalar `json:"headers"`
Query map[string]ApprovalScalar `json:"query"`
} `json:"request"`
Callback ApprovalCallbackConfig `json:"callback"`
}
ApprovalConfig defines the content of an approval step.
type ApprovalCreate ¶
type ApprovalCreate struct {
ApprovalRequest
Callback ApprovalCallbackConfig `json:"callback"`
}
ApprovalCreate is the body sent to the external approval platform. Besides the invocation identity it tells the platform where and how to report the decision: POST/PUT Callback.URL with an ApprovalDecision carrying the same identity and one of the two statuses.
type ApprovalDecision ¶
type ApprovalDecision struct {
ApprovalRequest
Status string `json:"status"`
}
func DecodeApproval ¶
func DecodeApproval(data []byte) (ApprovalDecision, error)
type ApprovalRequest ¶
type ApprovalRequest struct {
ID string `json:"id"`
TaskName string `json:"task_name"`
StepName string `json:"step_name"`
}
ApprovalRequest identifies one invocation, not just a task or step name.
type ApprovalScalar ¶
type ApprovalScalar string
ApprovalScalar is a header or query value encoded as text on the wire. Keep numeric literals as text to avoid rounding identifiers larger than an IEEE-754 integer.
func (*ApprovalScalar) UnmarshalJSON ¶
func (s *ApprovalScalar) UnmarshalJSON(raw []byte) error
type MkdirConfig ¶
type MkdirConfig struct {
Path string `json:"path"`
}
MkdirConfig defines the content of a mkdir step.
type ReplayList ¶
type SFileListRes ¶
type SRetryPolicy ¶
type SRetryPolicy struct {
Interval time.Duration `json:"interval" yaml:"interval" description:"间隔时间" swaggertype:"integer" format:"int64"`
MaxInterval time.Duration `json:"maxInterval" yaml:"maxInterval" description:"最大间隔时间" swaggertype:"integer" format:"int64"`
MaxAttempts int64 `json:"maxAttempts" yaml:"maxAttempts" description:"最大尝试次数"`
Multiplier float64 `json:"multiplier" yaml:"multiplier" description:"乘数"`
Jitter float64 `json:"jitter,omitempty" yaml:"jitter,omitempty" minimum:"0" maximum:"1" description:"重试退避抖动"`
}
type SStepLogRes ¶
type SStepLogsRes ¶
type SStepLogsRes []*SStepLogRes
type SStepOptions ¶
type SStepOptions []byte
SStepOptions holds executor-specific settings as raw JSON. The selected executor validates the keys and values it accepts. For example, xexec accepts shell, and container accepts image, shell, and mounts.
func (SStepOptions) MarshalJSON ¶
func (o SStepOptions) MarshalJSON() ([]byte, error)
MarshalJSON returns the stored JSON, or null if no options are set.
func (SStepOptions) Object ¶
func (o SStepOptions) Object() (gjson.Result, error)
Object returns the options as a JSON object. No options at all is the same as an empty object, so a step that configures nothing needs no special case.
func (*SStepOptions) UnmarshalJSON ¶
func (o *SStepOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON keeps the raw JSON, so the step stores what the client sent rather than a re-encoded copy.
type SStepReq ¶
type SStepReq struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Desc string `json:"desc,omitempty" yaml:"desc,omitempty"`
Timeout time.Duration `json:"timeout,omitzero" yaml:"timeout,omitempty" swaggertype:"integer" format:"int64"`
Routing *SStepRouting `json:"routing,omitempty" yaml:"routing,omitempty"`
Env SEnvs `json:"env,omitempty" yaml:"env,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty" validate:"required"`
Options SStepOptions `` /* 183-byte string literal not displayed */
Content string `json:"content,omitempty" yaml:"content,omitempty" validate:"required"`
RetryPolicy *SRetryPolicy `json:"retryPolicy,omitempty" yaml:"retryPolicy,omitempty"`
}
type SStepRes ¶
type SStepRes struct {
Name string `json:"name" yaml:"name"`
State string `json:"state" yaml:"state"`
Code int64 `json:"code" yaml:"code"`
Desc string `json:"desc,omitempty" yaml:"desc,omitempty"`
Timeout time.Duration `json:"timeout,omitzero" yaml:"timeout,omitempty" swaggertype:"integer" format:"int64"`
Routing *SStepRouting `json:"routing,omitempty" yaml:"routing,omitempty"`
Message string `json:"message" yaml:"message"`
Env SEnvs `json:"env,omitempty" yaml:"env,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Options SStepOptions `` /* 183-byte string literal not displayed */
Content string `json:"content,omitempty" yaml:"content,omitempty"`
RetryPolicy *SRetryPolicy `json:"retryPolicy,omitempty" yaml:"retryPolicy,omitempty"`
Time *STimeRes `json:"time,omitempty" yaml:"time,omitempty"`
}
type SStepRouting ¶
type SStepRouting struct {
Edges []SStepEdge `json:"edges,omitempty" yaml:"edges,omitempty"`
Join string `json:"join,omitempty" yaml:"join,omitempty" enums:"all,any"`
Emit []string `json:"emit,omitempty" yaml:"emit,omitempty"`
}
SStepRouting configures labeled edges, their join policy, and labels emitted on success.
type SSystemConfig ¶
type SSystemConfig struct {
PoolSize int `json:"pool_size"`
CPUCores *int `json:"cpu_cores"`
CPUUsagePercent *float64 `json:"cpu_usage_percent"`
MemoryTotalBytes *uint64 `json:"memory_total_bytes"`
MemoryUsedPercent *float64 `json:"memory_used_percent"`
Disks []SSystemDisk `json:"disks"`
}
SSystemConfig reports the currently applied worker pool size and local system metrics.
type SSystemDisk ¶
type STaskCreateRes ¶
type STaskListDetailRes ¶
type STaskReq ¶
type STaskReq struct {
Workdir string `json:"workdir,omitempty" yaml:"workdir,omitempty"`
Timeout time.Duration `json:"timeout,omitzero" yaml:"timeout,omitempty" swaggertype:"integer" format:"int64"`
Cleanup bool `json:"cleanup,omitempty" yaml:"cleanup,omitempty"`
Env SEnvs `json:"env,omitempty" yaml:"env,omitempty"`
Step SStepsReq `json:"step,omitempty" yaml:"step,omitempty" validate:"required"`
}
type STaskRes ¶
type STaskRes struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Workdir string `json:"workdir,omitempty" yaml:"workdir,omitempty"`
State string `json:"state" yaml:"state"`
Count int64 `json:"count,omitempty" yaml:"count,omitempty"`
Timeout time.Duration `json:"timeout,omitzero" yaml:"timeout,omitempty" swaggertype:"integer" format:"int64"`
Cleanup bool `json:"cleanup" yaml:"cleanup"`
Message string `json:"message" yaml:"message"`
Env SEnvs `json:"env,omitempty" yaml:"env,omitempty"`
Time *STimeRes `json:"time,omitempty" yaml:"time,omitempty"`
}
type SVersion ¶
type SVersion struct {
BuildTime string `json:"buildTime" yaml:"buildTime"`
Version string `json:"version" yaml:"version"`
Git *SVersionGit `json:"git" yaml:"git"`
Go *SVersionGO `json:"go" yaml:"go"`
User *SVersionUser `json:"user" yaml:"user"`
}
type SVersionGO ¶
type SVersionGit ¶
type SVersionUser ¶
type TaskControl ¶
TaskControl targets a specific run, not a replacement task with the same name.
type TaskSubmission ¶
TaskSubmission identifies the persisted run to enqueue for execution.
type TouchConfig ¶
type TouchConfig struct {
Path string `json:"path"`
Overwrite bool `json:"overwrite"`
Content string `json:"content"`
}
TouchConfig defines the content of a touch step.
type WebShellSession ¶
type WorkerPoolMessage ¶
type WorkerPoolMessage struct {
Size int `json:"size"`
}
func (WorkerPoolMessage) Validate ¶
func (m WorkerPoolMessage) Validate() error
type WorkerPoolSizeQuery ¶
type WorkerPoolSizeQuery struct{}
WorkerPoolSizeQuery requests the currently applied pool size.