commonnetbackup

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToError

func ToError(err *APIError) error

Convert to Error.

Types

type APIError

type APIError []struct {
	PropertyName string `json:"PropertyName"`
	Message      string `json:"Message"`
}

type JobAPIResponse

type JobAPIResponse struct {
	Data struct {
		ID     int    `json:"Id,omitempty"`
		Status string `json:"Status,omitempty"`
	} `json:"data,omitempty"`
}

JobAPIResponse is the response structure for the Job API.

func (*JobAPIResponse) IsDone

func (j *JobAPIResponse) IsDone() bool

IsDone - Returns true if the job is done with a success.

func (*JobAPIResponse) Refresh

func (j *JobAPIResponse) Refresh() error

Refresh - Refreshes the job status.

func (*JobAPIResponse) Wait

func (j *JobAPIResponse) Wait(refreshInterval, timeout int) error

Wait - Waits for the job to be done refreshInterval - The interval in seconds between each refresh timeout - The timeout in seconds.

type JobStatus

type JobStatus string
const (
	JobStatusCompleted JobStatus = "Completed"
	JobStatusFailed    JobStatus = "Failed"
	JobStatusRunning   JobStatus = "Running"
	JobStatusPending   JobStatus = "Pending"
)

Jump to

Keyboard shortcuts

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