Documentation ¶
Index ¶
- Variables
- func AddRole(name string)
- func CaseCamel(ctx context.Context, table string, column string) string
- func CaseCamelUpper(ctx context.Context, table string, column string) string
- func CaseSnake(ctx context.Context, table string, column string) string
- func Ori(ctx context.Context, table string, column string) string
- func RoleList() []string
- func RowKeyGen(ctx context.Context, genFuncName string, table string, data g.Map) (g.Map, error)
- func RowKeyGenFunc(name string, f RowKeyGenFuncHandler)
- func RowKeyGenList() []string
- func SetDbFieldStyle(style FieldStyle)
- func SetJsonFieldStyle(style FieldStyle)
- type AccessCondition
- type AccessConditionReq
- type DefaultRole
- type FieldStyle
- type RoleReq
- type RowKeyGenFuncHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AccessVerify 是否权限验证 AccessVerify = true // AccessConditionFunc 自定义权限限制条件 AccessConditionFunc AccessCondition // DefaultRoleFunc 自定义获取节点的默认角色 DefaultRoleFunc DefaultRole = func(ctx context.Context, req RoleReq) (string, error) { return consts.UNKNOWN, nil } )
View Source
var ( TableAccess = "_access" TableRequest = "_request" )
设置 _access/_request 自定义表名
View Source
var (
Debug = false
)
View Source
var MaxTreeDeep = 5
View Source
var MaxTreeWidth = 5
Functions ¶
func RowKeyGenFunc ¶
func RowKeyGenFunc(name string, f RowKeyGenFuncHandler)
func RowKeyGenList ¶
func RowKeyGenList() []string
Types ¶
type AccessCondition ¶
AccessCondition 根据传入的ctx获取用户信息, 结合req 中的信息 返回需要添加到sql的where条件
type AccessConditionReq ¶
type DefaultRole ¶
DefaultRole nodeRole 为前端显式指定的role, 需要此函数中判断该role是不是用户角色之一, 返回最终该节点的角色
type FieldStyle ¶
Click to show internal directories.
Click to hide internal directories.