middleware

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: AGPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMiddleware

func LogMiddleware(c *gin.Context)

LogMiddleware is an middleware to log requests to phuslu/log and catches panics. If it is added multiple times, only the first time sends entries to the log.

func RequireUser

func RequireUser(c *gin.Context)

RequireUser is an middleware that looks if the user is an Anonymous user and redircts it to the login if so.

Types

type Config

type Config map[string]interface{}

Config is the type For Configuration of the Middleware

type Middleware

type Middleware interface {
	Gin(*gin.Context)
	Defaults() Config
	Setup(Config)
	Teardown()
	Sites([]interface{}) error
}

Middleware is an type to Save data between executions and to provide help at the teardown.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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