Documentation
¶
Index ¶
- func New(deps *deps.Deps) *http.ServeMux
- type ClaudeClient
- func (c *ClaudeClient) ApplyPrompt(ctx context.Context, repoPath, prompt string) error
- func (c *ClaudeClient) CleanupOldSessions(maxAge time.Duration) error
- func (c *ClaudeClient) CloseSession(sessionID string) error
- func (c *ClaudeClient) CreatePR(ctx context.Context, repoPath, branchName, title, description string) error
- func (c *ClaudeClient) GetSessionStatus(sessionID string) (string, error)
- func (c *ClaudeClient) ListSessions() ([]string, error)
- func (c *ClaudeClient) ProcessPrompt(ctx context.Context, repoPath, prompt string) (string, error)
- type CreateWorkletRequest
- type DockerClient
- func (d *DockerClient) BuildAndRun(ctx context.Context, repoPath string, worklet *Worklet) (string, int, error)
- func (d *DockerClient) RemoveContainer(containerID string) error
- func (d *DockerClient) RestartContainer(containerID string) error
- func (d *DockerClient) StopContainer(containerID string) error
- type GitClient
- func (g *GitClient) CleanupOldRepos(maxAge time.Duration) error
- func (g *GitClient) CloneRepository(repoURL, branch string) (string, error)
- func (g *GitClient) CommitChanges(repoPath, message, userEmail, userName string) error
- func (g *GitClient) CreateBranch(repoPath, branchName string) error
- func (g *GitClient) GetCurrentBranch(repoPath string) (string, error)
- func (g *GitClient) GetRepoPath(repoURL, branch string) string
- func (g *GitClient) HasUncommittedChanges(repoPath string) (bool, error)
- type Manager
- func (m *Manager) CreateWorklet(ctx context.Context, req CreateWorkletRequest, userID string) (*Worklet, error)
- func (m *Manager) DeleteWorklet(workletID string) error
- func (m *Manager) GetWorklet(workletID string) (*Worklet, error)
- func (m *Manager) ListWorklets(userID string) ([]*Worklet, error)
- func (m *Manager) ProcessPrompt(ctx context.Context, workletID string, prompt string, userID string) (*WorkletPrompt, error)
- func (m *Manager) RestartWorklet(ctx context.Context, workletID string) error
- func (m *Manager) StopWorklet(workletID string) error
- type PromptRequest
- type Status
- type WebServer
- func (ws *WebServer) CleanupInactiveProxies(activeWorkletIDs []string)
- func (ws *WebServer) CreateProxy(workletID string, targetURL string) error
- func (ws *WebServer) CreateWorkletHandler(workletID string, targetPort int) http.HandlerFunc
- func (ws *WebServer) CreateWorkletPreviewHandler(workletID string, repoPath string) http.HandlerFunc
- func (ws *WebServer) GetProxy(workletID string) (*httputil.ReverseProxy, bool)
- func (ws *WebServer) GetWorkletStats(workletID string) map[string]interface{}
- func (ws *WebServer) HealthCheck(workletID string, targetURL string) error
- func (ws *WebServer) ListActiveProxies() []string
- func (ws *WebServer) RemoveProxy(workletID string)
- func (ws *WebServer) ServeWorklet(w http.ResponseWriter, r *http.Request, workletID string)
- type Worklet
- type WorkletHandler
- func (h *WorkletHandler) CreatePR(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) CreateWorklet(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) DeleteWorklet(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) GetLogs(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) GetStatus(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) GetWorklet(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) ListWorklets(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) ProcessPrompt(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) ProxyToWorklet(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) RegisterRoutes(router *mux.Router)
- func (h *WorkletHandler) RestartWorklet(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) StartWorklet(w http.ResponseWriter, r *http.Request)
- func (h *WorkletHandler) StopWorklet(w http.ResponseWriter, r *http.Request)
- type WorkletPrompt
- type WorkletResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClaudeClient ¶
type ClaudeClient struct {
// contains filtered or unexported fields
}
func NewClaudeClient ¶
func NewClaudeClient() *ClaudeClient
func (*ClaudeClient) ApplyPrompt ¶
func (c *ClaudeClient) ApplyPrompt(ctx context.Context, repoPath, prompt string) error
func (*ClaudeClient) CleanupOldSessions ¶
func (c *ClaudeClient) CleanupOldSessions(maxAge time.Duration) error
func (*ClaudeClient) CloseSession ¶
func (c *ClaudeClient) CloseSession(sessionID string) error
func (*ClaudeClient) CreatePR ¶
func (c *ClaudeClient) CreatePR(ctx context.Context, repoPath, branchName, title, description string) error
func (*ClaudeClient) GetSessionStatus ¶
func (c *ClaudeClient) GetSessionStatus(sessionID string) (string, error)
func (*ClaudeClient) ListSessions ¶
func (c *ClaudeClient) ListSessions() ([]string, error)
func (*ClaudeClient) ProcessPrompt ¶
type CreateWorkletRequest ¶
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
func NewDockerClient ¶
func NewDockerClient() *DockerClient
func (*DockerClient) BuildAndRun ¶
func (*DockerClient) RemoveContainer ¶
func (d *DockerClient) RemoveContainer(containerID string) error
func (*DockerClient) RestartContainer ¶
func (d *DockerClient) RestartContainer(containerID string) error
func (*DockerClient) StopContainer ¶
func (d *DockerClient) StopContainer(containerID string) error
type GitClient ¶
type GitClient struct {
// contains filtered or unexported fields
}
func NewGitClient ¶
func NewGitClient() *GitClient
func (*GitClient) CloneRepository ¶
func (*GitClient) CommitChanges ¶
func (*GitClient) CreateBranch ¶
func (*GitClient) GetCurrentBranch ¶
func (*GitClient) GetRepoPath ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CreateWorklet ¶
func (*Manager) DeleteWorklet ¶
func (*Manager) ProcessPrompt ¶
func (*Manager) RestartWorklet ¶
func (*Manager) StopWorklet ¶
type PromptRequest ¶
type PromptRequest struct {
Prompt string `json:"prompt" binding:"required"`
}
type WebServer ¶
type WebServer struct {
// contains filtered or unexported fields
}
func NewWebServer ¶
func NewWebServer() *WebServer
func (*WebServer) CleanupInactiveProxies ¶
func (*WebServer) CreateProxy ¶
func (*WebServer) CreateWorkletHandler ¶
func (ws *WebServer) CreateWorkletHandler(workletID string, targetPort int) http.HandlerFunc
func (*WebServer) CreateWorkletPreviewHandler ¶
func (ws *WebServer) CreateWorkletPreviewHandler(workletID string, repoPath string) http.HandlerFunc
func (*WebServer) GetProxy ¶
func (ws *WebServer) GetProxy(workletID string) (*httputil.ReverseProxy, bool)
func (*WebServer) GetWorkletStats ¶
func (*WebServer) HealthCheck ¶
func (*WebServer) ListActiveProxies ¶
func (*WebServer) RemoveProxy ¶
func (*WebServer) ServeWorklet ¶
type Worklet ¶
type Worklet struct {
models.Model
Name string `json:"name" gorm:"not null"`
Description string `json:"description"`
Status Status `json:"status" gorm:"not null"`
GitRepo string `json:"git_repo" gorm:"not null"`
Branch string `json:"branch" gorm:"not null"`
BasePrompt string `json:"base_prompt" gorm:"type:text"`
WebURL string `json:"web_url"`
Port int `json:"port"`
Environment *models.JSONField[map[string]string] `json:"environment"`
UserID string `json:"user_id" gorm:"index;not null"`
ContainerID string `json:"container_id" gorm:"index"`
SessionID string `json:"session_id" gorm:"index"`
LastPrompt string `json:"last_prompt" gorm:"type:text"`
LastError string `json:"last_error" gorm:"type:text"`
BuildLogs string `json:"build_logs" gorm:"type:text"`
User *models.User `gorm:"foreignKey:UserID"`
Container *models.Container `gorm:"foreignKey:ContainerID"`
}
func NewWorklet ¶
func NewWorklet(req CreateWorkletRequest, userID string) *Worklet
func (*Worklet) ToResponse ¶
func (w *Worklet) ToResponse() WorkletResponse
type WorkletHandler ¶
type WorkletHandler struct {
// contains filtered or unexported fields
}
func NewWorkletHandler ¶
func NewWorkletHandler(deps *deps.Deps) *WorkletHandler
func (*WorkletHandler) CreatePR ¶
func (h *WorkletHandler) CreatePR(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) CreateWorklet ¶
func (h *WorkletHandler) CreateWorklet(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) DeleteWorklet ¶
func (h *WorkletHandler) DeleteWorklet(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) GetLogs ¶
func (h *WorkletHandler) GetLogs(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) GetStatus ¶
func (h *WorkletHandler) GetStatus(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) GetWorklet ¶
func (h *WorkletHandler) GetWorklet(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) ListWorklets ¶
func (h *WorkletHandler) ListWorklets(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) ProcessPrompt ¶
func (h *WorkletHandler) ProcessPrompt(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) ProxyToWorklet ¶
func (h *WorkletHandler) ProxyToWorklet(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) RegisterRoutes ¶
func (h *WorkletHandler) RegisterRoutes(router *mux.Router)
func (*WorkletHandler) RestartWorklet ¶
func (h *WorkletHandler) RestartWorklet(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) StartWorklet ¶
func (h *WorkletHandler) StartWorklet(w http.ResponseWriter, r *http.Request)
func (*WorkletHandler) StopWorklet ¶
func (h *WorkletHandler) StopWorklet(w http.ResponseWriter, r *http.Request)
type WorkletPrompt ¶
type WorkletPrompt struct {
models.Model
WorkletID string `json:"worklet_id" gorm:"index;not null"`
Prompt string `json:"prompt" gorm:"type:text;not null"`
Response string `json:"response" gorm:"type:text"`
Status string `json:"status" gorm:"not null"`
UserID string `json:"user_id" gorm:"index;not null"`
Worklet *Worklet `gorm:"foreignKey:WorkletID"`
User *models.User `gorm:"foreignKey:UserID"`
}
type WorkletResponse ¶
type WorkletResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status Status `json:"status"`
GitRepo string `json:"git_repo"`
Branch string `json:"branch"`
WebURL string `json:"web_url"`
Port int `json:"port"`
Environment map[string]string `json:"environment"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastPrompt string `json:"last_prompt"`
LastError string `json:"last_error"`
}
Click to show internal directories.
Click to hide internal directories.