app

package
v0.15.0-dev.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App = *app

func NewApp

func NewApp(page Page, o Options) App

func (App) CSP

func (a App) CSP() *common.CSP

func (App) Drain added in v0.13.6

func (a App) Drain(callback func())

func (App) Draining added in v0.13.6

func (a App) Draining() bool

func (App) InstanceCount added in v0.12.8

func (a App) InstanceCount() int

func (App) InstanceCreated added in v0.13.6

func (a App) InstanceCreated()

func (App) InstanceDeleted added in v0.13.6

func (a App) InstanceDeleted()

func (App) PathMaker

func (a App) PathMaker() path.PathMaker

func (App) RemoveSession

func (a App) RemoveSession(id string)

func (App) Resources

func (a App) Resources() resources.Registry

func (App) ServeHTTP

func (a App) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (App) SessionCount added in v0.12.8

func (a App) SessionCount() (n int)

type ErrorPage

type ErrorPage = func(r *http.Request, err error) gox.Elem

type Middleware

type Middleware = func(http.Handler) http.Handler

type Options

type Options struct {
	Conf              common.Conf
	CSP               *common.CSP
	ESBuild           func(profile string) api.BuildOptions
	SessionTracker    SessionTracker
	ID                string
	CookieName        string
	ErrorPage         ErrorPage
	Logger            *slog.Logger
	PrinterMiddleware func(next gox.Printer) gox.Printer
}

type Page

type Page = instance.Page

type SessionTracker

type SessionTracker interface {
	// Create is called when a session is created. The request is the one
	// that triggered creation; it must not be retained beyond the call,
	// and its body must not be read.
	Create(id string, r *http.Request)

	// Delete is called when a session is removed.
	Delete(id string)
}

SessionTracker is notified when sessions are created and removed.

Jump to

Keyboard shortcuts

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