Help us shape the future of Go! Take the 2026 Go Developer Survey

handlers

package
v0.17.14 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchDiffHandler

type BranchDiffHandler struct {
	// contains filtered or unexported fields
}

BranchDiffHandler serves raw branch patch diffs.

func NewBranchDiffHandler

func NewBranchDiffHandler(eng engine.BranchReader) *BranchDiffHandler

NewBranchDiffHandler creates a handler for /api/branch-diff and /api/v1/branch-diff.

func (*BranchDiffHandler) ServeHTTP

func (h *BranchDiffHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles GET branch diff endpoint.

type BranchesHandler

type BranchesHandler struct {
	// contains filtered or unexported fields
}

BranchesHandler serves branch data.

func NewBranchesHandler

func NewBranchesHandler(eng engine.BranchReader, gh github.Client) *BranchesHandler

NewBranchesHandler creates a handler for /api/branches and /api/v1/branches.

func (*BranchesHandler) ServeHTTP

func (h *BranchesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles GET branches endpoints.

type EventBroadcaster

type EventBroadcaster struct {
	// contains filtered or unexported fields
}

EventBroadcaster manages SSE connections and broadcasts events.

func NewEventBroadcaster

func NewEventBroadcaster() *EventBroadcaster

NewEventBroadcaster creates a new SSE event broadcaster.

func (*EventBroadcaster) Broadcast

func (b *EventBroadcaster) Broadcast(event, data string)

Broadcast sends an SSE event to all connected clients.

func (*EventBroadcaster) Close

func (b *EventBroadcaster) Close()

Close notifies all subscribers to exit and prevents future broadcasts. It closes every active client channel so SSE handlers blocked on a receive unblock promptly and graceful HTTP shutdown can complete.

func (*EventBroadcaster) Done

func (b *EventBroadcaster) Done() <-chan struct{}

Done returns a channel that closes when the broadcaster is shutting down.

type EventsHandler

type EventsHandler struct {
	// contains filtered or unexported fields
}

EventsHandler serves the SSE stream at GET /api/events and /api/v1/events.

func NewEventsHandler

func NewEventsHandler(broadcaster *EventBroadcaster) *EventsHandler

NewEventsHandler creates a handler for events endpoints.

func (*EventsHandler) ServeHTTP

func (h *EventsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles the SSE connection.

type RepoHandler

type RepoHandler struct {
	// contains filtered or unexported fields
}

RepoHandler serves repository metadata.

func NewRepoHandler

func NewRepoHandler(eng engine.BranchReader, gh github.Client, remote string) *RepoHandler

NewRepoHandler creates a handler for /api/repo and /api/v1/repo.

func (*RepoHandler) ServeHTTP

func (h *RepoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles GET repo endpoints.

type StacksHandler

type StacksHandler struct {
	// contains filtered or unexported fields
}

StacksHandler serves stack data.

func NewStacksHandler

func NewStacksHandler(eng engine.BranchReader, gh github.Client) *StacksHandler

NewStacksHandler creates a handler for /api/stacks and /api/v1/stacks.

func (*StacksHandler) ServeHTTP

func (h *StacksHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles GET stacks endpoints.

type SubmitHandler

type SubmitHandler struct {
	// contains filtered or unexported fields
}

SubmitHandler handles POST requests to submit a stack.

func NewSubmitHandler

func NewSubmitHandler(eng engine.Engine, gh github.Client, repoRoot string) *SubmitHandler

NewSubmitHandler creates a handler for /api/stacks/{rootBranch}/submit.

func (*SubmitHandler) ServeHTTP

func (h *SubmitHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles the submit request.

type ViewAssembler

type ViewAssembler struct {
	// contains filtered or unexported fields
}

ViewAssembler builds the combined /view payload.

func NewViewAssembler

func NewViewAssembler(eng engine.BranchReader, gh github.Client, remote string) *ViewAssembler

func (*ViewAssembler) Build

type ViewHandler

type ViewHandler struct {
	// contains filtered or unexported fields
}

ViewHandler serves the combined view payload for the frontend.

func NewViewHandler

func NewViewHandler(eng engine.BranchReader, gh github.Client, remote string) *ViewHandler

NewViewHandler creates a handler for /api/view and /api/v1/view. Assembly logic lives in ViewAssembler to keep this handler transport-focused.

func (*ViewHandler) ServeHTTP

func (h *ViewHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles GET view endpoints.

Jump to

Keyboard shortcuts

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