Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Permission ¶
type Permission struct {
ID int `db:"permission_id" json:"id"`
Name string `db:"name" json:"name"`
Description *null.String `db:"description" json:"description,omitempty"`
}
Permission represents an individual permission. Attempting to implement some RBAC here.
type PermissionRepo ¶
type PermissionRepo interface {
}
PermissionRepo defines all permission interactions
type Role ¶
type Role struct {
ID int `db:"role_id" json:"id"`
Name string `db:"name" json:"name"`
Description null.String `db:"description" json:"description"`
Permissions []Permission `json:"permissions"`
}
Role represents a "group" of permissions where multiple users can have this role and they will inherit these permissions.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains our dependency
func (*Store) GetFull ¶
GetFull will return all user information to be used for profile and management.
func (*Store) ListAll ¶ added in v0.7.0
ListAll returns all users It doesn't return the full User object Returns user_id, avatar, nickname, first_name, last_name
There will likely be modifications to include the other fields but will need to add a filter at the web handler first or offer a different function.
func (*Store) ListRole ¶ added in v0.7.0
ListRole returns all users who have a certain role It doesn't return the full User object Returns user_id, avatar, nickname, first_name, last_name
There will likely be modifications to include the other fields but will need to add a filter at the web handler first or offer a different function.
type User ¶
type User struct {
ID int `db:"user_id" json:"id"`
Username string `db:"username" json:"username,omitempty"`
Email string `db:"email" json:"email,omitempty"`
Nickname string `db:"nickname" json:"nickname"`
Avatar null.String `db:"avatar" json:"avatar"`
FirstName string `db:"first_name" json:"firstName"`
LastName string `db:"last_name" json:"lastName"`
Permissions []Permission `json:"permissions,omitempty"`
}
User represents a user object to be used when not all data is required
type UserFull ¶
type UserFull struct {
User
LastLogin *time.Time `db:"last_login" json:"lastLogin,omitempty"`
CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"`
CreatedBy int `db:"created_by" json:"createdBy,omitempty"`
UpdatedAt *null.Time `db:"updated_at" json:"updatedAt,omitempty"`
UpdatedBy *null.Int `db:"updated_by" json:"updatedBy,omitempty"`
DeletedAt *null.Time `db:"deleted_at" json:"deletedAt,omitempty"`
DeletedBy *null.Int `db:"deleted_by" json:"deletedBy,omitempty"`
Roles []Role `json:"roles,omitempty"`
}
UserFull represents a user and all columns