hpermmw

package
v1.1.44 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

*

 	API 权限控制中间件
	表达式语法参考:https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md·

Index

Constants

View Source
const (
	PermFile = "perms.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IPermFuncWrapper

type IPermFuncWrapper interface {
	SetServer(s core.IServer)
	Functions() htypes.Map
}

type Middleware

type Middleware struct {
	core.InMiddleware
	// contains filtered or unexported fields
}

func New

func New(funcWrapper IPermFuncWrapper) *Middleware

func (*Middleware) Config

func (this *Middleware) Config() core.IEntityConf

func (*Middleware) EntityStub

func (this *Middleware) EntityStub() *core.EntityStub

func (*Middleware) HandleIn

func (this *Middleware) HandleIn(seq uint64, version string, api string, data htypes.Map) (bool, *herrors.Error)

func (*Middleware) Open

type Options added in v1.1.0

type Options struct {
	Functions IPermFuncWrapper
}

type Perm

type Perm struct {
	Disabled  bool
	Version   string
	API       string
	If        string
	Condition string
	APIsMap   map[string]bool `json:"-"`
}

type PermMiddleware

type PermMiddleware struct {
	core.EntityConfBase
}

Jump to

Keyboard shortcuts

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