middleware

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(realm string, creds map[string]string) func(next http.Handler) http.Handler

func Setup

func Setup(opts *Options)

func SetupGlobalMiddleware

func SetupGlobalMiddleware(handler http.Handler) http.Handler

func TokenAuth

func TokenAuth(realm string, token string) func(next http.Handler) http.Handler

TokenAuth implements a similar middleware handler like go-chi's BasicAuth middleware but for bearer tokens

Types

type AuthBasic

type AuthBasic struct {
	Username string
	Password string
}

type AuthToken

type AuthToken struct {
	Token string
}

type Options

type Options struct {
	Handler   http.Handler
	AuthBasic *AuthBasic
	AuthToken *AuthToken
}

Jump to

Keyboard shortcuts

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