router

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourcePath

func ResourcePath(r *resources.Resource, ext string) string

Types

type ErrorPageComponent

type ErrorPageComponent = func(message string) templ.Component

type Request

type Request[M any] struct {
	Model   *M
	W       http.ResponseWriter
	R       *http.Request
	Adapter *path.Adapter[M]
}

type Response

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

type ResponseApp

type ResponseApp[M any] struct {
	App     instance.App[M]
	Model   *M
	Adapter *path.Adapter[M]
}

type ResponseRawRedirect

type ResponseRawRedirect struct {
	Status int
	URL    string
}

type ResponseRedirect

type ResponseRedirect struct {
	Status int
	Model  any
}

type ResponseReroute

type ResponseReroute struct {
	Detached bool
	Model    any
}

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() map[string]path.AnyAdapter

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) ImportRegistry

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

func (*Router) License

func (rr *Router) License() license.License

func (*Router) RemoveSession

func (rr *Router) RemoveSession(id string)

func (*Router) ServeHTTP

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

func (*Router) Spawner

func (rr *Router) Spawner(op shredder.OnPanic) *shredder.Spawner

func (*Router) Use

func (rr *Router) Use(use ...Use)

type SessionCallback

type SessionCallback interface {
	Create(id string, header http.Header)
	Delete(id string)
}

type StaticPage

type StaticPage struct {
	Status  int
	Content templ.Component
}

type Use

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

func UseCSP

func UseCSP(csp *common.CSP) Use

func UseESConf

func UseESConf(profiles resources.BuildProfiles) Use

func UseErrorPage

func UseErrorPage(page ErrorPageComponent) Use

func UseFallback

func UseFallback(handler http.Handler) Use

func UseLicense

func UseLicense(cert string) Use

func UseModel

func UseModel[M any](handler func(r *Request[M]) Response) Use

func UseRoute

func UseRoute(r Route) Use

func UseSessionCallback

func UseSessionCallback(hook SessionCallback) Use

func UseSystemConf

func UseSystemConf(conf common.SystemConf) Use

Jump to

Keyboard shortcuts

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