Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConflict = errors.New("conflict") ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type CheckRequest ¶
type CheckResponse ¶
type CheckResponse struct {
Allowed bool `json:"allowed"`
}
type Database ¶
type Database interface {
GetUsers(req GetUserRequest) (*Response[[]User], error)
GetUser(req GetUserRequest) (*User, error)
CreateUser(user User) error
DeleteUser(id string) error
PutUser(user User) error
PatchUser(user User) error
GetPermissions(req GetPermissionRequest) (*Response[[]Permission], error)
GetPermission(name string) (*Permission, error)
CreatePermission(permission Permission) error
DeletePermission(name string) error
PutPermission(permission Permission) error
GetRoles(req GetRoleRequest) (*Response[[]Role], error)
GetRole(name string) (*Role, error)
CreateRole(role Role) error
PutRole(role Role) error
DeleteRole(name string) 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
}
type GetLMapRequest ¶
type GetLMapRequest GetPermissionRequest
type GetPermissionRequest ¶
type GetRoleRequest ¶
type GetRoleRequest GetPermissionRequest
type GetUserRequest ¶
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 Role ¶
type Role struct {
ID string `json:"id" badgerhold:"unique"`
Name string `json:"name"`
Permissions []string `json:"permissions"`
}
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"`
Roles []string `json:"roles"`
Details map[string]interface{} `json:"details"`
}
User is a struct that represents a user table in the database.
type UserExtended ¶
type UserExtended struct {
}
Click to show internal directories.
Click to hide internal directories.