Documentation
¶
Index ¶
Constants ¶
View Source
const (
Version = "0.1.6"
)
Variables ¶
View Source
var (
GitCommit string = "develop"
)
View Source
var HEARTBEAT_RATE = time.Second * 30
View Source
var LAST_HEARTBEAT_TIMEOUT = time.Minute * 5
Functions ¶
This section is empty.
Types ¶
type EachTask ¶
type Job ¶
type Job struct { ID string `json:"id,omitempty"` ParentID string `json:"parentId,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State JobState `json:"state,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` StartedAt *time.Time `json:"startedAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` FailedAt *time.Time `json:"failedAt,omitempty"` Tasks []*Task `json:"tasks"` Execution []*Task `json:"execution"` Position int `json:"position"` Inputs map[string]string `json:"inputs,omitempty"` Context JobContext `json:"context,omitempty"` TaskCount int `json:"taskCount,omitempty"` Output string `json:"output,omitempty"` Result string `json:"result,omitempty"` Error string `json:"error,omitempty"` }
type JobContext ¶
type JobContext struct { Inputs map[string]string `json:"inputs,omitempty"` Tasks map[string]string `json:"tasks,omitempty"` }
func (JobContext) AsMap ¶
func (c JobContext) AsMap() map[string]any
func (JobContext) Clone ¶
func (c JobContext) Clone() JobContext
type JobMetrics ¶ added in v0.1.5
type JobMetrics struct {
Running int `json:"running"`
}
type JobSummary ¶ added in v0.1.6
type JobSummary struct { ID string `json:"id,omitempty"` ParentID string `json:"parentId,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State JobState `json:"state,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` StartedAt *time.Time `json:"startedAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` FailedAt *time.Time `json:"failedAt,omitempty"` Position int `json:"position"` TaskCount int `json:"taskCount,omitempty"` Output string `json:"output,omitempty"` Result string `json:"result,omitempty"` Error string `json:"error,omitempty"` }
func NewJobSummary ¶ added in v0.1.6
func NewJobSummary(j *Job) *JobSummary
type Metrics ¶ added in v0.1.5
type Metrics struct { Jobs JobMetrics `json:"jobs"` Tasks TaskMetrics `json:"tasks"` Nodes NodeMetrics `json:"nodes"` }
type Node ¶
type Node struct { ID string `json:"id,omitempty"` StartedAt time.Time `json:"startedAt,omitempty"` CPUPercent float64 `json:"cpuPercent,omitempty"` LastHeartbeatAt time.Time `json:"lastHeartbeatAt,omitempty"` Queue string `json:"queue,omitempty"` Status NodeStatus `json:"status,omitempty"` Hostname string `json:"hostname,omitempty"` TaskCount int `json:"taskCount"` Version string `json:"version"` }
type NodeMetrics ¶ added in v0.1.5
type NodeStatus ¶
type NodeStatus string
const ( NodeStatusUP NodeStatus = "UP" NodeStatusDown NodeStatus = "DOWN" NodeStatusOffline NodeStatus = "OFFLINE" )
type ParallelTask ¶
type ParallelTask struct { Tasks []*Task `json:"tasks,omitempty"` Completions int `json:"completions,omitempty"` }
func (*ParallelTask) Clone ¶
func (p *ParallelTask) Clone() *ParallelTask
type SubJobTask ¶
type SubJobTask struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Tasks []*Task `json:"tasks,omitempty"` Inputs map[string]string `json:"inputs,omitempty"` Output string `json:"output,omitempty"` }
func (*SubJobTask) Clone ¶
func (s *SubJobTask) Clone() *SubJobTask
type Task ¶
type Task struct { ID string `json:"id,omitempty"` JobID string `json:"jobId,omitempty"` ParentID string `json:"parentId,omitempty"` Position int `json:"position,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State TaskState `json:"state,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` ScheduledAt *time.Time `json:"scheduledAt,omitempty"` StartedAt *time.Time `json:"startedAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` FailedAt *time.Time `json:"failedAt,omitempty"` CMD []string `json:"cmd,omitempty"` Entrypoint []string `json:"entrypoint,omitempty"` Run string `json:"run,omitempty"` Image string `json:"image,omitempty"` Env map[string]string `json:"env,omitempty"` Files map[string]string `json:"files,omitempty"` Queue string `json:"queue,omitempty"` Error string `json:"error,omitempty"` Pre []*Task `json:"pre,omitempty"` Post []*Task `json:"post,omitempty"` Volumes []string `json:"volumes,omitempty"` Networks []string `json:"networks,omitempty"` NodeID string `json:"nodeId,omitempty"` Retry *TaskRetry `json:"retry,omitempty"` Limits *TaskLimits `json:"limits,omitempty"` Timeout string `json:"timeout,omitempty"` Result string `json:"result,omitempty"` Var string `json:"var,omitempty"` If string `json:"if,omitempty"` Parallel *ParallelTask `json:"parallel,omitempty"` Each *EachTask `json:"each,omitempty"` SubJob *SubJobTask `json:"subjob,omitempty"` }
Task is the basic unit of work that a Worker can handle.
func CloneTasks ¶
type TaskLimits ¶
type TaskLimits struct { CPUs string `json:"cpus,omitempty"` Memory string `json:"memory,omitempty"` }
func (*TaskLimits) Clone ¶
func (l *TaskLimits) Clone() *TaskLimits
type TaskMetrics ¶ added in v0.1.5
type TaskMetrics struct {
Running int `json:"running"`
}
type TaskRetry ¶
Click to show internal directories.
Click to hide internal directories.