router

package
v0.0.0-...-059fb3b Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct{}

func NewServer

func NewServer(routes []Registerer, cfg Config, lc fx.Lifecycle, mids *Middlewares, tools tools.Tools, fs afero.Fs) (*API, error)

type Config

type Config struct {
	Addr      string
	CertFile  string
	KeyFile   string
	HostNames []string
	TLS       bool
	Secure    bool
}

type Middleware

type Middleware func(next http.Handler) http.Handler

type Middlewares

type Middlewares struct {
	StripSlashed Middleware
	Logger       Middleware
	OnlyJSON     Middleware
	RealIP       Middleware
	CORS         Middleware
	MasterKey    Middleware
}

func InitMiddlewares

func InitMiddlewares(tools tools.Tools, cfg Config, masterkeyMid *masterkey.HTTPMiddleware) *Middlewares

func (*Middlewares) Defaults

func (m *Middlewares) Defaults() []func(next http.Handler) http.Handler

type Registerer

type Registerer interface {
	Register(r chi.Router, mids *Middlewares)
}

Jump to

Keyboard shortcuts

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