Documentation ¶
Overview ¶
@description: user authentication and authorization
@description: user crud
Index ¶
- type RoleGroup
- type RoleGroupRepository
- type RoleGroupRepositoryImpl
- func (impl RoleGroupRepositoryImpl) CreateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) CreateRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (*RoleGroupRoleMapping, error)
- func (impl RoleGroupRepositoryImpl) DeleteRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (bool, error)
- func (impl RoleGroupRepositoryImpl) GetAllRoleGroup() ([]*RoleGroup, error)
- func (impl *RoleGroupRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupById(id int32) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupByName(name string) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupListByCasbinNames(names []string) ([]*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupListByName(name string) ([]*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupListByNames(groupNames []string) ([]*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMapping(userRoleModelId int32) (*RoleGroupRoleMapping, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupId(roleGroupId int32) ([]*RoleGroupRoleMapping, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupIds(roleGroupIds []int32) ([]*RoleModel, error)
- func (impl RoleGroupRepositoryImpl) UpdateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error)
- type RoleGroupRoleMapping
- type RoleModel
- type UserAuthRepository
- type UserAuthRepositoryImpl
- func (impl UserAuthRepositoryImpl) CreateDefaultPolicies(team string, entityName string, env string, tx *pg.Tx) (bool, error)
- func (impl UserAuthRepositoryImpl) CreateDefaultPoliciesForGlobalEntity(entity string, entityName string, action string, tx *pg.Tx) (bool, error)
- func (impl UserAuthRepositoryImpl) CreateRole(userModel *RoleModel, tx *pg.Tx) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) CreateUpdateDefaultPoliciesForSuperAdmin(tx *pg.Tx) (bool, error)
- func (impl UserAuthRepositoryImpl) CreateUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (*UserRoleModel, error)
- func (impl UserAuthRepositoryImpl) DeleteUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (bool, error)
- func (impl UserAuthRepositoryImpl) GetAllRole() ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRole(role string) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRoleByFilter(entity string, team string, app string, env string, act string) (RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRoleById(id int) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByGroupId(roleGroupId int32) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByUserId(userId int32) ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetUserRoleMappingByUserId(userId int32) ([]*UserRoleModel, error)
- func (impl UserAuthRepositoryImpl) SyncOrchestratorToCasbin(team string, entityName string, env string, tx *pg.Tx) (bool, error)
- type UserModel
- type UserRepository
- type UserRepositoryImpl
- func (impl UserRepositoryImpl) CreateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
- func (impl UserRepositoryImpl) FetchActiveOrDeletedUserByEmail(email string) (*UserModel, error)
- func (impl UserRepositoryImpl) FetchActiveUserByEmail(email string) (bean.UserInfo, error)
- func (impl UserRepositoryImpl) FetchUserDetailByEmail(email string) (bean.UserInfo, error)
- func (impl UserRepositoryImpl) FetchUserMatchesByEmailId(email string) ([]UserModel, error)
- func (impl UserRepositoryImpl) GetAll() ([]UserModel, error)
- func (impl UserRepositoryImpl) GetById(id int32) (*UserModel, error)
- func (impl UserRepositoryImpl) GetByIdIncludeDeleted(id int32) (*UserModel, error)
- func (impl UserRepositoryImpl) GetByIds(ids []int32) ([]UserModel, error)
- func (impl *UserRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl UserRepositoryImpl) UpdateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
- type UserRoleModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoleGroupRepository ¶
type RoleGroupRepository interface { CreateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error) UpdateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error) GetRoleGroupById(id int32) (*RoleGroup, error) GetRoleGroupByName(name string) (*RoleGroup, error) GetRoleGroupListByName(name string) ([]*RoleGroup, error) GetAllRoleGroup() ([]*RoleGroup, error) GetRoleGroupListByCasbinNames(name []string) ([]*RoleGroup, error) CreateRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (*RoleGroupRoleMapping, error) GetRoleGroupRoleMapping(model int32) (*RoleGroupRoleMapping, error) GetRoleGroupRoleMappingByRoleGroupId(roleGroupId int32) ([]*RoleGroupRoleMapping, error) DeleteRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (bool, error) GetConnection() (dbConnection *pg.DB) GetRoleGroupListByNames(groupNames []string) ([]*RoleGroup, error) GetRoleGroupRoleMappingByRoleGroupIds(roleGroupIds []int32) ([]*RoleModel, error) }
type RoleGroupRepositoryImpl ¶
type RoleGroupRepositoryImpl struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewRoleGroupRepositoryImpl ¶
func NewRoleGroupRepositoryImpl(dbConnection *pg.DB, Logger *zap.SugaredLogger) *RoleGroupRepositoryImpl
func (RoleGroupRepositoryImpl) CreateRoleGroup ¶
func (RoleGroupRepositoryImpl) CreateRoleGroupRoleMapping ¶
func (impl RoleGroupRepositoryImpl) CreateRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (*RoleGroupRoleMapping, error)
func (RoleGroupRepositoryImpl) DeleteRoleGroupRoleMapping ¶
func (impl RoleGroupRepositoryImpl) DeleteRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (bool, error)
func (RoleGroupRepositoryImpl) GetAllRoleGroup ¶
func (impl RoleGroupRepositoryImpl) GetAllRoleGroup() ([]*RoleGroup, error)
func (*RoleGroupRepositoryImpl) GetConnection ¶
func (impl *RoleGroupRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (RoleGroupRepositoryImpl) GetRoleGroupById ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupById(id int32) (*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupByName ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupByName(name string) (*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupListByCasbinNames ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupListByCasbinNames(names []string) ([]*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupListByName ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupListByName(name string) ([]*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupListByNames ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupListByNames(groupNames []string) ([]*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupRoleMapping ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMapping(userRoleModelId int32) (*RoleGroupRoleMapping, error)
func (RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupId ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupId(roleGroupId int32) ([]*RoleGroupRoleMapping, error)
func (RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupIds ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupIds(roleGroupIds []int32) ([]*RoleModel, error)
func (RoleGroupRepositoryImpl) UpdateRoleGroup ¶
type RoleGroupRoleMapping ¶
type RoleModel ¶
type RoleModel struct { TableName struct{} `sql:"roles" pg:",discard_unknown_columns"` Id int `sql:"id,pk"` Role string `sql:"role,notnull"` Entity string `sql:"entity"` Team string `sql:"team"` EntityName string `sql:"entity_name"` Environment string `sql:"environment"` Action string `sql:"action"` sql.AuditLog }
type UserAuthRepository ¶
type UserAuthRepository interface { CreateRole(userModel *RoleModel, tx *pg.Tx) (*RoleModel, error) GetRoleById(id int) (*RoleModel, error) GetRolesByUserId(userId int32) ([]RoleModel, error) GetRolesByGroupId(userId int32) ([]*RoleModel, error) GetAllRole() ([]RoleModel, error) GetRoleByFilter(entity string, team string, app string, env string, act string) (RoleModel, error) CreateUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (*UserRoleModel, error) GetUserRoleMappingByUserId(userId int32) ([]*UserRoleModel, error) DeleteUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (bool, error) CreateDefaultPolicies(team string, entityName string, env string, tx *pg.Tx) (bool, error) CreateDefaultPoliciesForGlobalEntity(entity string, entityName string, action string, tx *pg.Tx) (bool, error) CreateUpdateDefaultPoliciesForSuperAdmin(tx *pg.Tx) (bool, error) SyncOrchestratorToCasbin(team string, entityName string, env string, tx *pg.Tx) (bool, error) }
type UserAuthRepositoryImpl ¶
type UserAuthRepositoryImpl struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewUserAuthRepositoryImpl ¶
func NewUserAuthRepositoryImpl(dbConnection *pg.DB, Logger *zap.SugaredLogger) *UserAuthRepositoryImpl
func (UserAuthRepositoryImpl) CreateDefaultPolicies ¶
func (UserAuthRepositoryImpl) CreateDefaultPoliciesForGlobalEntity ¶
func (UserAuthRepositoryImpl) CreateRole ¶
func (UserAuthRepositoryImpl) CreateUpdateDefaultPoliciesForSuperAdmin ¶
func (impl UserAuthRepositoryImpl) CreateUpdateDefaultPoliciesForSuperAdmin(tx *pg.Tx) (bool, error)
func (UserAuthRepositoryImpl) CreateUserRoleMapping ¶
func (impl UserAuthRepositoryImpl) CreateUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (*UserRoleModel, error)
func (UserAuthRepositoryImpl) DeleteUserRoleMapping ¶
func (impl UserAuthRepositoryImpl) DeleteUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (bool, error)
func (UserAuthRepositoryImpl) GetAllRole ¶
func (impl UserAuthRepositoryImpl) GetAllRole() ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetRole ¶
func (impl UserAuthRepositoryImpl) GetRole(role string) (*RoleModel, error)
func (UserAuthRepositoryImpl) GetRoleByFilter ¶
func (UserAuthRepositoryImpl) GetRoleById ¶
func (impl UserAuthRepositoryImpl) GetRoleById(id int) (*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByGroupId ¶
func (impl UserAuthRepositoryImpl) GetRolesByGroupId(roleGroupId int32) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByUserId ¶
func (impl UserAuthRepositoryImpl) GetRolesByUserId(userId int32) ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetUserRoleMappingByUserId ¶
func (impl UserAuthRepositoryImpl) GetUserRoleMappingByUserId(userId int32) ([]*UserRoleModel, error)
func (UserAuthRepositoryImpl) SyncOrchestratorToCasbin ¶
type UserRepository ¶
type UserRepository interface { CreateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error) UpdateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error) GetById(id int32) (*UserModel, error) GetByIdIncludeDeleted(id int32) (*UserModel, error) GetAll() ([]UserModel, error) FetchActiveUserByEmail(email string) (bean.UserInfo, error) FetchUserDetailByEmail(email string) (bean.UserInfo, error) GetByIds(ids []int32) ([]UserModel, error) GetConnection() (dbConnection *pg.DB) FetchUserMatchesByEmailId(email string) ([]UserModel, error) FetchActiveOrDeletedUserByEmail(email string) (*UserModel, error) }
type UserRepositoryImpl ¶
type UserRepositoryImpl struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewUserRepositoryImpl ¶
func NewUserRepositoryImpl(dbConnection *pg.DB) *UserRepositoryImpl
func (UserRepositoryImpl) CreateUser ¶
func (UserRepositoryImpl) FetchActiveOrDeletedUserByEmail ¶
func (impl UserRepositoryImpl) FetchActiveOrDeletedUserByEmail(email string) (*UserModel, error)
func (UserRepositoryImpl) FetchActiveUserByEmail ¶
func (impl UserRepositoryImpl) FetchActiveUserByEmail(email string) (bean.UserInfo, error)
func (UserRepositoryImpl) FetchUserDetailByEmail ¶
func (impl UserRepositoryImpl) FetchUserDetailByEmail(email string) (bean.UserInfo, error)
func (UserRepositoryImpl) FetchUserMatchesByEmailId ¶
func (impl UserRepositoryImpl) FetchUserMatchesByEmailId(email string) ([]UserModel, error)
func (UserRepositoryImpl) GetAll ¶
func (impl UserRepositoryImpl) GetAll() ([]UserModel, error)
func (UserRepositoryImpl) GetById ¶
func (impl UserRepositoryImpl) GetById(id int32) (*UserModel, error)
func (UserRepositoryImpl) GetByIdIncludeDeleted ¶
func (impl UserRepositoryImpl) GetByIdIncludeDeleted(id int32) (*UserModel, error)
func (UserRepositoryImpl) GetByIds ¶
func (impl UserRepositoryImpl) GetByIds(ids []int32) ([]UserModel, error)
func (*UserRepositoryImpl) GetConnection ¶
func (impl *UserRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (UserRepositoryImpl) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.