middleware

package
v0.0.0-...-68eb7cf Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowGuest

func AllowGuest(next echo.HandlerFunc) echo.HandlerFunc

Using this middleware means the controller could accept access from guests. The only exception is role information, guest users don't have any permissions or roles. Any user information other than roles SHOULD NOT be read in controllers that use this middleware.

func Auth

func Auth(next echo.HandlerFunc) echo.HandlerFunc

func Authentication

func Authentication(next echo.HandlerFunc) echo.HandlerFunc

func HasPermission

func HasPermission(p PermissionOption) func(next echo.HandlerFunc) echo.HandlerFunc

func IsTestCaseSample

func IsTestCaseSample(c echo.Context) (result bool)

func Judger

func Judger(next echo.HandlerFunc) echo.HandlerFunc

func Logged

func Logged(next echo.HandlerFunc) echo.HandlerFunc

func Recover

func Recover(next echo.HandlerFunc) echo.HandlerFunc

Types

type AndPermission

type AndPermission struct {
	A PermissionOption
	B PermissionOption
}

func (AndPermission) Check

func (p AndPermission) Check(c echo.Context) bool

type CustomPermission

type CustomPermission struct {
	F func(c echo.Context) bool
}

func (CustomPermission) Check

func (p CustomPermission) Check(c echo.Context) bool

type OrPermission

type OrPermission struct {
	A PermissionOption
	B PermissionOption
}

func (OrPermission) Check

func (p OrPermission) Check(c echo.Context) bool

type PermissionOption

type PermissionOption interface {
	Check(ctx echo.Context) bool
}

type ScopedPermission

type ScopedPermission struct {
	P           string
	IdFieldName string
	T           string
}

func (ScopedPermission) Check

func (p ScopedPermission) Check(c echo.Context) bool

type UnscopedPermission

type UnscopedPermission struct {
	P string
}

func (UnscopedPermission) Check

func (p UnscopedPermission) Check(c echo.Context) bool

Jump to

Keyboard shortcuts

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