Documentation
¶
Overview ¶
Package client provides an HTTP API client for the arc server. It wraps REST endpoints for projects, issues, plans, and workspace paths.
Index ¶
- type Client
- func (c *Client) AddDependency(projID, issueID, dependsOnID, depType string) error
- func (c *Client) CloseIssue(projID, id, reason string, cascade bool) (*types.Issue, error)
- func (c *Client) CreateIssue(projID string, req CreateIssueRequest) (*types.Issue, error)
- func (c *Client) CreatePlan(projID, title, content string) (*types.Plan, error)
- func (c *Client) CreateProject(name, prefix, description string) (*types.Project, error)
- func (c *Client) CreateWorkspace(projID string, req CreateWorkspaceRequest) (*types.Workspace, error)
- func (c *Client) DeleteIssue(projID, id string) error
- func (c *Client) DeletePlan(projID, planID string) error
- func (c *Client) DeleteProject(id string) error
- func (c *Client) DeleteWorkspace(projID, wsID string) error
- func (c *Client) GetBlockedIssues(projID string, limit int) ([]*types.BlockedIssue, error)
- func (c *Client) GetIssue(projID, id string) (*types.Issue, error)
- func (c *Client) GetIssueDetails(projID, id string) (*types.IssueDetails, error)
- func (c *Client) GetPlan(projID, planID string) (*types.Plan, error)
- func (c *Client) GetPlanContext(projID, issueID string) (*types.PlanContext, error)
- func (c *Client) GetPlanHistory(projID, issueID string) ([]*types.Comment, error)
- func (c *Client) GetProject(id string) (*types.Project, error)
- func (c *Client) GetProjectStats(projID string) (*types.Statistics, error)
- func (c *Client) GetReadyWork(projID string, limit int, sortPolicy string) ([]*types.Issue, error)
- func (c *Client) Health() error
- func (c *Client) LinkIssuesToPlan(projID, planID string, issueIDs []string) error
- func (c *Client) ListIssues(projID string, opts ListIssuesOptions) ([]*types.Issue, error)
- func (c *Client) ListPlans(projID string) ([]*types.Plan, error)
- func (c *Client) ListProjects() ([]*types.Project, error)
- func (c *Client) ListWorkspaces(projID string) ([]*types.Workspace, error)
- func (c *Client) MergeProjects(targetID string, sourceIDs []string) (*types.MergeResult, error)
- func (c *Client) RemoveDependency(projID, issueID, dependsOnID string) error
- func (c *Client) ResolveProjectByPath(fsPath string) (*types.ProjectResolution, error)
- func (c *Client) SetActor(actor string)
- func (c *Client) SetInlinePlan(projID, issueID, text string) (*types.Comment, error)
- func (c *Client) UnlinkIssueFromPlan(projID, planID, issueID string) error
- func (c *Client) UpdateIssue(projID, id string, updates map[string]any) (*types.Issue, error)
- func (c *Client) UpdatePlan(projID, planID, title, content string) (*types.Plan, error)
- func (c *Client) UpdateProject(id string, updates map[string]any) (*types.Project, error)
- func (c *Client) UpdateWorkspace(projID, wsID string, updates map[string]string) (*types.Workspace, error)
- type CreateIssueRequest
- type CreateWorkspaceRequest
- type ListIssuesOptions
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 HTTP API client for the arc issue tracking server. It provides methods for all CRUD operations on projects, issues, dependencies, labels, plans, and comments.
func New ¶
New creates a new API client configured to connect to the given base URL. The client defaults to a 30-second timeout and "cli" as the actor identity.
func (*Client) AddDependency ¶
AddDependency adds a dependency between two issues. depType should be one of: "blocks", "parent-child", "related", "discovered-from".
func (*Client) CloseIssue ¶
CloseIssue closes an issue. When cascade is true, open children are closed recursively. When cascade is false and the issue has open children, a *types.OpenChildrenError is returned so the caller can prompt the user.
func (*Client) CreateIssue ¶
CreateIssue creates a new issue.
func (*Client) CreatePlan ¶ added in v0.7.0
CreatePlan creates a new shared plan.
func (*Client) CreateProject ¶ added in v0.12.0
CreateProject creates a new project.
func (*Client) CreateWorkspace ¶
func (c *Client) CreateWorkspace(projID string, req CreateWorkspaceRequest) (*types.Workspace, error)
CreateWorkspace registers a new workspace (directory path) for a project.
func (*Client) DeleteIssue ¶
DeleteIssue deletes an issue.
func (*Client) DeletePlan ¶ added in v0.7.0
DeletePlan deletes a shared plan.
func (*Client) DeleteProject ¶ added in v0.12.0
DeleteProject deletes a project.
func (*Client) DeleteWorkspace ¶
DeleteWorkspace removes a workspace (directory path) from a project.
func (*Client) GetBlockedIssues ¶
GetBlockedIssues returns blocked issues.
func (*Client) GetIssueDetails ¶
func (c *Client) GetIssueDetails(projID, id string) (*types.IssueDetails, error)
GetIssueDetails retrieves an issue with all relational data.
func (*Client) GetPlanContext ¶ added in v0.7.0
func (c *Client) GetPlanContext(projID, issueID string) (*types.PlanContext, error)
GetPlanContext returns the plan context for an issue.
func (*Client) GetPlanHistory ¶ added in v0.7.0
GetPlanHistory returns the plan version history for an issue.
func (*Client) GetProject ¶ added in v0.12.0
GetProject retrieves a project by ID.
func (*Client) GetProjectStats ¶ added in v0.12.0
func (c *Client) GetProjectStats(projID string) (*types.Statistics, error)
GetProjectStats returns project statistics.
func (*Client) GetReadyWork ¶
GetReadyWork returns issues ready to work on. sortPolicy can be: "hybrid" (default), "priority", or "oldest".
func (*Client) LinkIssuesToPlan ¶ added in v0.7.0
LinkIssuesToPlan links one or more issues to a plan.
func (*Client) ListIssues ¶
ListIssues returns issues for a project.
func (*Client) ListProjects ¶ added in v0.12.0
ListProjects returns all projects.
func (*Client) ListWorkspaces ¶
ListWorkspaces returns all workspaces (directory paths) for a project.
func (*Client) MergeProjects ¶ added in v0.12.0
MergeProjects merges one or more source projects into a target project.
func (*Client) RemoveDependency ¶
RemoveDependency removes a dependency between two issues.
func (*Client) ResolveProjectByPath ¶ added in v0.12.0
func (c *Client) ResolveProjectByPath(fsPath string) (*types.ProjectResolution, error)
ResolveProjectByPath finds the project associated with a filesystem path.
func (*Client) SetActor ¶
SetActor sets the actor identity sent via the X-Actor header on all requests.
func (*Client) SetInlinePlan ¶ added in v0.7.0
SetInlinePlan sets or updates an inline plan on an issue.
func (*Client) UnlinkIssueFromPlan ¶ added in v0.7.0
UnlinkIssueFromPlan removes a link between an issue and a plan.
func (*Client) UpdateIssue ¶
UpdateIssue updates an issue.
func (*Client) UpdatePlan ¶ added in v0.7.0
UpdatePlan updates a shared plan.
func (*Client) UpdateProject ¶ added in v0.12.0
UpdateProject updates a project.
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 CreateWorkspaceRequest ¶ added in v0.12.0
type CreateWorkspaceRequest struct {
Path string `json:"path"`
Label string `json:"label,omitempty"`
Hostname string `json:"hostname,omitempty"`
GitRemote string `json:"git_remote,omitempty"`
PathType string `json:"path_type,omitempty"`
}
CreateWorkspaceRequest is the request for registering a workspace (directory path).
type ListIssuesOptions ¶
type ListIssuesOptions struct {
Status string // Filter by status (e.g., "open", "closed")
Type string // Filter by issue type (e.g., "bug", "feature")
Assignee string // Filter by assignee name
Query string // Full-text search in title/description
Limit int // Maximum number of results
Parent string // Filter by parent issue ID
}
ListIssuesOptions configures issue listing. All fields are optional; zero values are omitted from the query.