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