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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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