Documentation ¶
Index ¶
- type Alarm
- type AlarmGroup
- type AlarmHook
- type AlarmPage
- type Cache
- type Captcha
- type Dashboard
- type Datasource
- type DatasourceMetric
- type Department
- type Dict
- type Lock
- type Menu
- type Metric
- type Msg
- type OAuth
- type Resource
- type Strategy
- type StrategyCountRepo
- type StrategyGroup
- type SubscriberStrategy
- type Team
- type TeamMenu
- type TeamRole
- type Template
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alarm ¶
type Alarm interface { // GetRealTimeAlarm 获取实时告警 GetRealTimeAlarm(ctx context.Context, params *bo.GetRealTimeAlarmParams) (*bizmodel.RealtimeAlarm, error) // GetRealTimeAlarms 获取实时告警列表 GetRealTimeAlarms(ctx context.Context, params *bo.GetRealTimeAlarmsParams) ([]*bizmodel.RealtimeAlarm, error) }
Alarm 告警相关接口定义
type AlarmGroup ¶
type AlarmGroup interface { // CreateAlarmGroup 创建告警组 CreateAlarmGroup(context.Context, *bo.CreateAlarmNoticeGroupParams) (*bizmodel.AlarmNoticeGroup, error) // UpdateAlarmGroup 更新告警组 UpdateAlarmGroup(context.Context, *bo.UpdateAlarmNoticeGroupParams) error // DeleteAlarmGroup 删除告警组 DeleteAlarmGroup(context.Context, uint32) error // GetAlarmGroup 获取告警详情 GetAlarmGroup(context.Context, uint32) (*bizmodel.AlarmNoticeGroup, error) // AlarmGroupPage 告警列表 AlarmGroupPage(context.Context, *bo.QueryAlarmNoticeGroupListParams) ([]*bizmodel.AlarmNoticeGroup, error) // UpdateStatus 更新状态 UpdateStatus(context.Context, *bo.UpdateAlarmNoticeGroupStatusParams) error // MyAlarmGroups 获取我的告警组 MyAlarmGroups(ctx context.Context, params *bo.MyAlarmGroupListParams) ([]*bizmodel.AlarmNoticeGroup, error) }
AlarmGroup 告警组接口
type AlarmHook ¶
type AlarmHook interface { // CreateAlarmHook 创建告警hook CreateAlarmHook(ctx context.Context, params *bo.CreateAlarmHookParams) (*bizmodel.AlarmHook, error) // UpdateAlarmHook 更新告警hook UpdateAlarmHook(ctx context.Context, params *bo.UpdateAlarmHookParams) error // DeleteAlarmHook 删除告警hook DeleteAlarmHook(ctx context.Context, ID uint32) error // GetAlarmHook 获取告警hook GetAlarmHook(ctx context.Context, ID uint32) (*bizmodel.AlarmHook, error) // ListAlarmHook 获取告警hook列表 ListAlarmHook(ctx context.Context, params *bo.QueryAlarmHookListParams) ([]*bizmodel.AlarmHook, error) // UpdateAlarmHookStatus 更新告警hook状态 UpdateAlarmHookStatus(ctx context.Context, params *bo.UpdateAlarmHookStatusParams) error }
AlarmHook 告警hook
type AlarmPage ¶
type AlarmPage interface { // ReplaceAlarmPages 批量替换告警页面 ReplaceAlarmPages(ctx context.Context, userID uint32, alarmPageIDs []uint32) error // ListAlarmPages 获取用户告警页面列表 ListAlarmPages(ctx context.Context, userID uint32) ([]*bizmodel.AlarmPageSelf, error) }
AlarmPage 告警页面管理
type Captcha ¶
type Captcha interface { // CreateCaptcha 创建验证码 CreateCaptcha(ctx context.Context, captcha *bo.ValidateCaptchaItem, duration time.Duration) error // GetCaptchaById 通过id获取验证码详情 GetCaptchaByID(ctx context.Context, id string) (*bo.ValidateCaptchaItem, error) }
Captcha 验证码接口
type Dashboard ¶
type Dashboard interface { // AddDashboard 添加仪表盘 AddDashboard(ctx context.Context, req *bo.AddDashboardParams) error // DeleteDashboard 删除仪表盘 DeleteDashboard(ctx context.Context, req *bo.DeleteDashboardParams) error // UpdateDashboard 更新仪表盘 UpdateDashboard(ctx context.Context, req *bo.UpdateDashboardParams) error // GetDashboard 获取仪表盘详情 GetDashboard(ctx context.Context, id uint32) (*bizmodel.Dashboard, error) // ListDashboard 获取仪表盘列表 ListDashboard(ctx context.Context, params *bo.ListDashboardParams) ([]*bizmodel.Dashboard, error) }
Dashboard 仪表盘相关操作接口
type Datasource ¶
type Datasource interface { // CreateDatasource 创建数据源 CreateDatasource(context.Context, *bo.CreateDatasourceParams) (*bizmodel.Datasource, error) // GetDatasource 获取数据源详情 GetDatasource(context.Context, uint32) (*bizmodel.Datasource, error) // GetDatasourceNoAuth 获取数据源详情(不鉴权) GetDatasourceNoAuth(context.Context, uint32, uint32) (*bizmodel.Datasource, error) // ListDatasource 获取数据源列表 ListDatasource(context.Context, *bo.QueryDatasourceListParams) ([]*bizmodel.Datasource, error) // UpdateDatasourceStatus 更新数据源状态 UpdateDatasourceStatus(context.Context, vobj.Status, ...uint32) error // UpdateDatasourceBaseInfo 更新数据源基础信息 UpdateDatasourceBaseInfo(context.Context, *bo.UpdateDatasourceBaseInfoParams) error // UpdateDatasourceConfig 更新数据源配置 UpdateDatasourceConfig(context.Context, *bo.UpdateDatasourceConfigParams) error // DeleteDatasourceByID 删除数据源 DeleteDatasourceByID(context.Context, uint32) error }
Datasource .
type DatasourceMetric ¶
type DatasourceMetric interface { // CreateMetrics 创建指标 CreateMetrics(context.Context, ...*bizmodel.DatasourceMetric) error // CreateMetricsNoAuth 创建指标(不鉴权) CreateMetricsNoAuth(context.Context, uint32, ...*bizmodel.DatasourceMetric) error }
DatasourceMetric 数据源指标接口
type Dict ¶
type Dict interface { // Create 创建字典 Create(context.Context, *bo.CreateDictParams) (imodel.IDict, error) // GetByID 通过id 获取字典详情 GetByID(context.Context, uint32) (imodel.IDict, error) // FindByPage 分页查询字典列表 FindByPage(context.Context, *bo.QueryDictListParams) ([]imodel.IDict, error) // DeleteByID 通过ID删除字典 DeleteByID(context.Context, uint32) error // UpdateStatusByIds 通过ID列表批量更新字典状态 UpdateStatusByIds(context.Context, *bo.UpdateDictStatusParams) error // UpdateByID 通过ID更新字典数据 UpdateByID(context.Context, *bo.UpdateDictParams) error }
Dict 字典接口
type Lock ¶
type Lock interface { // Lock 加锁 Lock(ctx context.Context, key string, expire time.Duration) error // UnLock 解锁 UnLock(ctx context.Context, key string) error }
Lock .
type Menu ¶
type Menu interface { // Create 创建系统菜单 Create(context.Context, *bo.CreateMenuParams) (*model.SysMenu, error) // BatchCreate 批量创建系统菜单 BatchCreate(context.Context, []*bo.CreateMenuParams) error // UpdateById 更新系统菜单 UpdateByID(context.Context, *bo.UpdateMenuParams) error // DeleteById 删除系统菜单 DeleteByID(context.Context, uint32) error // GetByID 根据id获取系统菜单 GetByID(context.Context, uint32) (*model.SysMenu, error) // FindByPage 分页查询系统菜单 FindByPage(context.Context, *bo.QueryMenuListParams) ([]*model.SysMenu, error) // ListAll 获取所有系统菜单 ListAll(context.Context) ([]*model.SysMenu, error) // UpdateStatusByIds 更新系统菜单状态 UpdateStatusByIds(context.Context, vobj.Status, ...uint32) error // UpdateTypeByIds 更新系统菜单类型 UpdateTypeByIds(context.Context, vobj.MenuType, ...uint32) error }
Menu 系统菜单接口
type Metric ¶
type Metric interface { // Get 查询指标详情 Get(context.Context, uint32) (*bizmodel.DatasourceMetric, error) // GetWithRelation 查询指标详情(关联其他属性) GetWithRelation(context.Context, uint32) (*bizmodel.DatasourceMetric, error) // Delete 删除指标 Delete(context.Context, uint32) error // List 查询指标列表 List(context.Context, *bo.QueryMetricListParams) ([]*bizmodel.DatasourceMetric, error) // Select 查询指标列表(不关联其他属性) Select(context.Context, *bo.QueryMetricListParams) ([]*bizmodel.DatasourceMetric, error) // Update 更新指标 Update(context.Context, *bo.UpdateMetricParams) error // MetricLabelCount 指标标签数量 MetricLabelCount(context.Context, uint32) (uint32, error) // CreateMetrics 创建指标 CreateMetrics(context.Context, uint32, *bizmodel.DatasourceMetric) error }
Metric .
type OAuth ¶
type OAuth interface { // OAuthUserFirstOrCreate 获取用户信息, 如果没有则创建 OAuthUserFirstOrCreate(context.Context, auth.IOAuthUser) (*model.SysUser, error) // SetEmail 设置电子邮箱 SetEmail(context.Context, uint32, string) (*model.SysUser, error) GetSysUserByOAuthID(context.Context, uint32, vobj.OAuthAPP) (*model.SysOAuthUser, error) SendVerifyEmail(ctx context.Context, email string) error CheckVerifyEmailCode(ctx context.Context, email, code string) error }
OAuth .
type Resource ¶
type Resource interface { // GetById get resource by id GetByID(context.Context, uint32) (*model.SysAPI, error) // FindByPage find resource by page FindByPage(context.Context, *bo.QueryResourceListParams) ([]*model.SysAPI, error) // UpdateStatus update resource status UpdateStatus(context.Context, vobj.Status, ...uint32) error // FindSelectByPage find select resource by page FindSelectByPage(context.Context, *bo.QueryResourceListParams) ([]*model.SysAPI, error) }
Resource 资源管理接口
type Strategy ¶
type Strategy interface { // CreateStrategy 创建策略 CreateStrategy(context.Context, *bo.CreateStrategyParams) (*bizmodel.Strategy, error) // UpdateByID 更新策略 UpdateByID(context.Context, *bo.UpdateStrategyParams) error // GetByID 获取策略详情 GetByID(context.Context, uint32) (*bizmodel.Strategy, error) // GetStrategyByIds 批量获取策略详情 GetStrategyByIds(context.Context, []uint32) ([]*bizmodel.Strategy, error) // UpdateStatus 更新状态 UpdateStatus(context.Context, *bo.UpdateStrategyStatusParams) error // FindByPage 策略分页列表 FindByPage(context.Context, *bo.QueryStrategyListParams) ([]*bizmodel.Strategy, error) // DeleteByID 删除策略 DeleteByID(context.Context, uint32) error // CopyStrategy 复制策略 CopyStrategy(context.Context, uint32) (*bizmodel.Strategy, error) // Eval 策略评估 Eval(context.Context, *bo.Strategy) (*bo.Alarm, error) }
Strategy 策略管理接口
type StrategyCountRepo ¶
type StrategyCountRepo interface { // FindStrategyCount 获取策略总数 FindStrategyCount(context.Context, *bo.GetStrategyCountParams) ([]*bo.StrategyCountModel, error) }
StrategyCountRepo 策略数量接口
type StrategyGroup ¶
type StrategyGroup interface { // CreateStrategyGroup 创建策略组 CreateStrategyGroup(context.Context, *bo.CreateStrategyGroupParams) (*bizmodel.StrategyGroup, error) // UpdateStrategyGroup 更新策略组 UpdateStrategyGroup(context.Context, *bo.UpdateStrategyGroupParams) error // DeleteStrategyGroup 删除策略组 DeleteStrategyGroup(context.Context, *bo.DelStrategyGroupParams) error // GetStrategyGroup 获取策略详情 GetStrategyGroup(context.Context, uint32) (*bizmodel.StrategyGroup, error) // StrategyGroupPage 策略列表 StrategyGroupPage(context.Context, *bo.QueryStrategyGroupListParams) ([]*bizmodel.StrategyGroup, error) // UpdateStatus 更新状态 UpdateStatus(context.Context, *bo.UpdateStrategyGroupStatusParams) error }
StrategyGroup 策略组接口
type SubscriberStrategy ¶
type SubscriberStrategy interface { // UserSubscriberStrategy 用户订阅策略 UserSubscriberStrategy(ctx context.Context, params *bo.SubscriberStrategyParams) error // UserUnSubscriberStrategy 用户取消订阅策略 UserUnSubscriberStrategy(ctx context.Context, params *bo.UnSubscriberStrategyParams) error // UserSubscriberStrategyList 用户订阅策略列表 UserSubscriberStrategyList(ctx context.Context, params *bo.QueryUserSubscriberParams) ([]*bizmodel.StrategySubscriber, error) // StrategySubscriberList 策略订阅用户列表 StrategySubscriberList(ctx context.Context, params *bo.QueryStrategySubscriberParams) ([]*bizmodel.StrategySubscriber, error) }
SubscriberStrategy 订阅仓库接口
type Team ¶
type Team interface { // GetUserTeamByID 查询用户指定团队信息 GetUserTeamByID(context.Context, uint32, uint32) (*bizmodel.SysTeamMember, error) // CreateTeam 创建团队 CreateTeam(context.Context, *bo.CreateTeamParams) (*model.SysTeam, error) // UpdateTeam 更新团队信息 UpdateTeam(context.Context, *bo.UpdateTeamParams) error // GetTeamDetail 获取团队详情 GetTeamDetail(context.Context, uint32) (*model.SysTeam, error) // GetTeamList 获取团队列表 GetTeamList(context.Context, *bo.QueryTeamListParams) ([]*model.SysTeam, error) // UpdateTeamStatus 修改团队状态 UpdateTeamStatus(context.Context, vobj.Status, ...uint32) error // GetUserTeamList 获取用户团队列表 GetUserTeamList(context.Context, uint32) ([]*model.SysTeam, error) // AddTeamMember 添加团队成员 AddTeamMember(context.Context, *bo.AddTeamMemberParams) error // RemoveTeamMember 移除团队成员 RemoveTeamMember(context.Context, *bo.RemoveTeamMemberParams) error // SetMemberAdmin 设置成员角色类型 SetMemberAdmin(context.Context, *bo.SetMemberAdminParams) error // SetMemberRole 设置成员角色类型 SetMemberRole(context.Context, *bo.SetMemberRoleParams) error // ListTeamMember 获取团队成员列表 ListTeamMember(context.Context, *bo.ListTeamMemberParams) ([]*bizmodel.SysTeamMember, error) // TransferTeamLeader 移交团队 TransferTeamLeader(context.Context, *bo.TransferTeamLeaderParams) error // GetTeamMailConfig 获取团队邮件配置 GetTeamMailConfig(context.Context, uint32) (*model.SysTeamEmail, error) // CreateTeamMailConfig 创建团队邮件配置 CreateTeamMailConfig(context.Context, *bo.SetTeamMailConfigParams) error // UpdateTeamMailConfig 更新团队邮件配置 UpdateTeamMailConfig(context.Context, *bo.SetTeamMailConfigParams) error }
Team 团队管理接口
type TeamMenu ¶
type TeamMenu interface {
GetTeamMenuList(context.Context, *bo.QueryTeamMenuListParams) ([]*bizmodel.SysTeamMenu, error)
}
TeamMenu 团队菜单接口
type TeamRole ¶
type TeamRole interface { // CreateTeamRole 创建团队角色 CreateTeamRole(context.Context, *bo.CreateTeamRoleParams) (*bizmodel.SysTeamRole, error) // UpdateTeamRole 更新团队角色 UpdateTeamRole(context.Context, *bo.UpdateTeamRoleParams) error // DeleteTeamRole 删除团队角色 DeleteTeamRole(context.Context, uint32) error // GetTeamRole 获取团队角色 GetTeamRole(context.Context, uint32) (*bizmodel.SysTeamRole, error) // ListTeamRole 获取团队角色列表 ListTeamRole(context.Context, *bo.ListTeamRoleParams) ([]*bizmodel.SysTeamRole, error) // GetTeamRoleByUserID 获取用户团队角色 GetTeamRoleByUserID(context.Context, uint32, uint32) ([]*bizmodel.SysTeamRole, error) // UpdateTeamRoleStatus 更新团队角色状态 UpdateTeamRoleStatus(context.Context, vobj.Status, ...uint32) error // CheckRbac 检查用户是否有权限 CheckRbac(context.Context, uint32, []uint32, string) (bool, error) }
TeamRole 团队角色接口
type Template ¶
type Template interface { // CreateTemplateStrategy 创建模板策略 CreateTemplateStrategy(ctx context.Context, templateStrategy *bo.CreateTemplateStrategyParams) error // UpdateTemplateStrategy 更新模板策略 UpdateTemplateStrategy(ctx context.Context, templateStrategy *bo.UpdateTemplateStrategyParams) error // DeleteTemplateStrategy 删除模板策略 DeleteTemplateStrategy(ctx context.Context, id uint32) error // GetTemplateStrategy 获取模板策略 GetTemplateStrategy(ctx context.Context, id uint32) (*model.StrategyTemplate, error) // ListTemplateStrategy 获取模板策略列表 ListTemplateStrategy(ctx context.Context, params *bo.QueryTemplateStrategyListParams) ([]*model.StrategyTemplate, error) // UpdateTemplateStrategyStatus 更新模板策略状态 UpdateTemplateStrategyStatus(ctx context.Context, status vobj.Status, ids ...uint32) error }
Template .
type User ¶
type User interface { // Create a user Create(ctx context.Context, user *bo.CreateUserParams) (*model.SysUser, error) // BatchCreate batch create user BatchCreate(ctx context.Context, users []*bo.CreateUserParams) error // GetByID get user by id GetByID(ctx context.Context, id uint32) (*model.SysUser, error) // GetByUsername get user by username GetByUsername(ctx context.Context, username string) (*model.SysUser, error) // GetByEmail get user by email GetByEmail(ctx context.Context, email string) (*model.SysUser, error) // UpdateByID update user by id UpdateByID(ctx context.Context, user *bo.UpdateUserParams) error // UpdateBaseByID update user base info by id UpdateBaseByID(ctx context.Context, user *bo.UpdateUserBaseParams) error // DeleteByID delete user by id DeleteByID(ctx context.Context, id uint32) error // UpdateStatusByIds update user status by ids UpdateStatusByIds(ctx context.Context, status vobj.Status, ids ...uint32) error // UpdatePassword update user password UpdatePassword(ctx context.Context, id uint32, password types.Password) error // FindByPage find user by page FindByPage(ctx context.Context, page *bo.QueryUserListParams) ([]*model.SysUser, error) // UpdateUser update user UpdateUser(ctx context.Context, user *model.SysUser) error // FindByIds find user by ids FindByIds(ctx context.Context, ids ...uint32) ([]*model.SysUser, error) }
User is the user repository
Source Files ¶
Click to show internal directories.
Click to hide internal directories.