tasks

package
v1.6.0-epsilon Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

User API tasks interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetRequest

type GetRequest struct {
	// ID of audit
	// Required: true
	AuditID string `url:"auditId" json:"auditId" validate:"required"`
}

Request struct for get infromation about task

type ItemAsyncTask added in v1.5.0

type ItemAsyncTask struct {
	// Audit ID
	AuditID string `json:"auditId"`

	// Completed
	Completed bool `json:"completed"`

	// Error
	Error string `json:"error"`

	// List of logs
	Log []string `json:"log"`

	// Final result
	Result TaskResult `json:"result"`

	// Stage
	Stage string `json:"stage"`

	// Status
	Status string `json:"status"`

	// Update time
	UpdateTime uint64 `json:"updateTime"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`
}

Detailed information about task

type ListRequest

type ListRequest struct {
	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

Request struct for get list of tasks

type ListTasks

type ListTasks struct {
	Data []ItemAsyncTask `json:"data"`

	EntryCount uint64 `json:"entryCount"`
}

List of tasks

type RecordAsyncTask

type RecordAsyncTask struct {
	// Audit ID
	AuditID string `json:"auditId"`

	// Completed
	Completed bool `json:"completed"`

	// Error
	Error string `json:"error"`

	// List of logs
	Log []string `json:"log"`

	// Final result
	Result TaskResult `json:"result"`

	// Stage
	Stage string `json:"stage"`

	// Status
	Status string `json:"status"`

	// Update time
	UpdateTime uint64 `json:"updateTime"`

	// Updated by
	UpdatedBy string `json:"updatedBy"`

	// Updated time
	UpdatedTime uint64 `json:"updatedTime"`
}

Detailed information about task

type TaskResult

type TaskResult int

Global variable for converting field to desired data type

func (*TaskResult) UnmarshalJSON

func (r *TaskResult) UnmarshalJSON(b []byte) error

Method for convert field

type Tasks

type Tasks struct {
	// contains filtered or unexported fields
}

Structure for creating request to tasks

func New

func New(client interfaces.Caller) *Tasks

Builder for tasks endpoints

func (Tasks) Get

func (t Tasks) Get(ctx context.Context, req GetRequest) (*RecordAsyncTask, error)

Get gets background API task status and result

func (Tasks) List

func (t Tasks) List(ctx context.Context, req ListRequest) (*ListTasks, error)

List gets list user API tasks with status PROCESSING

Jump to

Keyboard shortcuts

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