Documentation
¶
Index ¶
- Variables
- func CompareSlices(a, b []string) bool
- func CtxUserName(ctx context.Context) string
- func WithContextUserName(ctx context.Context, userName string) context.Context
- type Alias
- type CheckConfig
- type CheckRequest
- type CheckRequestUser
- type CheckResponse
- type Dashboard
- type Error
- type ErrorPayload
- type GetLMapRequest
- type GetPermissionRequest
- type GetRoleRequest
- type GetUserRequest
- type IDName
- type LMap
- type LMapCheckCreate
- type LMapPatch
- type Message
- type Meta
- type NameRequest
- type Permission
- type PermissionExtended
- type PermissionIDs
- type PermissionPatch
- type Resource
- type Response
- type ResponseCreate
- type ResponseCreateBulk
- type ResponseError
- type ResponseMessage
- type ResponseVersion
- type Role
- type RoleExtended
- type RoleIDs
- type RolePatch
- type RoleRelation
- type Token
- type User
- type UserCreate
- type UserExtended
- type UserInfo
- type UserPatch
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CompareSlices ¶
func CtxUserName ¶
Types ¶
type CheckConfig ¶ added in v0.8.1
type CheckConfig struct { // DefaultHost for checkHost function. If resource hosts is empty, it will use this host. DefaultHost string `cfg:"default_host"` }
type CheckRequest ¶
type CheckRequestUser ¶
type CheckResponse ¶
type CheckResponse struct {
Allowed bool `json:"allowed"`
}
type Dashboard ¶
type Dashboard struct { Roles []RoleExtended `json:"roles"` TotalRoles uint64 `json:"total_roles"` TotalPermissions uint64 `json:"total_permissions"` TotalUsers uint64 `json:"total_users"` TotalServiceAccounts uint64 `json:"total_service_accounts"` }
type Error ¶
type Error struct { Msg string `json:"message,omitempty"` Err error `json:"error,omitempty"` Code int `json:"-"` }
func NewErrorAs ¶
func (Error) MarshalJSON ¶
type ErrorPayload ¶
type ErrorPayload struct {
Err string `json:"error"`
}
type GetLMapRequest ¶
type GetPermissionRequest ¶
type GetPermissionRequest struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` Method string `json:"method"` Description string `json:"description"` Limit int64 `json:"limit"` Offset int64 `json:"offset"` Data map[string]string `json:"data"` AddRoles bool `json:"add_roles"` }
type GetRoleRequest ¶
type GetRoleRequest struct { ID string `json:"id"` Name string `json:"name"` PermissionIDs []string `json:"permission_ids"` RoleIDs []string `json:"role_ids"` Path string `json:"path"` Method string `json:"method"` Description string `json:"description"` Permissions []string `json:"permissions"` Limit int64 `json:"limit"` Offset int64 `json:"offset"` AddPermissions bool `json:"add_permissions"` AddRoles bool `json:"add_roles"` AddTotalUsers bool `json:"add_total_users"` }
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"` Permissions []string `json:"permissions"` ServiceAccount *bool `json:"service_account"` Disabled *bool `json:"disabled"` Limit int64 `json:"limit"` Offset int64 `json:"offset"` AddRoles bool `json:"add_role"` AddPermissions bool `json:"add_permissions"` AddData bool `json:"add_data"` Sanitize bool `json:"sanitize"` }
type LMapCheckCreate ¶
type NameRequest ¶
type NameRequest struct {
Name string `json:"name"`
}
type Permission ¶
type Permission struct { ID string `json:"id" badgerhold:"unique"` Name string `json:"name" badgerhold:"index"` Resources []Resource `json:"resources"` Description string `json:"description"` Data map[string]interface{} `json:"data"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` }
Permission is a struct that represents a permission table in the database.
type PermissionExtended ¶ added in v0.8.1
type PermissionExtended struct { *Permission Roles []IDName `json:"roles,omitempty"` }
type PermissionIDs ¶
type PermissionIDs struct {
PermissionIDs []string `json:"permission_ids"`
}
type PermissionPatch ¶
type ResponseCreate ¶
type ResponseCreate struct {
ID string `json:"id"`
}
type ResponseCreateBulk ¶
type ResponseCreateBulk struct {
IDs []string `json:"ids"`
}
type ResponseError ¶
type ResponseError struct {
Message Message `json:"message"`
}
type ResponseMessage ¶
type ResponseMessage struct {
Message *Message `json:"message,omitempty"`
}
func NewResponseMessage ¶
func NewResponseMessage(text string) ResponseMessage
type ResponseVersion ¶
type ResponseVersion struct {
Version uint64 `json:"version"`
}
type Role ¶
type Role struct { ID string `json:"id" badgerhold:"unique"` Name string `json:"name" badgerhold:"index"` PermissionIDs []string `json:"permission_ids"` RoleIDs []string `json:"role_ids"` Data map[string]interface{} `json:"data"` Description string `json:"description"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` }
Role is a struct that represents a role table in the database.
type RoleExtended ¶
type RoleRelation ¶
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"` MixRoleIDs []string `json:"-"` Details map[string]interface{} `json:"details"` Disabled bool `json:"-"` ServiceAccount bool `json:"service_account"` Local bool `json:"local"` PermissionIDs []string `json:"permission_ids"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` UpdatedBy string `json:"updated_by"` }
User is a struct that represents a user table in the database.
type UserCreate ¶
type UserExtended ¶
Click to show internal directories.
Click to hide internal directories.