http

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 18 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 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