app

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package app runs the application as one process: a frontend and a backend that talk to each other through the internal API over an in-process transport, exactly as two processes would over the network.

The two halves are separate packages, and the frontend cannot import the backend (see pkg/frontend/boundary_test.go), so this package is the only place that holds both. The split deployment (`serve web` and `serve api`) builds each half on its own, see the cmd package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*frontend.Frontend
	*mainbackend.Backend
	// contains filtered or unexported fields
}

Server is the application as one process. Names that both halves have are defined here, so they act on the combined process.

func New

func New(st store.Store) (*Server, error)

New builds the combined Server.

The page handlers call the backend (the internal API) through an in-process transport, and the public API is served on the same handler, without the load budget of a separate backend. The workers run in this process too, as they would in their own containers: they lease jobs from the backend through the same internal API, with a secret of their own.

func NewWithWorkers

func NewWithWorkers(st store.Store, wo builtin.Options) (*Server, error)

NewWithWorkers is New with options for the workers; tests point them at fake services.

func (*Server) Close

func (s *Server) Close()

Close stops the background jobs of both halves and the HTTPS and HTTP/3 servers. Call it after the HTTP server has been shut down.

func (*Server) SetVersion

func (s *Server) SetVersion(v string)

SetVersion sets the version both halves report.

func (*Server) WrapListener

func (s *Server) WrapListener(ln net.Listener) net.Listener

WrapListener wraps the listener of the pages.

Jump to

Keyboard shortcuts

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