Documentation ¶
Index ¶
- type CommonService
- func (c CommonService) AppAuthorization(ctx context.Context, key string, secret string) (id string, err error)
- func (c CommonService) Authorization(ctx context.Context, roles []string, method string) bool
- func (c CommonService) AutoMigrate(ctx context.Context) error
- func (c CommonService) BatchPatchI18n(ctx context.Context, i18ns []models.I18nTranslate) (err error)
- func (c CommonService) CreateAppKey(ctx context.Context, appId, name string) (*models.AppKey, error)
- func (c CommonService) CreateOrUpdateRoleByName(ctx context.Context, role *models.Role) error
- func (c CommonService) CreatePage(ctx context.Context, page *models.PageConfig) error
- func (c *CommonService) CreatePageData(ctx context.Context, pageId string, data *json.RawMessage) error
- func (c *CommonService) CreateRole(ctx context.Context, role *models.Role) (err error)
- func (c *CommonService) CreateTOTP(ctx context.Context, id string, secret string) error
- func (c *CommonService) DeleteAppAccessControl(ctx context.Context, ids ...string) error
- func (c CommonService) DeleteAppKeys(ctx context.Context, appId string, id []string) (affected int64, err error)
- func (c *CommonService) DeleteAppProxy(ctx context.Context, ids ...string) error
- func (c *CommonService) DeleteI18nBySourceId(ctx context.Context, ids ...string) error
- func (c CommonService) DeletePages(ctx context.Context, ids []string) error
- func (c CommonService) DeleteRoles(ctx context.Context, ids []string) error
- func (c CommonService) FindAppByKeywords(ctx context.Context, keywords string, skip int64, limit int64) (ids []string, count int64)
- func (c CommonService) GetAppAccessControl(ctx context.Context, appId string, o ...opts.WithGetAppOptions) (users models.AppUsers, roles models.AppRoles, err error)
- func (c CommonService) GetAppKeyFromKey(ctx context.Context, key string) (*models.AppKey, error)
- func (c CommonService) GetAppKeys(ctx context.Context, appId string, current, pageSize int64) (count int64, keyPairs []*models.AppKey, err error)
- func (c CommonService) GetAppOAuthConfig(ctx context.Context, id string) (*models.AppOAuth2, error)
- func (c CommonService) GetAppProxyConfig(ctx context.Context, appId string) (proxy *models.AppProxy, err error)
- func (c CommonService) GetAppRoleByUserId(ctx context.Context, appId string, userId string) (role *models.AppRole, err error)
- func (c CommonService) GetAppRoles(ctx context.Context, appId string) (roles models.AppRoles, err error)
- func (c CommonService) GetFileInfoFromId(ctx context.Context, id string) (fileName, mimiType, filePath string, err error)
- func (c CommonService) GetFilesByOwner(ctx context.Context, owner string, current int64, pageSize int64) (count int64, files []*models.Model, err error)
- func (c *CommonService) GetI18n(ctx context.Context, source string, sourceId string, field string) (map[string]string, error)
- func (c *CommonService) GetPage(ctx context.Context, id string) (cfg *models.PageConfig, err error)
- func (c *CommonService) GetPageData(ctx context.Context, pageId string, id string) (*models.PageData, error)
- func (c *CommonService) GetPageDatas(ctx context.Context, filters map[string]string, keywords string, current int64, ...) (count int64, datas []*models.PageData, err error)
- func (c CommonService) GetPages(ctx context.Context, filter map[string]interface{}, keywords string, ...) (count int64, pages []*models.PageConfig, err error)
- func (c CommonService) GetPermissions(ctx context.Context, keywords string, current int64, pageSize int64) (count int64, permissions []*models.Permission, err error)
- func (c CommonService) GetProxyConfig(ctx context.Context, host string) (*models.AppProxyConfig, error)
- func (c *CommonService) GetRoles(ctx context.Context, keywords string, current, pageSize int64) (count int64, roles []*models.Role, err error)
- func (c CommonService) GetSystemConfig(ctx context.Context, prefix string) (map[string]interface{}, error)
- func (c *CommonService) GetTOTPSecrets(ctx context.Context, ids []string) (secrets []string, err error)
- func (c *CommonService) GetUserExtendedData(ctx context.Context, id string) (*models.UserExt, error)
- func (c *CommonService) GetUsersExtendedData(ctx context.Context, id []string) ([]*models.UserExt, error)
- func (c CommonService) InsertWeakPassword(ctx context.Context, passwords ...string) error
- func (c CommonService) Name() string
- func (c CommonService) PatchAppOAuthConfig(ctx context.Context, auth2 *models.AppOAuth2) error
- func (c CommonService) PatchAppRole(ctx context.Context, role *models.AppRole) error
- func (c *CommonService) PatchPageDatas(ctx context.Context, patch []models.PageData) error
- func (c *CommonService) PatchPages(ctx context.Context, patch []map[string]interface{}) error
- func (c CommonService) PatchSystemConfig(ctx context.Context, prefix string, patch map[string]interface{}) error
- func (c *CommonService) PatchUserExtData(ctx context.Context, id string, patch map[string]interface{}) error
- func (c CommonService) RecordUploadFile(ctx context.Context, name string, path string, contentType string, size int64) (id string, err error)
- func (c CommonService) RegisterPermission(ctx context.Context, permissions models.Permissions) error
- func (c CommonService) UpdateAppAccessControl(ctx context.Context, app *models.App) (err error)
- func (c CommonService) UpdateAppProxyConfig(ctx context.Context, proxy *models.AppProxy) (err error)
- func (c CommonService) UpdateFileOwner(ctx context.Context, fileId string, owner string) (err error)
- func (c *CommonService) UpdateLoginTime(ctx context.Context, id string) error
- func (c CommonService) UpdatePage(ctx context.Context, page *models.PageConfig) error
- func (c *CommonService) UpdatePageData(ctx context.Context, pageId string, id string, data *json.RawMessage) error
- func (c *CommonService) UpdateRole(ctx context.Context, role *models.Role) (err error)
- func (c CommonService) UpdateUserAccessControl(ctx context.Context, userId string, apps models.Apps) (err error)
- func (c *CommonService) VerifyAndRecordHistoryPassword(ctx context.Context, id string, password string) error
- func (c CommonService) VerifyWeakPassword(ctx context.Context, password string) error
- type EventBuffers
- type LoggingService
- func (s *LoggingService) AutoMigrate(ctx context.Context) error
- func (s *LoggingService) GetEventLogs(ctx context.Context, filters map[string]string, keywords string, current int64, ...) (count int64, eventLogs []*models.EventLog, err error)
- func (s *LoggingService) GetEvents(ctx context.Context, filters map[string]string, keywords string, ...) (count int64, events []*models.Event, err error)
- func (s *LoggingService) Name() string
- func (s *LoggingService) PostEventLog(ctx context.Context, ...) error
- func (s *LoggingService) Pusher(ctx context.Context)
- type SessionService
- func (s SessionService) AutoMigrate(ctx context.Context) error
- func (s SessionService) Counter(ctx context.Context, seed string, expireTime *time.Time, num ...int64) (err error)
- func (s SessionService) CreateToken(ctx context.Context, token *models.Token) error
- func (s SessionService) DeleteToken(ctx context.Context, tokenType models.TokenType, id string) (err error)
- func (s SessionService) GetCounter(ctx context.Context, seed string) (count int64, err error)
- func (s SessionService) GetSessions(ctx context.Context, userId string, current, pageSize int64) (total int64, sessions []*models.Token, err error)
- func (s SessionService) GetToken(ctx context.Context, tokenId string, tokenType models.TokenType, ...) (*models.Token, error)
- func (s SessionService) Name() string
- func (s SessionService) RefreshOAuthTokenByAuthorizationCode(ctx context.Context, token, clientId, clientSecret string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s SessionService) RefreshOAuthTokenByPassword(ctx context.Context, token, username, password string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s SessionService) UpdateToken(ctx context.Context, token *models.Token) error
- func (s SessionService) UpdateTokenExpires(ctx context.Context, id string, expiry time.Time) error
- type UserAndAppService
- func (s UserAndAppService) AutoMigrate(ctx context.Context) error
- func (s UserAndAppService) CreateApp(ctx context.Context, app *models.App) (err error)
- func (s UserAndAppService) CreateUser(ctx context.Context, user *models.User) (err error)
- func (s UserAndAppService) DeleteApp(ctx context.Context, id string) (err error)
- func (s UserAndAppService) DeleteApps(ctx context.Context, id ...string) (total int64, err error)
- func (s UserAndAppService) DeleteUser(ctx context.Context, id string) (err error)
- func (s UserAndAppService) DeleteUsers(ctx context.Context, id []string) (int64, error)
- func (s UserAndAppService) GetAppInfo(ctx context.Context, options ...opts.WithGetAppOptions) (app *models.App, err error)
- func (s UserAndAppService) GetApps(ctx context.Context, keywords string, filters map[string]interface{}, ...) (total int64, apps []*models.App, err error)
- func (s UserAndAppService) GetUser(ctx context.Context, o *opts.GetUserOptions) (*models.User, error)
- func (s UserAndAppService) GetUserInfo(ctx context.Context, id string, username string) (*models.User, error)
- func (s UserAndAppService) GetUserInfoByUsernameAndEmail(ctx context.Context, username, email string) (user *models.User, err error)
- func (s UserAndAppService) GetUsers(ctx context.Context, keywords string, status models.UserMeta_UserStatus, ...) (total int64, users []*models.User, err error)
- func (s UserAndAppService) GetUsersById(ctx context.Context, id []string) (users models.Users, err error)
- func (s UserAndAppService) Name() string
- func (s UserAndAppService) PatchApp(ctx context.Context, fields map[string]interface{}) (err error)
- func (s UserAndAppService) PatchApps(ctx context.Context, patch []map[string]interface{}) (total int64, err error)
- func (s UserAndAppService) PatchUser(ctx context.Context, patch map[string]interface{}) (err error)
- func (s UserAndAppService) PatchUsers(ctx context.Context, patch []map[string]interface{}) (int64, error)
- func (s UserAndAppService) ResetPassword(ctx context.Context, ids string, password string) error
- func (s UserAndAppService) UpdateApp(ctx context.Context, app *models.App, updateColumns ...string) (err error)
- func (s UserAndAppService) UpdateUser(ctx context.Context, user *models.User, updateColumns ...string) (err error)
- func (s UserAndAppService) VerifyPassword(ctx context.Context, username string, password string) *models.User
- func (s UserAndAppService) VerifyPasswordById(ctx context.Context, id, password string) *models.User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonService ¶
func NewCommonService ¶
func NewCommonService(name string, client *gorm.Client) *CommonService
func (CommonService) AppAuthorization ¶
func (CommonService) Authorization ¶
func (CommonService) AutoMigrate ¶
func (c CommonService) AutoMigrate(ctx context.Context) error
func (CommonService) BatchPatchI18n ¶
func (c CommonService) BatchPatchI18n(ctx context.Context, i18ns []models.I18nTranslate) (err error)
func (CommonService) CreateAppKey ¶
func (CommonService) CreateOrUpdateRoleByName ¶
func (CommonService) CreatePage ¶
func (c CommonService) CreatePage(ctx context.Context, page *models.PageConfig) error
func (*CommonService) CreatePageData ¶
func (c *CommonService) CreatePageData(ctx context.Context, pageId string, data *json.RawMessage) error
func (*CommonService) CreateRole ¶
func (*CommonService) CreateTOTP ¶
func (*CommonService) DeleteAppAccessControl ¶
func (c *CommonService) DeleteAppAccessControl(ctx context.Context, ids ...string) error
func (CommonService) DeleteAppKeys ¶
func (*CommonService) DeleteAppProxy ¶
func (c *CommonService) DeleteAppProxy(ctx context.Context, ids ...string) error
func (*CommonService) DeleteI18nBySourceId ¶
func (c *CommonService) DeleteI18nBySourceId(ctx context.Context, ids ...string) error
func (CommonService) DeletePages ¶
func (c CommonService) DeletePages(ctx context.Context, ids []string) error
func (CommonService) DeleteRoles ¶
func (c CommonService) DeleteRoles(ctx context.Context, ids []string) error
func (CommonService) FindAppByKeywords ¶ added in v1.4.0
func (CommonService) GetAppAccessControl ¶
func (CommonService) GetAppKeyFromKey ¶
func (CommonService) GetAppKeys ¶
func (CommonService) GetAppOAuthConfig ¶ added in v1.4.0
func (CommonService) GetAppProxyConfig ¶
func (CommonService) GetAppRoleByUserId ¶
func (CommonService) GetAppRoles ¶
func (CommonService) GetFileInfoFromId ¶
func (CommonService) GetFilesByOwner ¶
func (*CommonService) GetPage ¶
func (c *CommonService) GetPage(ctx context.Context, id string) (cfg *models.PageConfig, err error)
func (*CommonService) GetPageData ¶
func (*CommonService) GetPageDatas ¶
func (CommonService) GetPermissions ¶
func (c CommonService) GetPermissions(ctx context.Context, keywords string, current int64, pageSize int64) (count int64, permissions []*models.Permission, err error)
func (CommonService) GetProxyConfig ¶
func (c CommonService) GetProxyConfig(ctx context.Context, host string) (*models.AppProxyConfig, error)
func (CommonService) GetSystemConfig ¶
func (*CommonService) GetTOTPSecrets ¶
func (*CommonService) GetUserExtendedData ¶
func (*CommonService) GetUsersExtendedData ¶
func (CommonService) InsertWeakPassword ¶
func (c CommonService) InsertWeakPassword(ctx context.Context, passwords ...string) error
func (CommonService) Name ¶
func (c CommonService) Name() string
func (CommonService) PatchAppOAuthConfig ¶ added in v1.4.0
func (CommonService) PatchAppRole ¶
PatchAppRole
@Description[en-US]: Update App Role. @Description[zh-CN]: 更新应用角色。 @param ctx context.Context @param dn string @param patch *models.AppRole @return err error
func (*CommonService) PatchPageDatas ¶
func (*CommonService) PatchPages ¶
func (c *CommonService) PatchPages(ctx context.Context, patch []map[string]interface{}) error
func (CommonService) PatchSystemConfig ¶
func (*CommonService) PatchUserExtData ¶
func (CommonService) RecordUploadFile ¶
func (CommonService) RegisterPermission ¶
func (c CommonService) RegisterPermission(ctx context.Context, permissions models.Permissions) error
func (CommonService) UpdateAppAccessControl ¶
func (CommonService) UpdateAppProxyConfig ¶
func (CommonService) UpdateFileOwner ¶
func (*CommonService) UpdateLoginTime ¶
func (c *CommonService) UpdateLoginTime(ctx context.Context, id string) error
UpdateLoginTime
@Description[en-US]: Update the user's last login time. @Description[zh-CN]: 更新用户最后一次登陆时间。 @param ctx context.Context @param id string @return error
func (CommonService) UpdatePage ¶
func (c CommonService) UpdatePage(ctx context.Context, page *models.PageConfig) error
func (*CommonService) UpdatePageData ¶
func (c *CommonService) UpdatePageData(ctx context.Context, pageId string, id string, data *json.RawMessage) error
func (*CommonService) UpdateRole ¶
func (CommonService) UpdateUserAccessControl ¶
func (*CommonService) VerifyAndRecordHistoryPassword ¶
func (CommonService) VerifyWeakPassword ¶
func (c CommonService) VerifyWeakPassword(ctx context.Context, password string) error
type EventBuffers ¶
type EventBuffers struct {
// contains filtered or unexported fields
}
type LoggingService ¶
func NewLoggingService ¶
func (*LoggingService) AutoMigrate ¶
func (s *LoggingService) AutoMigrate(ctx context.Context) error
func (*LoggingService) GetEventLogs ¶
func (*LoggingService) Name ¶
func (s *LoggingService) Name() string
func (*LoggingService) PostEventLog ¶
func (*LoggingService) Pusher ¶
func (s *LoggingService) Pusher(ctx context.Context)
type SessionService ¶
func NewSessionService ¶
func (SessionService) AutoMigrate ¶
func (s SessionService) AutoMigrate(ctx context.Context) error
func (SessionService) CreateToken ¶
func (SessionService) DeleteToken ¶
func (SessionService) GetCounter ¶
func (SessionService) GetSessions ¶
func (SessionService) Name ¶
func (s SessionService) Name() string
func (SessionService) RefreshOAuthTokenByAuthorizationCode ¶
func (SessionService) RefreshOAuthTokenByPassword ¶
func (SessionService) UpdateToken ¶
func (SessionService) UpdateTokenExpires ¶
type UserAndAppService ¶
func NewUserAndAppService ¶
func (UserAndAppService) AutoMigrate ¶
func (s UserAndAppService) AutoMigrate(ctx context.Context) error
func (UserAndAppService) CreateApp ¶
CreateApp
@Description[en-US]: Create an app. @Description[zh-CN]: 创建应用 @param ctx context.Context @param app *models.App @return error
func (UserAndAppService) CreateUser ¶
CreateUser
@Description[en-US]: Create a user. @Description[zh-CN]: 创建用户。 @param ctx context.Context @param user *models.User @return err error
func (UserAndAppService) DeleteApp ¶
func (s UserAndAppService) DeleteApp(ctx context.Context, id string) (err error)
DeleteApp
@Description[en-US]: Delete an app. @Description[zh-CN]: 删除应用。 @param ctx context.Context @param id string @return err error
func (UserAndAppService) DeleteApps ¶
DeleteApps
@Description[en-US]: Delete apps in batch. @Description[zh-CN]: 批量删除应用。 @param ctx context.Context @param ids []string : ID List @return total int64 @return err error
func (UserAndAppService) DeleteUser ¶
func (s UserAndAppService) DeleteUser(ctx context.Context, id string) (err error)
DeleteUser
@Description[en-US]: Delete a user. @Description[zh-CN]: 删除用户。 @param ctx context.Context @param id string @return error
func (UserAndAppService) DeleteUsers ¶
DeleteUsers
@Description[en-US]: Delete users in batch. @Description[zh-CN]: 批量删除用户。 @param ctx context.Context @param ids []string @return count int64 @return err error
func (UserAndAppService) GetAppInfo ¶
func (s UserAndAppService) GetAppInfo(ctx context.Context, options ...opts.WithGetAppOptions) (app *models.App, err error)
GetAppInfo
@Description[en-US]: Use the ID or application name to get app info. @Description[zh-CN]: 使用ID或应用名称获取应用信息。 @param ctx context.Context @param id string : App ID @param name string : App Name @return app *models.App : App Details @return err error
func (UserAndAppService) GetApps ¶
func (s UserAndAppService) GetApps(ctx context.Context, keywords string, filters map[string]interface{}, current, pageSize int64) (total int64, apps []*models.App, err error)
GetApps
@Description[en-US]: Get the application list. The application information does not include agent, role, user and other information. @Description[zh-CN]: 获取应用列表,应用信息中不包含代理、角色、用户等信息。 @param ctx context.Context @param keywords string @param current int64 @param pageSize int64 @return total int64 @return apps []*models.App @return err error
func (UserAndAppService) GetUser ¶
func (s UserAndAppService) GetUser(ctx context.Context, o *opts.GetUserOptions) (*models.User, error)
GetUser
@Description[en-US]: Get user info. @Description[zh-CN]: 获取用户信息 @param ctx context.Context @param options opts.GetUserOptions @return userDetail *models.User @return err error
func (UserAndAppService) GetUserInfo ¶
func (s UserAndAppService) GetUserInfo(ctx context.Context, id string, username string) (*models.User, error)
GetUserInfo
@Description[en-US]: Obtain user information through ID or username. @Description[zh-CN]: 通过ID或用户名获取用户信息。 @param ctx context.Context @param id string @param username string @return userDetail *models.User @return err error
func (UserAndAppService) GetUserInfoByUsernameAndEmail ¶
func (s UserAndAppService) GetUserInfoByUsernameAndEmail(ctx context.Context, username, email string) (user *models.User, err error)
GetUserInfoByUsernameAndEmail
@Description[en-US]: Use username or email to obtain user information. @Description[zh-CN]: 使用用户名或email获取用户信息。 @param ctx context.Context @param username string @param email string @return user *models.User @return err error
func (UserAndAppService) GetUsers ¶
func (s UserAndAppService) GetUsers(ctx context.Context, keywords string, status models.UserMeta_UserStatus, appId string, current, pageSize int64) (total int64, users []*models.User, err error)
GetUsers
@Description[en-US]: Get user list. @Description[zh-CN]: 获取用户列表。 @param ctx context.Context @param keywords string @param status models.UserMeta_UserStatus @param appId string @param current int64 @param pageSize int64 @return total int64 @return users []*models.User @return err error
func (UserAndAppService) GetUsersById ¶
func (UserAndAppService) Name ¶
func (s UserAndAppService) Name() string
func (UserAndAppService) PatchApp ¶
func (s UserAndAppService) PatchApp(ctx context.Context, fields map[string]interface{}) (err error)
PatchApp
@Description[en-US]: Incremental update application. @Description[zh-CN]: 增量更新应用。 @param ctx context.Context @param fields map[string]interface{} @return err error
func (UserAndAppService) PatchApps ¶
func (s UserAndAppService) PatchApps(ctx context.Context, patch []map[string]interface{}) (total int64, err error)
PatchApps
@Description[en-US]: Incrementally update information of multiple applications. @Description[zh-CN]: 增量更新多个应用的信息。 @param ctx context.Context @param patch []map[string]interface{} @return total int64 @return err error
func (UserAndAppService) PatchUser ¶
func (s UserAndAppService) PatchUser(ctx context.Context, patch map[string]interface{}) (err error)
PatchUser
@Description[en-US]: Incremental update user. @Description[zh-CN]: 增量更新用户。 @param ctx context.Context @param user map[string]interface{} @return err error
func (UserAndAppService) PatchUsers ¶
func (s UserAndAppService) PatchUsers(ctx context.Context, patch []map[string]interface{}) (int64, error)
PatchUsers
@Description[en-US]: Incrementally update information of multiple users. @Description[zh-CN]: 增量更新多个用户的信息。 @param ctx context.Context @param patch []map[string]interface{} @return count int64 @return err error
func (UserAndAppService) ResetPassword ¶
ResetPassword
@Description[en-US]: Reset User Password. @Description[zh-CN]: 重置用户密码。 @param ctx context.Context @param id string @param password string : New password. @return err error
func (UserAndAppService) UpdateApp ¶
func (s UserAndAppService) UpdateApp(ctx context.Context, app *models.App, updateColumns ...string) (err error)
UpdateApp
@Description[en-US]: Update applies the value of the specified column. If no column is specified, all column information is updated. @Description[zh-CN]: 更新应用指定列的值,如果未指定列,则表示更新所有列信息。 @param ctx context.Context @param app *models.App @param updateColumns ...string @return err error
func (UserAndAppService) UpdateUser ¶
func (s UserAndAppService) UpdateUser(ctx context.Context, user *models.User, updateColumns ...string) (err error)
UpdateUser
@Description[en-US]: Update user information. @Description[zh-CN]: 更新用户信息. @param ctx context.Context @param user *models.User @param updateColumns ...string @return err error
func (UserAndAppService) VerifyPassword ¶
func (s UserAndAppService) VerifyPassword(ctx context.Context, username string, password string) *models.User
VerifyPassword
@Description[en-US]: Verify password for user. @Description[zh-CN]: 验证用户密码。 @param ctx context.Context @param username string @param password string @return users []*models.User
func (UserAndAppService) VerifyPasswordById ¶
func (s UserAndAppService) VerifyPasswordById(ctx context.Context, id, password string) *models.User
VerifyPasswordById
@Description[en-US]: Verify the user's password through ID. @Description[zh-CN]: 通过ID验证用户密码。 @param ctx context.Context @param id string @param password string @return users []*models.User
Click to show internal directories.
Click to hide internal directories.