serverapp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package serverapp composes stored-data application services and transports. Local lifecycle and remote authentication live outside this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(ctx context.Context, service *contextservice.Service, store httpapi.Store, assets fs.FS, defaultID string, options ...Options) http.Handler

func Run

func Run(ctx context.Context, endpoints []Endpoint, tasks []Task, ready func()) error

Run ties HTTP listeners and background work to one foreground lifetime. All tasks must honor cancellation before returning; storage closes afterwards.

func SameOrigin

func SameOrigin(r *http.Request) bool

SameOrigin accepts HTTP and HTTPS deployments, including TLS termination.

Types

type Capabilities

type Capabilities struct {
	IngestionEnabled bool
	QueuedIngestion  bool
}

Capabilities are resolved once by the transport composition. Both admission paths accept ingestion.Request; local collection calls the service directly.

type Endpoint

type Endpoint struct {
	Server   *http.Server
	Listener net.Listener
}

type Options

type Options struct {
	Queue ingestionqueue.Queue
}

func (Options) Capabilities

func (options Options) Capabilities() Capabilities

type Task

type Task func(context.Context) error

func Prune

func Prune(prune func(time.Time) error) Task

Jump to

Keyboard shortcuts

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