middleware

package
v0.0.0-...-902d557 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: AGPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BEARER_PREFIX      = "Bearer "
	MULTIPART_MEM_MAX  = 4 << 20
	RANGE_SIZE_DEFAULT = 50
	RANGE_SIZE_LIMIT   = 200
)

Variables

This section is empty.

Functions

func MustAdmin

func MustAdmin(request *http.Request) (_ *http.Request, ok bool, code int, r_map map[string]interface{}, err error)

*

  • Reject users who are not admins

func MustAuth

func MustAuth(request *http.Request) (modified *http.Request, ok bool, code int, r_map map[string]interface{}, err error)

*

  • Reject unauthed users

func MustModerator

func MustModerator(request *http.Request) (_ *http.Request, ok bool, code int, r_map map[string]interface{}, err error)

*

  • Reject users who are not moderators

func PaginationParams

func PaginationParams(request *http.Request) (modified *http.Request, ok bool, code int, _ map[string]interface{}, err error)

func ParseMultipart

func ParseMultipart(request *http.Request) (_ *http.Request, ok bool, code int, r_map map[string]interface{}, err error)

func RejectBanned

func RejectBanned(request *http.Request) (_ *http.Request, ok bool, code int, r_map map[string]interface{}, err error)

*

  • Reject banned requests
  • required before: MustAuth to get the requester

Types

This section is empty.

Jump to

Keyboard shortcuts

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