router

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const ZombieHeader = "Zombie"

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorPageComponent

type ErrorPageComponent = func(location path.Location, err error) gox.Comp

type Route

type Route interface {
	Match(r *http.Request) bool
	Serve(w http.ResponseWriter, r *http.Request)
}

type Router

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

func NewRouter

func NewRouter() (router *Router)

func (*Router) Adapters

func (rr *Router) Adapters() path.Adapters

func (*Router) BuildProfiles

func (rr *Router) BuildProfiles() resources.BuildProfiles

func (*Router) CSP

func (rr *Router) CSP() *common.CSP

func (*Router) Conf

func (rr *Router) Conf() *common.SystemConf

func (*Router) Count

func (rr *Router) Count() (int, int)

func (*Router) License

func (rr *Router) License() string

func (*Router) PathMaker

func (rr *Router) PathMaker() path.PathMaker

func (*Router) RemoveSession

func (rr *Router) RemoveSession(id string)

func (*Router) ResourceRegistry

func (rr *Router) ResourceRegistry() *resources.Registry

func (*Router) ServeHTTP

func (rr *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Router) SessionCookie

func (rr *Router) SessionCookie() string

func (*Router) Use

func (rr *Router) Use(use Use)

type SessionCallback

type SessionCallback interface {
	// Create is called when a session is created.
	Create(id string, header http.Header)
	// Delete is called when a session is removed.
	Delete(id string)
}

SessionCallback observes session creation and removal.

type Use

type Use interface {
	// contains filtered or unexported methods
}

Use mutates a Router during setup.

func UseCSP

func UseCSP(csp *common.CSP) Use

UseCSP stores the Content Security Policy used for responses.

func UseESConf

func UseESConf(profiles resources.BuildProfiles) Use

UseESConf stores the esbuild profiles used for imports.

func UseErrorPage

func UseErrorPage(page ErrorPageComponent) Use

UseErrorPage stores the page used for framework errors.

func UseFallback

func UseFallback(handler http.Handler) Use

UseFallback registers the fallback handler for unmatched requests.

func UseLicense

func UseLicense(license string) Use

UseLicense stores the client license string.

func UseModel

func UseModel[M any](handler model.Handler[M]) Use

UseModel registers a model-based page handler.

func UseRoute

func UseRoute(r Route) Use

UseRoute registers a custom non-page route.

func UseServerID

func UseServerID(id string) Use

UseServerID stores the stable server identifier used in generated paths.

func UseSessionCallback

func UseSessionCallback(hook SessionCallback) Use

UseSessionCallback registers session lifecycle callbacks.

func UseSystemConf

func UseSystemConf(conf common.SystemConf) Use

UseSystemConf stores the router-wide system configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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