Documentation
¶
Index ¶
- Variables
- func FillMap(s interface{}, out map[string]interface{})
- func IsStruct(s interface{}) bool
- func Map(s interface{}) map[string]interface{}
- func RoleMiddleware() echo.MiddlewareFunc
- func RoleMiddlewareWithConfig(config RoleMiddlewareConfig) echo.MiddlewareFunc
- func Values(s interface{}) []interface{}
- type Action
- type CustomStruct
- func (s *CustomStruct) Field(name string) *Field
- func (s *CustomStruct) FieldOk(name string) (*Field, bool)
- func (s *CustomStruct) Fields() []*Field
- func (s *CustomStruct) FillMap(out map[string]interface{})
- func (s *CustomStruct) ToMap() map[string]interface{}
- func (s *CustomStruct) Values() []interface{}
- type Field
- type Operator
- type Permission
- type Rbac
- type Role
- type RoleMiddlewareConfig
- type Rule
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultTagName = "json"
)
Functions ¶
func RoleMiddleware ¶
func RoleMiddleware() echo.MiddlewareFunc
func RoleMiddlewareWithConfig ¶
func RoleMiddlewareWithConfig(config RoleMiddlewareConfig) echo.MiddlewareFunc
Types ¶
type CustomStruct ¶
type CustomStruct struct {
TagName string
// contains filtered or unexported fields
}
func Struct ¶
func Struct(s interface{}) *CustomStruct
func (*CustomStruct) Field ¶
func (s *CustomStruct) Field(name string) *Field
func (*CustomStruct) Fields ¶
func (s *CustomStruct) Fields() []*Field
func (*CustomStruct) FillMap ¶
func (s *CustomStruct) FillMap(out map[string]interface{})
func (*CustomStruct) ToMap ¶
func (s *CustomStruct) ToMap() map[string]interface{}
func (*CustomStruct) Values ¶
func (s *CustomStruct) Values() []interface{}
type Permission ¶
type Permission struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Action string `json:"action" yaml:"action"`
Target string `json:"target" yaml:"target"`
Rules []Rule `json:"rules" yaml:"rules"`
}
func (*Permission) IsValid ¶
func (p *Permission) IsValid() bool
type Role ¶
type Role struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Permissions []Permission `json:"permissions" yaml:"permissions"`
}
type RoleMiddlewareConfig ¶
Click to show internal directories.
Click to hide internal directories.