server

package
v0.54.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package server provides HTTP handlers for status, queue, and inbox endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCompletedHandler

func NewCompletedHandler(checker status.Checker) libhttp.WithError

NewCompletedHandler creates a handler for the /api/v1/completed endpoint.

func NewHealthHandler

func NewHealthHandler() libhttp.WithError

NewHealthHandler creates a handler for the /health endpoint.

func NewInboxHandler

func NewInboxHandler(inboxDir string) libhttp.WithError

NewInboxHandler creates a handler for the /api/v1/inbox endpoint.

func NewQueueActionHandler

func NewQueueActionHandler(
	inboxDir string,
	queueDir string,
	promptManager prompt.Manager,
	currentDateTimeGetter libtime.CurrentDateTimeGetter,
) libhttp.WithError

NewQueueActionHandler creates a handler for POST /api/v1/queue endpoints.

func NewQueueHandler

func NewQueueHandler(checker status.Checker) libhttp.WithError

NewQueueHandler creates a handler for the /api/v1/queue endpoint.

func NewStatusHandler

func NewStatusHandler(checker status.Checker) libhttp.WithError

NewStatusHandler creates a handler for the /api/v1/status endpoint.

Types

type InboxFile

type InboxFile struct {
	Name string `json:"name"`
}

InboxFile represents a file in the inbox directory.

type InboxListResponse

type InboxListResponse struct {
	Files []InboxFile `json:"files"`
}

InboxListResponse represents the response for GET /api/v1/inbox.

type QueueRequest

type QueueRequest struct {
	File string `json:"file"`
}

QueueRequest represents the request body for POST /api/v1/queue.

type QueueResponse

type QueueResponse struct {
	Queued []QueuedFile `json:"queued"`
}

QueueResponse represents the response for POST /api/v1/queue.

type QueuedFile

type QueuedFile struct {
	Old string `json:"old"`
	New string `json:"new"`
}

QueuedFile represents a single queued file.

type Server

type Server interface {
	ListenAndServe(ctx context.Context) error
}

Server provides HTTP endpoints for status and monitoring.

func NewServer

func NewServer(runFunc run.Func) Server

NewServer creates a new Server from a run.Func (typically from libhttp.NewServer).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL