job

package
v0.65.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddSubtaskEvent added in v0.17.0

func AddSubtaskEvent(ctx context.Context, cfg *types.BaseTargetConfig, jobID, jobType, subtask string, status JobStatus, receivedDate *int64)

func AddTaskEvent added in v0.17.0

func AddTaskEvent(ctx context.Context, cfg *types.BaseTargetConfig, jobID, jobType string, status JobStatus, taskResults []TaskResult, warnings []string, errors []error)

func StartJob

func StartJob(ctx context.Context, cfg *types.BaseTargetConfig) (string, error)

func UpdateJobEvent added in v0.17.0

func UpdateJobEvent(cfg *types.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
	TimeOut
)

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(ctx context.Context, cfg *types.BaseTargetConfig, jobID, jobType, subtaskId string, responseResult interface{}) (*Subtask, error)

func WaitForJobToComplete added in v0.22.0

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

type SubtaskEventUpdater added in v0.19.0

type SubtaskEventUpdater interface {
	AddSubtaskEvent(ctx context.Context, 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
	GetTaskResults() []TaskResult
}

type TaskEventUpdater added in v0.19.0

type TaskEventUpdater interface {
	SetStatusToStarted(ctx context.Context)
	SetStatusToDataRetrieve(ctx context.Context)
	SetStatusToDataUpload(ctx context.Context)
	SetStatusToQueued(ctx context.Context)
	SetStatusToDataProcessing(ctx context.Context)
	SetStatusToCompleted(ctx context.Context, results []TaskResult)
	SetStatusToFailed(ctx context.Context, err error)
	SetStatusToSkipped(ctx context.Context)

	GetSubtaskEventUpdater(subtask string) SubtaskEventUpdater
}

func NewTaskEventUpdater added in v0.20.0

func NewTaskEventUpdater(cfg *types.BaseTargetConfig, jobId, jobType string, warningCollector logging.WarningCollector) TaskEventUpdater

type TaskPart added in v0.20.0

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

type TaskResult added in v0.38.0

type TaskResult struct {
	ObjectType string `json:"objectType"`
	Added      int    `json:"added"`
	Updated    int    `json:"updated"`
	Removed    int    `json:"removed"`
	Failed     int    `json:"failed"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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