client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoAutostartEnv disables automatic server startup when set to "1".
	NoAutostartEnv = "BOID_NO_AUTOSTART"
)

Variables

View Source
var ErrAttachDetached = errors.New("attach detached")

Functions

func DefaultSocketPath

func DefaultSocketPath() string

func EnsureRunning

func EnsureRunning(ctx context.Context) error

EnsureRunning ensures the boid server is running, starting it automatically if it is not. It uses a file lock to prevent concurrent start races.

If BOID_NO_AUTOSTART=1, auto-start is skipped and an error is returned when the server is not reachable.

Types

type Client

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

func NewUnixClient

func NewUnixClient(socketPath string) *Client

func (*Client) AnswerTask

func (c *Client) AnswerTask(taskID, questionID, answer string) error

AnswerTask submits an answer for an awaiting task via POST /api/tasks/{id}/answer.

func (*Client) ApplyAction

func (c *Client) ApplyAction(taskID string, req api.ApplyActionRequest) (*api.ActionApplication, error)

ApplyAction sends an action to POST /api/tasks/{taskID}/actions.

func (*Client) AttachJob

func (c *Client) AttachJob(jobID string, stdin io.Reader, stdout io.Writer) error

func (*Client) CreateTask

func (c *Client) CreateTask(req api.CreateTaskRequest) (*orchestrator.Task, error)

CreateTask creates a new task via POST /api/tasks.

func (*Client) DeleteTask

func (c *Client) DeleteTask(id string) error

DeleteTask deletes a task via DELETE /api/tasks/{id}.

func (*Client) Do

func (c *Client) Do(method, path string, body any, result any) error

func (*Client) DoWithContentType

func (c *Client) DoWithContentType(method, path, contentType string, body []byte, result any) error

DoWithContentType performs an HTTP request with a custom Content-Type and raw body.

func (*Client) DuplicateTask

func (c *Client) DuplicateTask(id string) (*orchestrator.Task, error)

DuplicateTask duplicates a task via POST /api/tasks/{id}/duplicate.

func (*Client) GetProject

func (c *Client) GetProject(id string) (*orchestrator.Project, error)

GetProject fetches a single project by ID via GET /api/projects/{id}.

func (*Client) GetRaw

func (c *Client) GetRaw(path string) (statusCode int, body []byte, err error)

GetRaw performs a GET request and returns the raw response body and status code.

func (*Client) GetTaskDetail

func (c *Client) GetTaskDetail(id string) (*api.TaskDetailView, error)

GetTaskDetail fetches task metadata + actions + jobs for a given task ID.

func (*Client) ListJobs

func (c *Client) ListJobs(filter api.JobListFilter) ([]api.JobWithContext, error)

ListJobs - フィルタ付きで全プロジェクト横断のジョブ一覧を取得

func (*Client) ListProjects

func (c *Client) ListProjects() ([]*orchestrator.Project, error)

ListProjects fetches all projects.

func (*Client) ListTasks

func (c *Client) ListTasks(filter TaskListFilter) ([]*orchestrator.Task, error)

ListTasks fetches tasks with optional status and project filters.

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces() ([]*orchestrator.WorkspaceSummary, error)

ListWorkspaces fetches all workspaces.

func (*Client) RerunTask

func (c *Client) RerunTask(id string, autoStart bool) (*orchestrator.Task, error)

RerunTask resets a done/aborted task to pending via POST /api/tasks/{id}/rerun.

func (*Client) ResizeJob

func (c *Client) ResizeJob(jobID string, rows, cols int) error

func (*Client) UpdateTask

func (c *Client) UpdateTask(id string, req api.UpdateTaskRequest) (*orchestrator.Task, error)

UpdateTask updates the title and description of a task via PATCH /api/tasks/{id}.

type TaskListFilter

type TaskListFilter struct {
	Status    string
	ProjectID string
}

TaskListFilter holds filters for listing tasks.

Jump to

Keyboard shortcuts

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