token

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

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