client

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package client provides an API client for the arc server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the API client for arc.

func New

func New(baseURL string) *Client

New creates a new API client.

func (*Client) AddDependency

func (c *Client) AddDependency(wsID, issueID, dependsOnID, depType string) error

AddDependency adds a dependency.

func (*Client) CloseIssue

func (c *Client) CloseIssue(wsID, id, reason string) (*types.Issue, error)

CloseIssue closes an issue.

func (*Client) CreateIssue

func (c *Client) CreateIssue(wsID string, req CreateIssueRequest) (*types.Issue, error)

CreateIssue creates a new issue.

func (*Client) CreatePlan added in v0.7.0

func (c *Client) CreatePlan(wsID, title, content string) (*types.Plan, error)

CreatePlan creates a new shared plan.

func (*Client) CreateWorkspace

func (c *Client) CreateWorkspace(name, prefix, path, description string) (*types.Workspace, error)

CreateWorkspace creates a new workspace.

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(wsID, id string) error

DeleteIssue deletes an issue.

func (*Client) DeletePlan added in v0.7.0

func (c *Client) DeletePlan(wsID, planID string) error

DeletePlan deletes a shared plan.

func (*Client) DeleteWorkspace

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

DeleteWorkspace deletes a workspace.

func (*Client) GetBlockedIssues

func (c *Client) GetBlockedIssues(wsID string, limit int) ([]*types.BlockedIssue, error)

GetBlockedIssues returns blocked issues.

func (*Client) GetIssue

func (c *Client) GetIssue(wsID, id string) (*types.Issue, error)

GetIssue retrieves an issue by ID.

func (*Client) GetIssueDetails

func (c *Client) GetIssueDetails(wsID, id string) (*types.IssueDetails, error)

GetIssueDetails retrieves an issue with all relational data.

func (*Client) GetPlan added in v0.7.0

func (c *Client) GetPlan(wsID, planID string) (*types.Plan, error)

GetPlan retrieves a plan by ID.

func (*Client) GetPlanContext added in v0.7.0

func (c *Client) GetPlanContext(wsID, issueID string) (*types.PlanContext, error)

GetPlanContext returns the plan context for an issue.

func (*Client) GetPlanHistory added in v0.7.0

func (c *Client) GetPlanHistory(wsID, issueID string) ([]*types.Comment, error)

GetPlanHistory returns the plan version history for an issue.

func (*Client) GetReadyWork

func (c *Client) GetReadyWork(wsID string, limit int, sortPolicy string) ([]*types.Issue, error)

GetReadyWork returns issues ready to work on. sortPolicy can be: "hybrid" (default), "priority", or "oldest".

func (*Client) GetStatistics

func (c *Client) GetStatistics(wsID string) (*types.Statistics, error)

GetStatistics returns workspace statistics.

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(id string) (*types.Workspace, error)

GetWorkspace retrieves a workspace by ID.

func (*Client) Health

func (c *Client) Health() error

Health checks the server health.

func (*Client) LinkIssuesToPlan added in v0.7.0

func (c *Client) LinkIssuesToPlan(wsID, planID string, issueIDs []string) error

LinkIssuesToPlan links one or more issues to a plan.

func (*Client) ListIssues

func (c *Client) ListIssues(wsID string, opts ListIssuesOptions) ([]*types.Issue, error)

ListIssues returns issues for a workspace.

func (*Client) ListPlans added in v0.7.0

func (c *Client) ListPlans(wsID string) ([]*types.Plan, error)

ListPlans returns all shared plans in a workspace.

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces() ([]*types.Workspace, error)

ListWorkspaces returns all workspaces.

func (*Client) RemoveDependency

func (c *Client) RemoveDependency(wsID, issueID, dependsOnID string) error

RemoveDependency removes a dependency.

func (*Client) SetActor

func (c *Client) SetActor(actor string)

SetActor sets the actor for API requests.

func (*Client) SetInlinePlan added in v0.7.0

func (c *Client) SetInlinePlan(wsID, issueID, text string) (*types.Comment, error)

SetInlinePlan sets or updates an inline plan on an issue.

func (*Client) UnlinkIssueFromPlan added in v0.7.0

func (c *Client) UnlinkIssueFromPlan(wsID, planID, issueID string) error

UnlinkIssueFromPlan removes a link between an issue and a plan.

func (*Client) UpdateIssue

func (c *Client) UpdateIssue(wsID, id string, updates map[string]interface{}) (*types.Issue, error)

UpdateIssue updates an issue.

func (*Client) UpdatePlan added in v0.7.0

func (c *Client) UpdatePlan(wsID, planID, title, content string) (*types.Plan, error)

UpdatePlan updates a shared plan.

type CreateIssueRequest

type CreateIssueRequest struct {
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Priority    int    `json:"priority,omitempty"`
	IssueType   string `json:"issue_type,omitempty"`
	Assignee    string `json:"assignee,omitempty"`
	ParentID    string `json:"parent_id,omitempty"` // For hierarchical child IDs
}

CreateIssueRequest is the request for creating an issue.

type ListIssuesOptions

type ListIssuesOptions struct {
	Status   string
	Type     string
	Assignee string
	Query    string
	Limit    int
}

ListIssuesOptions configures issue listing.

Jump to

Keyboard shortcuts

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