Documentation
¶
Index ¶
- Constants
- func ChapterBodyFromWire(chapterType string, payloadKind string, data json.RawMessage) (jobdb.ChapterBody, error)
- func ChapterBodyToWire(body jobdb.ChapterBody) (string, string, json.RawMessage, error)
- func ChapterIs(chapter jobdb.Chapter, want string) bool
- func ChapterMetadataFromJSON(raw json.RawMessage) (jobdb.ChapterMetadata, error)
- func ChapterMetadataToJSON(metadata jobdb.ChapterMetadata) (json.RawMessage, error)
- func ChapterOutcomeFromWire(payloadKind string, data json.RawMessage) (jobdb.ChapterOutcome, error)
- func ChapterOutcomeToWire(outcome jobdb.ChapterOutcome) (string, json.RawMessage, error)
- func ChapterPayload(chapter jobdb.Chapter) (string, json.RawMessage, error)
- func ChapterType(chapter jobdb.Chapter) (string, error)
- func CloneChapter(chapter jobdb.Chapter) jobdb.Chapter
- func CloneChapterBody(body jobdb.ChapterBody) jobdb.ChapterBody
- func CloneChapterMetadata(metadata jobdb.ChapterMetadata) jobdb.ChapterMetadata
- func CloneChapterOutcome(outcome jobdb.ChapterOutcome) jobdb.ChapterOutcome
- func DecodeWaitForJobs(raw []byte) ([]string, error)
- func EncodeChapter(meta ChapterMeta, chapterType string, payloadKind string, ...) ([]byte, error)
- func EncodeSchedulerPayload(payload SchedulerPayload) ([]byte, error)
- func EncodeSchedulerPayloadJSON(payload SchedulerPayload) (json.RawMessage, error)
- func EncodeWaitForJobs(jobIDs []string) ([]byte, error)
- type ChapterEnvelope
- type ChapterMeta
- type SchedulerPayload
- type TaskWait
Constants ¶
View Source
const ( EnvelopeVersion = 1 PayloadKindApp = "App" PayloadKindAppError = "AppError" PayloadKindSystemError = "SystemError" PayloadKindTimeout = "Timeout" ChapterTypeJobStart = "JobStart" ChapterTypeJobAttemptOutcome = "JobAttemptOutcome" ChapterTypeTaskAttemptOutcome = "TaskAttemptOutcome" ChapterTypeRestartExtra = "RestartExtra" )
Variables ¶
This section is empty.
Functions ¶
func ChapterBodyFromWire ¶
func ChapterBodyFromWire(chapterType string, payloadKind string, data json.RawMessage) (jobdb.ChapterBody, error)
func ChapterBodyToWire ¶
func ChapterBodyToWire(body jobdb.ChapterBody) (string, string, json.RawMessage, error)
func ChapterIs ¶
ChapterIs reports whether a typed chapter maps to the requested storage chapter discriminator.
func ChapterMetadataFromJSON ¶
func ChapterMetadataFromJSON(raw json.RawMessage) (jobdb.ChapterMetadata, error)
func ChapterMetadataToJSON ¶
func ChapterMetadataToJSON(metadata jobdb.ChapterMetadata) (json.RawMessage, error)
func ChapterOutcomeFromWire ¶
func ChapterOutcomeFromWire(payloadKind string, data json.RawMessage) (jobdb.ChapterOutcome, error)
func ChapterOutcomeToWire ¶
func ChapterOutcomeToWire(outcome jobdb.ChapterOutcome) (string, json.RawMessage, error)
func ChapterPayload ¶
ChapterPayload returns the storage payload discriminator and payload bytes for a typed chapter.
func ChapterType ¶
ChapterType returns the storage discriminator for a typed chapter.
func CloneChapterBody ¶
func CloneChapterBody(body jobdb.ChapterBody) jobdb.ChapterBody
func CloneChapterMetadata ¶
func CloneChapterMetadata(metadata jobdb.ChapterMetadata) jobdb.ChapterMetadata
func CloneChapterOutcome ¶
func CloneChapterOutcome(outcome jobdb.ChapterOutcome) jobdb.ChapterOutcome
func DecodeWaitForJobs ¶
func EncodeChapter ¶
func EncodeChapter(meta ChapterMeta, chapterType string, payloadKind string, payload json.RawMessage) ([]byte, error)
func EncodeSchedulerPayload ¶
func EncodeSchedulerPayload(payload SchedulerPayload) ([]byte, error)
func EncodeSchedulerPayloadJSON ¶
func EncodeSchedulerPayloadJSON(payload SchedulerPayload) (json.RawMessage, error)
func EncodeWaitForJobs ¶
Types ¶
type ChapterEnvelope ¶
type ChapterEnvelope struct {
ChapterType string
Meta ChapterMeta
PayloadKind string
Payload json.RawMessage
}
func DecodeChapter ¶
func DecodeChapter(body []byte) (ChapterEnvelope, error)
type ChapterMeta ¶
type ChapterMeta struct {
InitialPayloadDigest string `json:"initial_payload_digest,omitempty"`
Version int `json:"version"`
Ordinal int64 `json:"ordinal"`
TaskType string `json:"task_type"`
WorkerID string `json:"worker_id"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
InputHash string `json:"input_hash"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Input json.RawMessage `json:"input,omitempty"`
Attempt int `json:"attempt,omitempty"`
MaxAttempts int `json:"max_attempts,omitempty"`
NextAttemptAt *time.Time `json:"next_attempt_at,omitempty"`
BackoffMillis int64 `json:"backoff_ms,omitempty"`
Retryable *bool `json:"retryable,omitempty"`
InputRef *jobdb.InputReference `json:"input_ref,omitempty"`
RunPolicy *jobdb.RunPolicy `json:"run_policy,omitempty"`
Prerequisites []jobdb.JobPrerequisite `json:"prereqs,omitempty"`
}
type SchedulerPayload ¶
func DecodeSchedulerPayload ¶
func DecodeSchedulerPayload(raw []byte) (SchedulerPayload, error)
func DecodeSchedulerPayloadJSON ¶
func DecodeSchedulerPayloadJSON(raw json.RawMessage) (SchedulerPayload, error)
Click to show internal directories.
Click to hide internal directories.