label

package
v2.0.43 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 1 Imported by: 28

Documentation

Index

Constants

View Source
const (
	// Resource key name
	Resource = "resource"

	// Auth 控制是否开启AccessToken认证
	Auth = "auth"

	// Code 控制是否开启验证码认证
	Code = "code"

	// Permission 控制是否开启权限判定
	Permission = "permission"

	// Allow 控制允许的角色
	Allow = "allow"

	// 控制是否开启审计
	Audit = "audit"
)
View Source
const (
	Enable  = true
	Disable = false
)
View Source
const (
	// Action key name
	Action = "action"
)
View Source
const (
	// Action key name
	PERMISSION_MODE = "permission_mode"
)

Variables

View Source
var (
	// Get Label
	Get = action("get")
	// List label
	List = action("list")
	// Create label
	Create = action("create")
	// Update label
	Update = action("update")
	// Delete label
	Delete = action("delete")
)
View Source
var (
	// Get Label
	PERMISSION_MODE_PRBAC = NewPermissionMode("PRBAC")
	// List label
	PERMISSION_MODE_ACL = NewPermissionMode("ACL")
)

Functions

func AllowAll

func AllowAll() (values []string)

func NewActionLabel

func NewActionLabel(name string) *http.Label

Action action Lable

func NewPermissionMode

func NewPermissionMode(name string) *http.Label

Action action Lable

Types

type Meta

type Meta map[string]interface{}

func NewMeta added in v2.0.23

func NewMeta(data map[string]any) Meta

func (Meta) Action

func (m Meta) Action() string

func (Meta) Allow

func (m Meta) Allow() []string

func (Meta) AuditEnable

func (m Meta) AuditEnable() bool

func (Meta) AuthEnable

func (m Meta) AuthEnable() bool

func (Meta) Get added in v2.0.23

func (m Meta) Get(key string) any

func (Meta) GetBool added in v2.0.23

func (m Meta) GetBool(key string) bool

func (Meta) GetString added in v2.0.23

func (m Meta) GetString(key string) string

func (Meta) PermissionEnable

func (m Meta) PermissionEnable() bool

func (Meta) Resource

func (m Meta) Resource() string

Jump to

Keyboard shortcuts

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