Documentation
¶
Index ¶
- func ConfigureLogging()
- func GetStaticHandler() http.Handler
- func RequestLogger(next http.Handler) http.Handler
- type ArtifactResponse
- type CommentResponse
- type DependencyResponse
- type IssueResponse
- type PendingEventEntry
- type PendingResponse
- type SSEEvent
- type SSEHub
- type Server
- func (s *Server) AddPendingEvent(evt model.Event)
- func (s *Server) Bind() (net.Listener, error)
- func (s *Server) BroadcastEvent(eventType, issueID string)
- func (s *Server) DiscardPending()
- func (s *Server) GetAllEvents() ([]model.Event, error)
- func (s *Server) GetPendingCount() int
- func (s *Server) GetProjectedIssues() (map[string]*model.Issue, error)
- func (s *Server) SaveAndSync(commitMessage string) error
- func (s *Server) ServeOn(l net.Listener) error
- func (s *Server) SetupRoutes() *http.ServeMux
- func (s *Server) Start() error
- func (s *Server) WatchDB()
- func (s *Server) WatchGitRefs()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureLogging ¶
func ConfigureLogging()
ConfigureLogging sets the log package to use RFC3339 UTC timestamps, matching the format used by RequestLogger.
func GetStaticHandler ¶
GetStaticHandler returns an http.Handler for the embedded static files.
Types ¶
type ArtifactResponse ¶
type CommentResponse ¶
type DependencyResponse ¶
type IssueResponse ¶
type IssueResponse struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status"`
IsInferred bool `json:"is_inferred,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Estimate int `json:"estimate"`
Priority int `json:"priority"`
SortOrder string `json:"sort_order"`
Assignee string `json:"assignee,omitempty"`
CycleID string `json:"cycle_id,omitempty"`
EffectiveCycleID string `json:"effective_cycle_id,omitempty"`
BranchStats *model.BranchStats `json:"branch_stats,omitempty"`
Labels []string `json:"labels,omitempty"`
Dependencies []DependencyResponse `json:"dependencies,omitempty"`
Artifacts []ArtifactResponse `json:"artifacts,omitempty"`
Comments []CommentResponse `json:"comments,omitempty"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
UpdatedAt time.Time `json:"updated_at"`
IsPending bool `json:"is_pending"`
}
type PendingEventEntry ¶
type PendingResponse ¶
type PendingResponse struct {
HasPending bool `json:"has_pending"`
Events []PendingEventEntry `json:"events"`
IssueIDs []string `json:"issue_ids"`
}
type SSEHub ¶
type SSEHub struct {
// contains filtered or unexported fields
}
SSEHub manages connected SSE clients and broadcasts events.
func (*SSEHub) ClientCount ¶
ClientCount returns the number of connected clients.
type Server ¶
type Server struct {
Config *config.Config
Port int
DevMode bool
DevPort int
Headless bool
// Auth fields — nil when auth is disabled (local board mode).
NonceStore *auth.NonceStore
AuthorizedKeys *auth.AuthorizedKeys
SigningKey ed25519.PrivateKey
VerifyKey ed25519.PublicKey
// MCP handler — set externally for xpo serve mode.
MCPHandler http.Handler
// Proxy mode — when set, /api/* routes are reverse-proxied to
// the remote server with the bearer token injected.
ProxyURL string
ProxyToken string
// SSE hub for real-time event notifications.
SSEHub *SSEHub
// contains filtered or unexported fields
}
Server holds the state for the xpo web server.
func (*Server) AddPendingEvent ¶
AddPendingEvent adds an event to the pending buffer.
func (*Server) Bind ¶
Bind acquires a TCP listener on s.Port, falling back to the next free port if that one is taken. The actual port bound is written back to s.Port.
func (*Server) BroadcastEvent ¶
BroadcastEvent is the exported form of broadcastEvent for use by external callers (e.g. MCP tool handlers that need to push SSE notifications).
func (*Server) DiscardPending ¶
func (s *Server) DiscardPending()
DiscardPending clears all pending events.
func (*Server) GetAllEvents ¶
GetAllEvents returns all persisted events plus pending events. The persisted events are cached and only re-read when the database file has changed on disk.
func (*Server) GetPendingCount ¶
GetPendingCount returns the number of pending (unsaved) events.
func (*Server) GetProjectedIssues ¶
GetProjectedIssues returns all issues with pending events applied. Results are cached and recomputed only when the on-disk database or the pending-events buffer has changed.
func (*Server) SaveAndSync ¶
SaveAndSync persists pending events to storage and optionally commits to git.
func (*Server) SetupRoutes ¶
setupRoutes configures the HTTP routes for the server.
func (*Server) WatchDB ¶
func (s *Server) WatchDB()
WatchDB watches issues.db for external modifications and broadcasts an SSE event so the GUI refreshes immediately.
func (*Server) WatchGitRefs ¶
func (s *Server) WatchGitRefs()
WatchGitRefs watches .git/refs/heads/ (recursively) and .git/packed-refs for changes. When git refs change (new commit, new/deleted branch, gc), the cached issues are invalidated and an SSE update is broadcast so the GUI refreshes branch stats immediately.