http

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(cfg ServerConfig, mw Middlewares) http.Handler

Types

type Handlers added in v0.1.24

type Handlers struct {
	UI          *ui.UIHandler
	API         *api.APIHandler
	InternalAPI *internalapi.Handler
}

type Middlewares

type Middlewares struct {
	RedirectIfAuthenticated func(http.Handler) http.Handler

	RequireAppAccessAuthWithRefresh   func(http.Handler) http.Handler
	RequireAppAccessAuthAPI           func(http.Handler) http.Handler
	RequireAdminAccessAuthWithRefresh func(http.Handler) http.Handler
	RequireAdminAccessAuthAPI         func(http.Handler) http.Handler
	RequireInternalAPIAuth            func(http.Handler) http.Handler
	RequireAdminRole                  func(http.Handler) http.Handler

	RequireCSRF    func(http.Handler) http.Handler
	RequireAPICSRF func(http.Handler) http.Handler

	ReturnTo                  func(http.Handler) http.Handler
	HTMX                      func(http.Handler) http.Handler
	RequireChallengeEnabled   func(http.Handler) http.Handler
	RequireAllowlistEnabled   func(http.Handler) http.Handler
	OptionalAppAccessIdentity func(http.Handler) http.Handler
}

type Server

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

func NewServer

func NewServer(cfg ServerConfig, mw Middlewares) *Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

type ServerConfig

type ServerConfig struct {
	Version           string
	Addr              string
	Dev               bool
	TrustProxyHeaders bool
	Logger            *slog.Logger
	OAuthProviders    oauth.OAuthProviders
	Handlers          Handlers
}

Jump to

Keyboard shortcuts

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