authrouter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRouter

type AuthRouter interface {
	AuthHandler(method, path, required string, handler http.Handler)
}

AuthRouter is an interface to support defining routes that require auth

func NewAuthRouter

func NewAuthRouter(router httpserver.Router, checkAuth CheckAuth) AuthRouter

NewAuthRouter returns a AuthRouter

type CheckAuth

type CheckAuth interface {
	HasAuth(req *http.Request, required string) bool
}

CheckAuth interface checks if a request has the required auth

Jump to

Keyboard shortcuts

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