Documentation
¶
Index ¶
- Variables
- func CompareSlices(a, b []string) bool
- type CheckRequest
- type CheckResponse
- type Database
- type GetLMapRequest
- type GetPermissionRequest
- type GetRoleRequest
- type GetUserRequest
- type LMap
- type LMapRoleIDs
- type Meta
- type Permission
- type Request
- type Response
- type ResponseCreate
- type Role
- type User
- type UserExtended
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CompareSlices ¶ added in v0.7.3
Types ¶
type CheckRequest ¶
type CheckResponse ¶
type CheckResponse struct {
Allowed bool `json:"allowed"`
}
type Database ¶
type Database interface { GetUsers(req GetUserRequest) (*Response[[]UserExtended], error) GetUser(req GetUserRequest) (*UserExtended, error) CreateUser(user User) error DeleteUser(id string) error PutUser(user User) error PatchUser(user User) error GetPermissions(req GetPermissionRequest) (*Response[[]Permission], error) GetPermission(id string) (*Permission, error) CreatePermission(permission Permission) error DeletePermission(id string) error PutPermission(permission Permission) error PatchPermission(permission Permission) error GetRoles(req GetRoleRequest) (*Response[[]Role], error) GetRole(id string) (*Role, error) CreateRole(role Role) error PutRole(role Role) error DeleteRole(id string) error PatchRole(role Role) error Check(req CheckRequest) (*CheckResponse, error) GetLMaps(req GetLMapRequest) (*Response[[]LMap], error) GetLMap(name string) (*LMap, error) CreateLMap(lmap LMap) error PutLMap(lmap LMap) error DeleteLMap(name string) error LMapRoleIDs() LMapRoleIDs }
type GetLMapRequest ¶
type GetPermissionRequest ¶
type GetRoleRequest ¶
type GetUserRequest ¶
type GetUserRequest struct { ID string `json:"id"` Alias string `json:"alias"` RoleIDs []string `json:"role_ids"` UID string `json:"uid"` Name string `json:"name"` Email string `json:"email"` Path string `json:"path"` Method string `json:"method"` Limit int64 `json:"limit"` Offset int64 `json:"offset"` Extend bool `json:"extend"` }
type LMapRoleIDs ¶ added in v0.7.3
type Permission ¶
type Permission struct { ID string `json:"id" badgerhold:"unique"` Name string `json:"name"` Requests []Request `json:"requests"` Description string `json:"description"` }
Permission is a struct that represents a permission table in the database.
type ResponseCreate ¶ added in v0.7.3
type Role ¶
type Role struct { ID string `json:"id" badgerhold:"unique"` Name string `json:"name"` PermissionIDs []string `json:"permission_ids"` RoleIDs []string `json:"role_ids"` Data map[string]interface{} `json:"data"` }
Role is a struct that represents a role table in the database.
type User ¶
type User struct { ID string `json:"id" badgerhold:"unique"` Alias []string `json:"alias"` RoleIDs []string `json:"role_ids"` SyncRoleIDs []string `json:"sync_role_ids"` Details map[string]interface{} `json:"details"` }
User is a struct that represents a user table in the database.
type UserExtended ¶
Click to show internal directories.
Click to hide internal directories.