Documentation
¶
Index ¶
- type ClaimResponse
- type Handlers
- func (h *Handlers) ClaimTicket(ticketID string, shemID uint) (*ClaimResponse, error)
- func (h *Handlers) RegisterHumanRoutes(mux *http.ServeMux)
- func (h *Handlers) RegisterLogRoutes(mux *http.ServeMux)
- func (h *Handlers) RegisterShemRoutes(mux *http.ServeMux)
- func (h *Handlers) RegisterTicketRoutes(mux *http.ServeMux)
- func (h *Handlers) ReviseClaim(ticketID string, shemID uint) (*ClaimResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimResponse ¶
type ClaimResponse struct {
TicketID string `json:"ticket_id"`
Branch string `json:"branch"`
Title string `json:"title"`
RepoRemote string `json:"repo_remote"`
Description string `json:"description"`
CheckpointPhase *string `json:"checkpoint_phase"`
CheckpointSHA *string `json:"checkpoint_sha"`
LogEntries []db.LogEntry `json:"log_entries"`
}
ClaimResponse is returned by a successful ticket claim.
type Handlers ¶
type Handlers struct {
DB *gorm.DB
Hub *ws.Hub
Broker *sse.Broker
LogEntryHTML func(sse.LogEntryEvent) string // renders a log entry to HTML for SSE; nil = send JSON
}
Handlers holds the shared dependencies for all API handlers.
func NewHandlers ¶
NewHandlers creates a Handlers with the given dependencies.
func (*Handlers) ClaimTicket ¶
func (h *Handlers) ClaimTicket(ticketID string, shemID uint) (*ClaimResponse, error)
ClaimTicket atomically claims a ticket for shemID. Exactly one concurrent caller wins; all others receive a non-nil error.
func (*Handlers) RegisterHumanRoutes ¶
RegisterHumanRoutes adds human-input management and ticket action routes to mux.
func (*Handlers) RegisterLogRoutes ¶
RegisterLogRoutes adds log-ingestion and SSE streaming routes to mux.
func (*Handlers) RegisterShemRoutes ¶
RegisterShemRoutes adds shem-facing routes to mux.
func (*Handlers) RegisterTicketRoutes ¶
RegisterTicketRoutes adds ticket-related routes to mux.
func (*Handlers) ReviseClaim ¶
func (h *Handlers) ReviseClaim(ticketID string, shemID uint) (*ClaimResponse, error)
ReviseClaim resumes a ticket already assigned to shemID that is in the revising phase. Unlike ClaimTicket it does not change phase or assigned_shem — the ticket is already owned by this shem.