Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Component = &component.Component{ Dependencies: component.Components{ token.Component, chi.Component, }, PreExecute: component.StepFunc(func(container container.Container) error { return container.Invoke(func(r http.Router, auth *token.Auth) { r.Use(auth) }) }), }
Component automatically adds token authentication middleware to the HTTP router. It depends on:
- token.Component (the authentication middleware itself)
- chi.Component (the router)
Usage:
compogo.WithComponents(
http.Component,
chi.Component,
token.Component,
)
All routes will now require a valid token in the configured header.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.