Documentation
¶
Overview ¶
Package api provides an HTTP client for the RepoSwarm API server.
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, path string, result any) error
- func (c *Client) Get(ctx context.Context, path string, result any) error
- func (c *Client) Health(ctx context.Context) (*HealthResponse, error)
- func (c *Client) Patch(ctx context.Context, path string, body any, result any) error
- func (c *Client) Post(ctx context.Context, path string, body any, result any) error
- func (c *Client) Put(ctx context.Context, path string, body any, result any) error
- type ConfigResponse
- type DiscoverResult
- type HealthResponse
- type InvestigateDailyRequest
- type InvestigateRequest
- type Prompt
- type PromptType
- type PromptVersion
- type Repository
- type ServiceInfo
- type WikiContent
- type WikiIndex
- type WikiRepoSummary
- type WikiReposResponse
- type WikiSection
- type WorkerInfo
- type WorkersResponse
- type WorkflowExecution
- type WorkflowHistory
- type WorkflowsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client talks to the RepoSwarm API server.
func (*Client) Health ¶
func (c *Client) Health(ctx context.Context) (*HealthResponse, error)
Health checks the API connection.
type ConfigResponse ¶
type ConfigResponse struct {
DefaultModel string `json:"defaultModel"`
ChunkSize int `json:"chunkSize"`
SleepDuration int `json:"sleepDuration"`
ParallelLimit int `json:"parallelLimit"`
TokenLimit int `json:"tokenLimit"`
ScheduleExpression string `json:"scheduleExpression"`
}
ConfigResponse from GET /config.
type DiscoverResult ¶
type DiscoverResult struct {
Success bool `json:"success"`
Discovered int `json:"discovered"`
Added int `json:"added"`
Skipped int `json:"skipped"`
Total int `json:"total"`
Repositories []string `json:"repositories"`
}
DiscoverResult from POST /repos/discover.
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
Version string `json:"version"`
Temporal struct {
Connected bool `json:"connected"`
Namespace string `json:"namespace"`
TaskQueue string `json:"taskQueue"`
} `json:"temporal"`
DynamoDB struct {
Connected bool `json:"connected"`
} `json:"dynamodb"`
Worker struct {
Connected bool `json:"connected"`
Count int `json:"count"`
} `json:"worker"`
}
HealthResponse from GET /health.
type InvestigateDailyRequest ¶
type InvestigateDailyRequest struct {
Model string `json:"model,omitempty"`
ChunkSize int `json:"chunk_size,omitempty"`
ParallelLimit int `json:"parallel_limit,omitempty"`
}
InvestigateDailyRequest for POST /investigate/daily.
type InvestigateRequest ¶
type InvestigateRequest struct {
RepoName string `json:"repo_name"`
Model string `json:"model"`
ChunkSize int `json:"chunk_size"`
}
InvestigateRequest for POST /investigate/single.
type Prompt ¶
type Prompt struct {
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
Template string `json:"template"`
Enabled bool `json:"enabled"`
Order int `json:"order"`
Version int `json:"version"`
Context string `json:"context,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
Prompt from GET /prompts.
type PromptType ¶
PromptType from GET /prompts/types.
type PromptVersion ¶
type PromptVersion struct {
Version int `json:"version"`
Template string `json:"template"`
CreatedAt string `json:"createdAt"`
Author string `json:"author,omitempty"`
}
PromptVersion from GET /prompts/:name/versions.
type Repository ¶
type Repository struct {
Name string `json:"name"`
URL string `json:"url"`
Source string `json:"source"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
Status string `json:"status"`
HasDocs bool `json:"hasDocs"`
}
Repository from GET /repos.
type ServiceInfo ¶
type ServiceInfo struct {
Name string `json:"name"`
PID int `json:"pid"`
Status string `json:"status"`
Uptime string `json:"uptime,omitempty"`
Port int `json:"port,omitempty"`
Manager string `json:"manager,omitempty"`
}
ServiceInfo represents a running service.
type WikiContent ¶
type WikiContent struct {
Repo string `json:"repo"`
Section string `json:"section"`
Content string `json:"content"`
CreatedAt string `json:"createdAt"`
Timestamp int64 `json:"timestamp"`
ReferenceKey string `json:"referenceKey"`
}
WikiContent from GET /wiki/:repo/:section.
type WikiIndex ¶
type WikiIndex struct {
Repo string `json:"repo"`
Sections []WikiSection `json:"sections"`
HasDocs bool `json:"hasDocs"`
}
WikiIndex from GET /wiki/:repo.
type WikiRepoSummary ¶
type WikiRepoSummary struct {
Name string `json:"name"`
SectionCount int `json:"sectionCount"`
LastUpdated string `json:"lastUpdated"`
Highlights []string `json:"highlights"`
}
WikiRepoSummary from GET /wiki.
type WikiReposResponse ¶
type WikiReposResponse struct {
Repos []WikiRepoSummary `json:"repos"`
}
WikiReposResponse from GET /wiki.
type WikiSection ¶
type WikiSection struct {
ID string `json:"id"`
StepName string `json:"stepName"`
Label string `json:"label"`
Timestamp int64 `json:"timestamp"`
CreatedAt string `json:"createdAt"`
}
WikiSection from GET /wiki/:repo.
func (WikiSection) Name ¶
func (s WikiSection) Name() string
Name returns the section identifier (prefers ID, falls back to StepName).
type WorkerInfo ¶
type WorkerInfo struct {
Name string `json:"name"`
Identity string `json:"identity"`
Status string `json:"status"`
TaskQueue string `json:"taskQueue"`
CurrentTask string `json:"currentTask,omitempty"`
LastActivity string `json:"lastActivity,omitempty"`
EnvStatus string `json:"envStatus"`
EnvErrors []string `json:"envErrors,omitempty"`
PID int `json:"pid,omitempty"`
Uptime string `json:"uptime,omitempty"`
Host string `json:"host,omitempty"`
Model string `json:"model,omitempty"`
}
WorkerInfo represents a worker's status and health.
type WorkersResponse ¶
type WorkersResponse struct {
Workers []WorkerInfo `json:"workers"`
Total int `json:"total"`
Healthy int `json:"healthy"`
}
WorkersResponse from GET /workers.
type WorkflowExecution ¶
type WorkflowExecution struct {
WorkflowID string `json:"workflowId"`
RunID string `json:"runId"`
Status string `json:"status"`
Type string `json:"type"`
StartTime string `json:"startTime"`
CloseTime string `json:"closeTime,omitempty"`
TaskQueue string `json:"taskQueue,omitempty"`
}
WorkflowExecution from GET /workflows.
type WorkflowHistory ¶
WorkflowHistory from GET /workflows/:id/history.
type WorkflowsResponse ¶
type WorkflowsResponse struct {
Executions []WorkflowExecution `json:"executions"`
NextPageToken string `json:"nextPageToken,omitempty"`
}
WorkflowsResponse from GET /workflows.