taskbridge

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskNotFound  = errors.New("task not found")
	ErrInvalidTaskID = errors.New("invalid task id")
)

Functions

This section is empty.

Types

type CancelResult

type CancelResult struct {
	Supported bool   `json:"supported"`
	Cancelled bool   `json:"cancelled"`
	Reason    string `json:"reason"`
}

type Kind

type Kind string
const (
	KindTest    Kind = "test"
	KindPackage Kind = "package"
)

type Progress

type Progress struct {
	Current int `json:"current"`
	Total   int `json:"total"`
}

type Start

type Start struct {
	Kind         Kind
	Port         int
	UnderlyingID string
	OperationID  string
	Action       string
}

type State

type State string
const (
	StateWorking       State = "working"
	StateInputRequired State = "input_required"
	StateCompleted     State = "completed"
	StateFailed        State = "failed"
	StateCancelled     State = "cancelled"
)

type Store

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

func New

func New(statusDir, projectID string) *Store

func (*Store) Cancel

func (store *Store) Cancel(taskID string) (*CancelResult, error)

func (*Store) Create

func (store *Store) Create(start Start) (*Task, error)

func (*Store) Get

func (store *Store) Get(taskID string) (*Task, error)

func (*Store) List added in v0.1.1

func (store *Store) List(port int) ([]Task, error)

func (*Store) ResultPath

func (store *Store) ResultPath(taskID string) (string, error)

type Task

type Task struct {
	ID            string          `json:"taskId"`
	Kind          Kind            `json:"kind"`
	Port          int             `json:"port"`
	UnderlyingID  string          `json:"underlyingId"`
	State         State           `json:"status"`
	StatusMessage string          `json:"statusMessage,omitempty"`
	Progress      *Progress       `json:"progress,omitempty"`
	OperationID   string          `json:"operationId,omitempty"`
	Result        json.RawMessage `json:"result,omitempty"`
	Error         *TaskError      `json:"error,omitempty"`
	CreatedAt     time.Time       `json:"createdAt"`
	UpdatedAt     time.Time       `json:"lastUpdatedAt"`
}

type TaskError

type TaskError struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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