Skip to content

Commit

Permalink
api: Create Task phase enum
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Sep 23, 2022
1 parent 5e14a77 commit 1608f54
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ const (
NFTMetadataTemplateFile NFTMetadataTemplate = "file"
)

type TaskPhase string

const (
TaskPhasePending TaskPhase = "pending"
TaskPhaseWaiting TaskPhase = "waiting"
TaskPhaseRunning TaskPhase = "running"
TaskPhaseFailed TaskPhase = "failed"
TaskPhaseCompleted TaskPhase = "completed"
)

type (
// Object with all options given to Livepeer API
ClientOptions struct {
Expand Down Expand Up @@ -208,11 +218,11 @@ type (
}

TaskStatus struct {
Phase string `json:"phase"`
Progress float64 `json:"progress"`
Retries int `json:"retries,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
Phase TaskPhase `json:"phase"`
Progress float64 `json:"progress"`
Retries int `json:"retries,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
}

UploadTaskParams struct {
Expand Down

0 comments on commit 1608f54

Please sign in to comment.