middleware

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

This package contains useful middleware functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(db *hub.DB, cond func(*http.Request, models.User) bool) func(http.Handler) http.Handler

Filters requests based on whether `cond(...)` and the provided auth token is valid. If either is false, it rejects the request.

func AuthPlain

func AuthPlain(db *hub.DB) func(http.Handler) http.Handler

Allows all requests with valid auth tokens; cond always returns true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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