middleware

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminTokenCheck

func AdminTokenCheck(d *deps.Deps) gin.HandlerFunc

Administrator middleware

func CORS

func CORS() gin.HandlerFunc

CORS

Sets up CORS headers for the API, if the request method is options, the request will be aborted with a status of http.StatusOK.

func EmptyBody

func EmptyBody() gin.HandlerFunc

EmptyBody

Determines if the content type is JSON and the method type is a post or a put, if the body is invalid JSON or empty, abort JSON will be called.

func OperatorTokenCheck

func OperatorTokenCheck(d *deps.Deps) gin.HandlerFunc

Operator middleware

func Redirects

func Redirects(d *deps.Deps) gin.HandlerFunc

Redirects

Determines if the path includes the admin path or the api routes. If it doesnt, the redirect repository will be called with the path, if there is a match, the user will be redirect with the appropriate code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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