Documentation ¶
Index ¶
- type ListUserRoleCondition
- type RoleManager
- func (r *RoleManager) Create(role *types.Role) error
- func (r *RoleManager) Get(name string) (*types.Role, error)
- func (r *RoleManager) Init()
- func (r *RoleManager) InitRole(role *types.Role) error
- func (r *RoleManager) List(filters map[string]interface{}) ([]*types.Role, error)
- func (r *RoleManager) Update(role *types.Role) error
- type SessionManager
- type UserListCondition
- type UserManager
- func (u *UserManager) Create(user *types.User) error
- func (u *UserManager) Delete(name string) error
- func (u *UserManager) GetById(id uint) (*types.User, error)
- func (u *UserManager) GetByName(name string, opfs ...manager.OptionFunc) (*types.User, error)
- func (u *UserManager) List(cond UserListCondition) ([]*types.User, error)
- func (u *UserManager) Permissions(user *types.User) ([]types.Permission, error)
- func (u *UserManager) Update(user *types.User) error
- type UserRoleManager
- func (r *UserRoleManager) AuthRole(user *types.User, scope string, scopeId uint, role string) bool
- func (r *UserRoleManager) CreateOrUpdate(scope string, scopeId uint, userIds []uint, role string) error
- func (r *UserRoleManager) Delete(id uint) error
- func (r *UserRoleManager) GetById(id uint) (*types.UserRole, error)
- func (r *UserRoleManager) GetUserRoles(userId uint) ([]types.UserRole, error)
- func (r *UserRoleManager) List(cond *ListUserRoleCondition) ([]*types.UserRole, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListUserRoleCondition ¶
type RoleManager ¶
type RoleManager struct {
manager.CommonManager
}
func NewRoleManager ¶
func NewRoleManager(redisClient *redis.Client) *RoleManager
func (*RoleManager) Init ¶
func (r *RoleManager) Init()
type SessionManager ¶
type SessionManager struct {
manager.CommonManager
}
func NewTokenManager ¶
func NewTokenManager(redisClient *redis.Client) *SessionManager
func (*SessionManager) Create ¶
func (tk *SessionManager) Create(tkObj *types.UserSession) error
func (*SessionManager) Get ¶
func (tk *SessionManager) Get(name string) (*types.UserSession, error)
type UserListCondition ¶
type UserListCondition struct {
Ids []uint `json:"ids"`
}
type UserManager ¶
func NewUserManager ¶
func NewUserManager(db *gorm.DB) *UserManager
func (*UserManager) Delete ¶
func (u *UserManager) Delete(name string) error
func (*UserManager) GetByName ¶
func (u *UserManager) GetByName(name string, opfs ...manager.OptionFunc) (*types.User, error)
func (*UserManager) List ¶
func (u *UserManager) List(cond UserListCondition) ([]*types.User, error)
func (*UserManager) Permissions ¶
func (u *UserManager) Permissions(user *types.User) ([]types.Permission, error)
type UserRoleManager ¶
type UserRoleManager struct { DB *gorm.DB UserManager *UserManager }
func NewUserRoleManager ¶
func NewUserRoleManager(db *gorm.DB, user *UserManager) *UserRoleManager
func (*UserRoleManager) CreateOrUpdate ¶
func (*UserRoleManager) Delete ¶
func (r *UserRoleManager) Delete(id uint) error
func (*UserRoleManager) GetById ¶
func (r *UserRoleManager) GetById(id uint) (*types.UserRole, error)
func (*UserRoleManager) GetUserRoles ¶
func (r *UserRoleManager) GetUserRoles(userId uint) ([]types.UserRole, error)
func (*UserRoleManager) List ¶
func (r *UserRoleManager) List(cond *ListUserRoleCondition) ([]*types.UserRole, error)
Click to show internal directories.
Click to hide internal directories.