Documentation ¶
Index ¶
- Variables
- type AppGroupSrv
- type AppSrv
- func (a AppSrv) AppCodeExist(appCode string) (bool, error)
- func (a AppSrv) Begin() (AppSrv, error)
- func (a AppSrv) CheckAppCode(appCode string) (bool, error)
- func (a AppSrv) DeleteByID(id, uid uint) error
- func (a AppSrv) FirstAppByAppCode(appCode string) (*dao.App, error)
- func (a AppSrv) FirstAppByID(id uint) (*dao.App, error)
- func (a AppSrv) FirstAppCallbackByID(id uint) (string, error)
- func (a AppSrv) FirstAppCodeByID(id, uid uint, opts ...daoUtil.ServiceOpt) (string, error)
- func (a AppSrv) FirstAppDetailedByIDForUser(id, uid uint, opts ...daoUtil.ServiceOpt) (*dto.AppShowDetail, error)
- func (a AppSrv) FirstAppKeyPair(id uint) (string, string, error)
- func (a AppSrv) GetForUpdateViews(opts ...daoUtil.ServiceOpt) ([]dao.App, error)
- func (a AppSrv) GetPermitAll() ([]dto.AppShow, error)
- func (a AppSrv) GetUserAccessible(uid uint, isCenterMember bool) ([]dto.AppGroupClassified, error)
- func (a AppSrv) GetUserOwnedApp(uid uint) ([]dto.AppShowDetail, error)
- func (a AppSrv) NameExist(name string, opts ...daoUtil.ServiceOpt) (bool, error)
- func (a AppSrv) New(uid uint, name, callback string, permitAll bool) (*dao.App, error)
- func (a AppSrv) This(host string) *dao.App
- func (a AppSrv) UpdateAll(id uint, name, callback string, permitAllGroup bool) error
- func (a AppSrv) UpdateLinkOff(uid, id uint, linkOff bool) error
- func (a AppSrv) UpdateViews(id, viewsID uint, views uint64) error
- func (a AppSrv) UserAccessible(id, uid uint) (bool, error)
- type BaseGroupsSrv
- func (a BaseGroupsSrv) Begin() (BaseGroupsSrv, error)
- func (a BaseGroupsSrv) CreateGroups(groups []dao.BaseGroup) error
- func (a BaseGroupsSrv) LoadGroups() ([]dao.BaseGroup, error)
- func (a BaseGroupsSrv) LoadGroupsForShow() ([]dto.Group, error)
- func (a BaseGroupsSrv) LoadGroupsRelation() (map[string]dao.BaseGroup, error)
- type FeishuGroupsSrv
- func (a FeishuGroupsSrv) Begin() (FeishuGroupsSrv, error)
- func (a FeishuGroupsSrv) CreateAll(data []dao.FeishuGroups) error
- func (a FeishuGroupsSrv) DeleteSelected(ids []uint) error
- func (a FeishuGroupsSrv) GetAll(opts ...daoUtil.ServiceOpt) ([]dao.FeishuGroups, error)
- func (a FeishuGroupsSrv) GetByOpenID(openID []string, opts ...daoUtil.ServiceOpt) ([]dao.FeishuGroups, error)
- func (a FeishuGroupsSrv) GetGroupMap(opts ...daoUtil.ServiceOpt) (map[string]uint, error)
- func (a FeishuGroupsSrv) Search(openID []string) ([]dao.BaseGroup, error)
- type LoginRecordSrv
- func (a LoginRecordSrv) Add(uid, appID uint, ip string) error
- func (a LoginRecordSrv) Begin() (*LoginRecordSrv, error)
- func (a LoginRecordSrv) GetMultipleViewsIDs(apps []dao.App) ([]dto.ViewID, error)
- func (a LoginRecordSrv) GetViewIDs(aid, startAt uint) ([]uint, error)
- func (a LoginRecordSrv) UserHistory(uid uint, limit int) ([]dto.LoginRecord, error)
- type SiteWhiteListSrv
- type UserGroupsSrv
- func (a UserGroupsSrv) Begin() (UserGroupsSrv, error)
- func (a UserGroupsSrv) CreateAll(data []dao.UserGroups) error
- func (a UserGroupsSrv) DeleteByIDSlice(id []uint) error
- func (a UserGroupsSrv) DeleteNotInGidSliceByUID(uid uint, id []uint) *gorm.DB
- func (a UserGroupsSrv) GetAll() ([]dao.UserGroups, error)
- func (a UserGroupsSrv) GetForAppCode(uid uint, appCode string) ([]string, error)
- func (a UserGroupsSrv) GetIdsForUser(uid uint) ([]uint, error)
- func (a UserGroupsSrv) GetNamesForUser(uid uint) ([]string, error)
- func (a UserGroupsSrv) IsUnitMember(uid uint, Unit string) (bool, error)
- type UserSrv
- func (a UserSrv) Begin() (UserSrv, error)
- func (a UserSrv) CreateAll(users []dao.User) error
- func (a UserSrv) DelMfa(id uint) error
- func (a UserSrv) FirstByPhone(phone string, opts ...daoUtil.ServiceOpt) (*dao.User, error)
- func (a UserSrv) FirstMfa(id uint, opts ...daoUtil.ServiceOpt) (string, error)
- func (a UserSrv) FirstPhoneByID(id uint) (string, error)
- func (a UserSrv) FrozeByIDSlice(id []uint) error
- func (a UserSrv) FrozeByPhone(phone string) *gorm.DB
- func (a UserSrv) GetUnscopedUserByPhoneSlice(phone []string) ([]dao.User, error)
- func (a UserSrv) GetUserNotInPhoneSlice(phone []string) ([]dao.User, error)
- func (a UserSrv) MfaExist(id uint, opts ...daoUtil.ServiceOpt) (bool, error)
- func (a UserSrv) SetMfaSecret(id uint, secret string) error
- func (a UserSrv) U2fStatus(id uint) (*dto.UserU2fStatus, error)
- func (a UserSrv) UnFrozeByIDSlice(id []uint) error
- func (a UserSrv) UpdateUserPreferU2F(id uint, prefer string) error
- func (a UserSrv) UserInfoByID(id uint) (*dao.User, error)
- func (a UserSrv) UserProfile(id uint) (*dto.UserProfile, error)
- type UserSshSrv
- func (a UserSshSrv) Begin() (UserSshSrv, error)
- func (a UserSshSrv) CreateAll(data []dao.UserSsh) error
- func (a UserSshSrv) DeleteInvalid() ([]dao.UserSsh, error)
- func (a UserSshSrv) Exist(uid uint, opt ...daoUtil.ServiceOpt) (bool, error)
- func (a UserSshSrv) FirstSshSecretsForUserShow(uid uint) (*dto.SshSecrets, error)
- func (a UserSshSrv) GetAllExist() ([]dto.SshDeploy, error)
- func (a UserSshSrv) GetToCreateUid() ([]uint, error)
- func (a UserSshSrv) UpdateKeys(uid uint, publicPem, privatePem, publicSsh, privateSsh string) error
- type WebAuthnSrv
- func (a WebAuthnSrv) Add(uid uint, cred *webauthn.Credential) (*dto.UserCredential, error)
- func (a WebAuthnSrv) Begin() (WebAuthnSrv, error)
- func (a WebAuthnSrv) Delete(id, uid uint) error
- func (a WebAuthnSrv) Exist(id, uid uint, opt ...daoUtil.ServiceOpt) (bool, error)
- func (a WebAuthnSrv) GetCredentials(uid uint) ([]webauthn.Credential, error)
- func (a WebAuthnSrv) ListUserCredForShow(uid uint) ([]dto.UserCredential, error)
- func (a WebAuthnSrv) Rename(id uint, name string) error
- func (a WebAuthnSrv) UpdateLastUsedAt(uid uint, rawId string) error
- func (a WebAuthnSrv) UserName(id uint) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var App = AppSrv{dao.DB}
View Source
var AppGroup = AppGroupSrv{dao.DB}
View Source
var BaseGroups = BaseGroupsSrv{dao.DB}
View Source
var FeishuGroups = FeishuGroupsSrv{dao.DB}
View Source
var LoginRecord = LoginRecordSrv{dao.DB}
View Source
var SiteWhiteList = SiteWhiteListSrv{dao.DB}
View Source
var User = UserSrv{dao.DB}
View Source
var UserGroups = UserGroupsSrv{dao.DB}
View Source
var UserSsh = UserSshSrv{dao.DB}
View Source
var WebAuthn = WebAuthnSrv{dao.DB}
Functions ¶
This section is empty.
Types ¶
type AppGroupSrv ¶
func (AppGroupSrv) Begin ¶
func (a AppGroupSrv) Begin() (AppGroupSrv, error)
func (AppGroupSrv) BindForApp ¶
func (AppGroupSrv) DeleteAllForApp ¶
func (a AppGroupSrv) DeleteAllForApp(aid uint) error
func (AppGroupSrv) UnBindForApp ¶
func (a AppGroupSrv) UnBindForApp(aid uint, groupIds []uint) error
type AppSrv ¶
func (AppSrv) DeleteByID ¶
func (AppSrv) FirstAppByAppCode ¶
func (AppSrv) FirstAppCodeByID ¶
func (AppSrv) FirstAppDetailedByIDForUser ¶
func (a AppSrv) FirstAppDetailedByIDForUser(id, uid uint, opts ...daoUtil.ServiceOpt) (*dto.AppShowDetail, error)
func (AppSrv) GetForUpdateViews ¶
func (AppSrv) GetUserAccessible ¶
func (AppSrv) GetUserOwnedApp ¶
func (a AppSrv) GetUserOwnedApp(uid uint) ([]dto.AppShowDetail, error)
type BaseGroupsSrv ¶
func (BaseGroupsSrv) Begin ¶
func (a BaseGroupsSrv) Begin() (BaseGroupsSrv, error)
func (BaseGroupsSrv) CreateGroups ¶
func (a BaseGroupsSrv) CreateGroups(groups []dao.BaseGroup) error
func (BaseGroupsSrv) LoadGroups ¶
func (a BaseGroupsSrv) LoadGroups() ([]dao.BaseGroup, error)
func (BaseGroupsSrv) LoadGroupsForShow ¶
func (a BaseGroupsSrv) LoadGroupsForShow() ([]dto.Group, error)
func (BaseGroupsSrv) LoadGroupsRelation ¶
func (a BaseGroupsSrv) LoadGroupsRelation() (map[string]dao.BaseGroup, error)
type FeishuGroupsSrv ¶
func (FeishuGroupsSrv) Begin ¶
func (a FeishuGroupsSrv) Begin() (FeishuGroupsSrv, error)
func (FeishuGroupsSrv) CreateAll ¶
func (a FeishuGroupsSrv) CreateAll(data []dao.FeishuGroups) error
func (FeishuGroupsSrv) DeleteSelected ¶
func (a FeishuGroupsSrv) DeleteSelected(ids []uint) error
func (FeishuGroupsSrv) GetAll ¶
func (a FeishuGroupsSrv) GetAll(opts ...daoUtil.ServiceOpt) ([]dao.FeishuGroups, error)
func (FeishuGroupsSrv) GetByOpenID ¶
func (a FeishuGroupsSrv) GetByOpenID(openID []string, opts ...daoUtil.ServiceOpt) ([]dao.FeishuGroups, error)
func (FeishuGroupsSrv) GetGroupMap ¶
func (a FeishuGroupsSrv) GetGroupMap(opts ...daoUtil.ServiceOpt) (map[string]uint, error)
type LoginRecordSrv ¶
func (LoginRecordSrv) Begin ¶
func (a LoginRecordSrv) Begin() (*LoginRecordSrv, error)
func (LoginRecordSrv) GetMultipleViewsIDs ¶
func (LoginRecordSrv) GetViewIDs ¶
func (a LoginRecordSrv) GetViewIDs(aid, startAt uint) ([]uint, error)
func (LoginRecordSrv) UserHistory ¶
func (a LoginRecordSrv) UserHistory(uid uint, limit int) ([]dto.LoginRecord, error)
type SiteWhiteListSrv ¶
func (SiteWhiteListSrv) Begin ¶
func (a SiteWhiteListSrv) Begin() (*SiteWhiteListSrv, error)
type UserGroupsSrv ¶
func (UserGroupsSrv) Begin ¶
func (a UserGroupsSrv) Begin() (UserGroupsSrv, error)
func (UserGroupsSrv) CreateAll ¶
func (a UserGroupsSrv) CreateAll(data []dao.UserGroups) error
func (UserGroupsSrv) DeleteByIDSlice ¶
func (a UserGroupsSrv) DeleteByIDSlice(id []uint) error
func (UserGroupsSrv) DeleteNotInGidSliceByUID ¶
func (a UserGroupsSrv) DeleteNotInGidSliceByUID(uid uint, id []uint) *gorm.DB
func (UserGroupsSrv) GetAll ¶
func (a UserGroupsSrv) GetAll() ([]dao.UserGroups, error)
func (UserGroupsSrv) GetForAppCode ¶
func (a UserGroupsSrv) GetForAppCode(uid uint, appCode string) ([]string, error)
func (UserGroupsSrv) GetIdsForUser ¶
func (a UserGroupsSrv) GetIdsForUser(uid uint) ([]uint, error)
func (UserGroupsSrv) GetNamesForUser ¶
func (a UserGroupsSrv) GetNamesForUser(uid uint) ([]string, error)
func (UserGroupsSrv) IsUnitMember ¶ added in v1.16.14
func (a UserGroupsSrv) IsUnitMember(uid uint, Unit string) (bool, error)
IsUnitMember 是否是指定组组员
type UserSrv ¶
func (UserSrv) FirstByPhone ¶
func (UserSrv) FrozeByIDSlice ¶
func (UserSrv) GetUnscopedUserByPhoneSlice ¶
func (UserSrv) GetUserNotInPhoneSlice ¶
func (UserSrv) UnFrozeByIDSlice ¶
func (UserSrv) UpdateUserPreferU2F ¶
func (UserSrv) UserProfile ¶
func (a UserSrv) UserProfile(id uint) (*dto.UserProfile, error)
type UserSshSrv ¶
func (UserSshSrv) Begin ¶
func (a UserSshSrv) Begin() (UserSshSrv, error)
func (UserSshSrv) DeleteInvalid ¶
func (a UserSshSrv) DeleteInvalid() ([]dao.UserSsh, error)
func (UserSshSrv) Exist ¶
func (a UserSshSrv) Exist(uid uint, opt ...daoUtil.ServiceOpt) (bool, error)
func (UserSshSrv) FirstSshSecretsForUserShow ¶
func (a UserSshSrv) FirstSshSecretsForUserShow(uid uint) (*dto.SshSecrets, error)
func (UserSshSrv) GetAllExist ¶
func (a UserSshSrv) GetAllExist() ([]dto.SshDeploy, error)
func (UserSshSrv) GetToCreateUid ¶
func (a UserSshSrv) GetToCreateUid() ([]uint, error)
GetToCreateUid 获取没有生成 ssh 账号的 uid
func (UserSshSrv) UpdateKeys ¶
func (a UserSshSrv) UpdateKeys(uid uint, publicPem, privatePem, publicSsh, privateSsh string) error
type WebAuthnSrv ¶
func (WebAuthnSrv) Add ¶
func (a WebAuthnSrv) Add(uid uint, cred *webauthn.Credential) (*dto.UserCredential, error)
func (WebAuthnSrv) Begin ¶
func (a WebAuthnSrv) Begin() (WebAuthnSrv, error)
func (WebAuthnSrv) Delete ¶
func (a WebAuthnSrv) Delete(id, uid uint) error
func (WebAuthnSrv) Exist ¶
func (a WebAuthnSrv) Exist(id, uid uint, opt ...daoUtil.ServiceOpt) (bool, error)
func (WebAuthnSrv) GetCredentials ¶
func (a WebAuthnSrv) GetCredentials(uid uint) ([]webauthn.Credential, error)
func (WebAuthnSrv) ListUserCredForShow ¶
func (a WebAuthnSrv) ListUserCredForShow(uid uint) ([]dto.UserCredential, error)
func (WebAuthnSrv) UpdateLastUsedAt ¶
func (a WebAuthnSrv) UpdateLastUsedAt(uid uint, rawId string) error
Click to show internal directories.
Click to hide internal directories.