rolecheck

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadMethods = map[string]struct{}{
		"GET":     {},
		"HEAD":    {},
		"OPTIONS": {},
		"TRACE":   {},
		"CONNECT": {},
	}
	WriteMethods = map[string]struct{}{
		"POST":   {},
		"PUT":    {},
		"PATCH":  {},
		"DELETE": {},
	}
)

Functions

This section is empty.

Types

type Map

type Map struct {
	AllMethods    bool     `cfg:"all_methods"`
	ReadMethods   bool     `cfg:"read_methods"`
	WriteMethods  bool     `cfg:"write_methods"`
	Methods       []string `cfg:"methods"`
	Roles         []string `cfg:"roles"`
	RolesDisabled bool     `cfg:"roles_disabled"`
	// contains filtered or unexported fields
}

type PathMap

type PathMap struct {
	RegexPath string `cfg:"regex_path"`
	Map       []Map  `cfg:"map"`
	// contains filtered or unexported fields
}

type Redirect

type Redirect struct {
	Enable bool   `cfg:"enable"`
	URL    string `cfg:"url"`
}

type RoleCheck

type RoleCheck struct {
	PathMap     []PathMap `cfg:"path_map"`
	AllowOthers bool      `cfg:"allow_others"`

	Redirect Redirect `cfg:"redirect"`
}

func (*RoleCheck) Middleware

func (m *RoleCheck) Middleware() (echo.MiddlewareFunc, error)

Jump to

Keyboard shortcuts

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