job

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddSubtaskEvent added in v0.17.0

func AddSubtaskEvent(cfg *target.BaseTargetConfig, jobID, jobType, subtask string, status JobStatus, receivedDate *int64)

func AddTaskEvent added in v0.17.0

func AddTaskEvent(cfg *target.BaseTargetConfig, jobID, jobType string, status JobStatus)

func StartJob

func StartJob(cfg *target.BaseTargetConfig) (string, error)

func UpdateJobEvent added in v0.17.0

func UpdateJobEvent(cfg *target.BaseTargetConfig, jobID string, status JobStatus, inputErr error)

Types

type Job

type Job struct {
	JobID *string `json:"jobId"`
}

type JobStatus added in v0.16.0

type JobStatus int
const (
	Started JobStatus = iota
	InProgress
	DataRetrieve
	DataUpload
	Queued
	DataProcessing
	Completed
	Failed
	Skipped
)

func (JobStatus) IsRunning added in v0.16.0

func (e JobStatus) IsRunning() bool

func (JobStatus) IsValid added in v0.16.0

func (e JobStatus) IsValid() bool

func (JobStatus) MarshalJSON added in v0.16.0

func (e JobStatus) MarshalJSON() ([]byte, error)

func (JobStatus) String added in v0.16.0

func (e JobStatus) String() string

func (*JobStatus) UnmarshalJSON added in v0.16.0

func (e *JobStatus) UnmarshalJSON(b []byte) error

type Response

type Response struct {
	Job Job `json:"createJob"`
}

type Subtask added in v0.17.0

type Subtask struct {
	JobID      string      `json:"jobId"`
	JobType    string      `json:"jobType"`
	SubtaskId  string      `json:"subtaskId"`
	Status     JobStatus   `json:"status"`
	LastUpdate time.Time   `json:"lastUpdate"`
	Result     interface{} `json:"result"`
	Errors     []string    `json:"errors"`
}

func GetSubtask added in v0.17.0

func GetSubtask(cfg *target.BaseTargetConfig, jobID, jobType, subtaskId string, responseResult interface{}) (*Subtask, error)

func WaitForJobToComplete added in v0.22.0

func WaitForJobToComplete(jobID string, syncType string, subtaskId string, syncResult interface{}, cfg *target.BaseTargetConfig, currentStatus JobStatus) (*Subtask, error)

type SubtaskEventUpdater added in v0.19.0

type SubtaskEventUpdater interface {
	AddSubtaskEvent(status JobStatus)
	SetReceivedDate(receivedDate int64)
}

type SubtaskResponse added in v0.17.0

type SubtaskResponse struct {
	SubtaskResponse Subtask `json:"jobSubtask"`
}

type Task added in v0.16.0

type Task interface {
	IsClientValid(ctx context.Context, c plugin.PluginClient) (bool, error)
	GetParts() []TaskPart
}

type TaskEventUpdater added in v0.19.0

type TaskEventUpdater interface {
	AddTaskEvent(status JobStatus)
	GetSubtaskEventUpdater(subtask string) SubtaskEventUpdater
}

func NewTaskEventUpdater added in v0.20.0

func NewTaskEventUpdater(cfg *target.BaseTargetConfig, jobId, jobType string) TaskEventUpdater

type TaskPart added in v0.20.0

type TaskPart interface {
	StartSyncAndQueueTaskPart(c plugin.PluginClient, statusUpdater TaskEventUpdater) (JobStatus, string, error)
	ProcessResults(results interface{}) error
	GetResultObject() interface{}
}

Jump to

Keyboard shortcuts

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