models

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobActionRequest

type JobActionRequest struct {
	Action string `json:"action"`
}

JobActionRequest defines for triggering job action like stop/cancel.

type JobData

type JobData struct {
	Name       string       `json:"name"`
	Parameters Parameters   `json:"parameters"`
	Metadata   *JobMetadata `json:"metadata"`
	StatusHook string       `json:"status_hook"`
}

JobData keeps the basic info.

type JobMetadata

type JobMetadata struct {
	JobKind       string `json:"kind"`
	ScheduleDelay uint64 `json:"schedule_delay,omitempty"`
	Cron          string `json:"cron_spec,omitempty"`
	IsUnique      bool   `json:"unique"`
}

JobMetadata stores the metadata of job.

type JobPoolStats

type JobPoolStats struct {
	Pools []*JobPoolStatsData `json:"worker_pools"`
}

JobPoolStats represents the healthy and status of all the running worker pools.

type JobPoolStatsData

type JobPoolStatsData struct {
	WorkerPoolID string   `json:"worker_pool_id"`
	StartedAt    int64    `json:"started_at"`
	HeartbeatAt  int64    `json:"heartbeat_at"`
	JobNames     []string `json:"job_names"`
	Concurrency  uint     `json:"concurrency"`
	Status       string   `json:"status"`
}

JobPoolStatsData represent the healthy and status of the worker worker.

type JobRequest

type JobRequest struct {
	Job *JobData `json:"job"`
}

JobRequest is the request of launching a job.

type JobStats

type JobStats struct {
	Stats *StatsInfo `json:"job"`
}

JobStats keeps the result of job launching.

type JobStatusChange

type JobStatusChange struct {
	JobID    string     `json:"job_id"`
	Status   string     `json:"status"`
	CheckIn  string     `json:"check_in,omitempty"`
	Metadata *StatsInfo `json:"metadata,omitempty"`
}

JobStatusChange is designed for reporting the status change via hook.

type Message

type Message struct {
	Event string
	Data  interface{} // generic format
}

Message is designed for sub/pub messages

type Parameters

type Parameters map[string]interface{}

Parameters for job execution.

type StatsInfo added in v1.8.0

type StatsInfo struct {
	JobID         string     `json:"id"`
	Status        string     `json:"status"`
	JobName       string     `json:"name"`
	JobKind       string     `json:"kind"`
	IsUnique      bool       `json:"unique"`
	RefLink       string     `json:"ref_link,omitempty"`
	CronSpec      string     `json:"cron_spec,omitempty"`
	EnqueueTime   int64      `json:"enqueue_time"`
	UpdateTime    int64      `json:"update_time"`
	RunAt         int64      `json:"run_at,omitempty"`
	CheckIn       string     `json:"check_in,omitempty"`
	CheckInAt     int64      `json:"check_in_at,omitempty"`
	DieAt         int64      `json:"die_at,omitempty"`
	WebHookURL    string     `json:"web_hook_url,omitempty"`
	UpstreamJobID string     `json:"upstream_job_id,omitempty"`   // Ref the upstream job if existing
	NumericPID    int64      `json:"numeric_policy_id,omitempty"` // The numeric policy ID of the periodic job
	Parameters    Parameters `json:"parameters,omitempty"`
}

StatsInfo keeps the stats of job

Jump to

Keyboard shortcuts

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