web

package
v0.0.0-...-e9665ab Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const HandlerTimeout = 5 * time.Second

HandlerTimeout should be used as the value in all timeout middleware, and as the base value to calculate http.Server timeouts from.

Variables

View Source
var ErrTenantNotFound = errors.New("not found")

Functions

func NewAPIRouter

func NewAPIRouter(base *handler.Handler) http.Handler

func NewPWARouter

func NewPWARouter(base *handler.Handler) http.Handler

func NewRouter

func NewRouter(tenant *handler.Tenant) http.Handler

func NewSiteRouter

func NewSiteRouter(base *handler.Handler) http.Handler

Types

type MultiTenantHandler

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

func NewMultiTenantHandler

func NewMultiTenantHandler(logger *slog.Logger, newTenant NewTenantFunc) *MultiTenantHandler

func (*MultiTenantHandler) ServeHTTP

func (h *MultiTenantHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NewTenantFunc

type NewTenantFunc func(hostname string) (*handler.Tenant, error)

Jump to

Keyboard shortcuts

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