Documentation
¶
Overview ¶
Package server provides HTTP handlers for status, queue, and inbox endpoints.
Index ¶
- func NewCompletedHandler(checker status.Checker) libhttp.WithError
- func NewHealthHandler() libhttp.WithError
- func NewInboxHandler(inboxDir string) libhttp.WithError
- func NewQueueActionHandler(inboxDir string, queueDir string, promptManager PromptManager) libhttp.WithError
- func NewQueueHandler(checker status.Checker) libhttp.WithError
- func NewStatusHandler(checker status.Checker) libhttp.WithError
- type InboxFile
- type InboxListResponse
- type PromptManager
- type QueueRequest
- type QueueResponse
- type QueuedFile
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompletedHandler ¶
NewCompletedHandler creates a handler for the /api/v1/completed endpoint.
func NewHealthHandler ¶
NewHealthHandler creates a handler for the /health endpoint.
func NewInboxHandler ¶ added in v0.10.0
NewInboxHandler creates a handler for the /api/v1/inbox endpoint.
func NewQueueActionHandler ¶ added in v0.10.0
func NewQueueActionHandler( inboxDir string, queueDir string, promptManager PromptManager, ) libhttp.WithError
NewQueueActionHandler creates a handler for POST /api/v1/queue endpoints.
func NewQueueHandler ¶
NewQueueHandler creates a handler for the /api/v1/queue endpoint.
Types ¶
type InboxFile ¶ added in v0.10.0
type InboxFile struct {
Name string `json:"name"`
}
InboxFile represents a file in the inbox directory.
type InboxListResponse ¶ added in v0.10.0
type InboxListResponse struct {
Files []InboxFile `json:"files"`
}
InboxListResponse represents the response for GET /api/v1/inbox.
type PromptManager ¶ added in v0.119.2
type PromptManager interface {
Load(ctx context.Context, path string) (*prompt.PromptFile, error)
NormalizeFilenames(ctx context.Context, dir string) ([]prompt.Rename, error)
}
PromptManager is the subset of prompt.Manager that the server package uses.
type QueueRequest ¶ added in v0.10.0
type QueueRequest struct {
File string `json:"file"`
}
QueueRequest represents the request body for POST /api/v1/queue.
type QueueResponse ¶ added in v0.10.0
type QueueResponse struct {
Queued []QueuedFile `json:"queued"`
}
QueueResponse represents the response for POST /api/v1/queue.
type QueuedFile ¶ added in v0.10.0
QueuedFile represents a single queued file.