http

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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
	RequireAdminRole                  func(http.Handler) http.Handler

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

	ReturnTo 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
	Auth            *auth.Service
	Dev             bool
	Session         *session.Service
	Logger          *slog.Logger
	Store           *store.Store
	AuthLimiter     ratelimiter.AuthLimiter
	Google          *google.Client
	OAuthProviders  oauth.OAuthProviders
	AccessTokenTTL  time.Duration
	RefreshTokenTTL time.Duration
	Render          render.Renderer
}

Directories

Path Synopsis
handlers
kit
templates

Jump to

Keyboard shortcuts

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