Documentation ¶
Index ¶
- Constants
- Variables
- type AlertStatus
- type Allow
- type Annotations
- func (l *Annotations) Get(key string) string
- func (l *Annotations) GetDescription() string
- func (l *Annotations) GetSummary() string
- func (l *Annotations) Map() map[string]string
- func (l *Annotations) MarshalJSON() ([]byte, error)
- func (l *Annotations) Scan(src any) error
- func (l *Annotations) Set(key, value string)
- func (l *Annotations) String() string
- func (l *Annotations) Value() (driver.Value, error)
- type BizType
- type ByteSize
- type Condition
- type DashboardChartType
- type DatasourceType
- type DictType
- type Gender
- type HookAPP
- type HttpMethod
- type InviteType
- type Labels
- func (l *Labels) Append(key, val string) *Labels
- func (l *Labels) AppendMap(m map[string]string) *Labels
- func (l *Labels) Get(key string) string
- func (l *Labels) GetDatasourceID() uint32
- func (l *Labels) GetDatasourceURL() string
- func (l *Labels) GetLevelID() uint32
- func (l *Labels) GetStrategyID() uint32
- func (l *Labels) GetTeamID() uint32
- func (l *Labels) Has(key string) bool
- func (l *Labels) Index() string
- func (l *Labels) Map() map[string]string
- func (l *Labels) MarshalJSON() ([]byte, error)
- func (l *Labels) Match(key, reg string) bool
- func (l *Labels) Scan(src any) (err error)
- func (l *Labels) String() string
- func (l *Labels) Value() (driver.Value, error)
- type Language
- type MenuType
- type MetricType
- type ModuleType
- type MultiDatasourceSustain
- type Network
- type NotifyType
- type OAuthAPP
- type Role
- type SendType
- type SourceType
- type Status
- type StorageType
- type StrategyTemplateSource
- type StrategyType
- type Sustain
- type Topic
- type UserMessageType
Constants ¶
const ( SummaryKey = "summary" DescriptionKey = "description" )
const ( // StrategyID 策略id StrategyID = "__moon__strategy_id__" // LevelID 策略级别id LevelID = "__moon__level_id__" // TeamID 团队id TeamID = "__moon__team_id__" // DatasourceID 数据源id DatasourceID = "__moon__datasource_id__" // DatasourceURL 数据源url DatasourceURL = "__moon__datasource_url__" // Domain 域名 Domain = "__moon__domain__" // DomainSubject 域名主题 DomainSubject = "__moon__domain_subject__" // DomainExpiresOn 域名过期时间 DomainExpiresOn = "__moon__domain_expires_on__" // DomainPort 端口 DomainPort = "__moon__domain_port__" // StrategyHttpMethod http方法 StrategyHttpMethod = "__moon__http_method__" // StrategyHttpPath http路径 StrategyHttpPath = "__moon__http_path__" )
Variables ¶
var ErrUnsupportedType = errors.New("unsupported type")
ErrUnsupportedType 不支持的类型错误
Functions ¶
This section is empty.
Types ¶
type AlertStatus ¶
type AlertStatus int
AlertStatus 告警数据状态
const ( // AlertStatusUnknown 未知 AlertStatusUnknown AlertStatus = iota // 未知 // AlertStatusFiring firing AlertStatusFiring // firing // AlertStatusResolved resolved AlertStatusResolved // resolved // AlertStatusSilenced silenced AlertStatusSilenced // Silenced )
type Annotations ¶
Annotations 告警文案
func NewAnnotations ¶ added in v1.1.0
func NewAnnotations(annotations map[string]string) *Annotations
NewAnnotations returns a new Annotations object.
func (*Annotations) Get ¶ added in v1.1.0
func (l *Annotations) Get(key string) string
func (*Annotations) GetDescription ¶ added in v1.1.0
func (l *Annotations) GetDescription() string
GetDescription 获取描述
func (*Annotations) GetSummary ¶ added in v1.1.0
func (l *Annotations) GetSummary() string
GetSummary 获取摘要
func (*Annotations) Map ¶ added in v1.1.0
func (l *Annotations) Map() map[string]string
Map converts the Annotations object to a map.
func (*Annotations) MarshalJSON ¶ added in v1.1.0
func (l *Annotations) MarshalJSON() ([]byte, error)
MarshalJSON 实现 json.Marshaler 接口
func (*Annotations) Scan ¶
func (l *Annotations) Scan(src any) error
Scan implements the sql.Scanner interface.
func (*Annotations) Set ¶ added in v1.1.0
func (l *Annotations) Set(key, value string)
func (*Annotations) String ¶ added in v1.1.0
func (l *Annotations) String() string
type Condition ¶
type Condition int
Condition 条件判断
const ( // ConditionUnknown 未知 ConditionUnknown Condition = iota // 未知 // ConditionEQ 等于 ConditionEQ // 等于 // ConditionNE 不等于 ConditionNE // 不等于 // ConditionGT 大于 ConditionGT // 大于 // ConditionGTE 大于等于 ConditionGTE // 大于等于 // ConditionLT 小于 ConditionLT // 小于 // ConditionLTE 小于等于 ConditionLTE // 小于等于 )
type DashboardChartType ¶
type DashboardChartType int
DashboardChartType 仪表盘图表类型
const ( // DashboardChartTypeUnknown 未知 DashboardChartTypeUnknown DashboardChartType = iota // 未知 // DashboardChartTypeFullScreen 全屏 DashboardChartTypeFullScreen // 全屏 // DashboardChartTypeRow 行 DashboardChartTypeRow // 行 // DashboardChartTypeCol 列 DashboardChartTypeCol // 列 )
type DatasourceType ¶
type DatasourceType int
DatasourceType 数据源类型
const ( // DatasourceTypeUnknown 未知 DatasourceTypeUnknown DatasourceType = iota // 未知 // DatasourceTypeMetrics 监控指标 DatasourceTypeMetrics // 监控指标 // DatasourceTypeTrace 链路追踪 DatasourceTypeTrace // 链路追踪 // DatasourceTypeLog 日志 DatasourceTypeLog // 日志 )
type DictType ¶
type DictType int
DictType 字典类型
const ( // DictTypeUnknown 未知 DictTypeUnknown DictType = iota // 未知 // DictTypeStrategyCategory 策略类目 DictTypeStrategyCategory // 策略类目 // DictTypeStrategyGroupCategory 策略组类目 DictTypeStrategyGroupCategory // 策略组类目 // DictTypeAlarmLevel 告警级别 DictTypeAlarmLevel // 告警级别 // DictTypeAlarmPage 告警页面 DictTypeAlarmPage // 告警页面 )
type HttpMethod ¶ added in v1.1.0
type HttpMethod int
HttpMethod http 请求方法枚举
const ( // HttpMethodUnknown 未知 HttpMethodUnknown HttpMethod = iota // unknown // HttpMethodGet GET 请求 HttpMethodGet // GET // HttpMethodPost POST 请求 HttpMethodPost // POST // HttpMethodPut PUT 请求 HttpMethodPut // PUT // HttpMethodDelete DELETE 请求 HttpMethodDelete // DELETE // HttpMethodHead HEAD 请求 HttpMethodHead // HEAD // HttpMethodOptions OPTIONS 请求 HttpMethodOptions // OPTIONS // HttpMethodTrace TRACE 请求 HttpMethodTrace // TRACE // HttpMethodConnect CONNECT 请求 HttpMethodConnect // CONNECT // HttpMethodPatch PATCH 请求 HttpMethodPatch // PATCH )
func ToHTTPMethod ¶ added in v1.1.0
func ToHTTPMethod(method string) HttpMethod
ToHTTPMethod 将字符串转换为 HttpMethod 枚举
type InviteType ¶ added in v1.0.2
type InviteType int
InviteType 邀请团队状态
const ( // InviteTypeUnknown 未知 InviteTypeUnknown InviteType = iota // 未知 // InviteTypeJoined 加入 InviteTypeJoined // 加入 // InviteTypeUnderReview 邀请中 InviteTypeUnderReview // 邀请中 // InviteTypeRejected 已拒绝 InviteTypeRejected // 已拒绝 )
type Labels ¶
type Labels struct {
// contains filtered or unexported fields
}
Labels 标签
func (*Labels) GetDatasourceID ¶ added in v1.0.2
GetDatasourceID 获取数据源id
func (*Labels) GetDatasourceURL ¶ added in v1.0.2
GetDatasourceURL 获取数据源url
func (*Labels) GetLevelID ¶ added in v1.0.2
GetLevelID 获取策略级别id
func (*Labels) GetStrategyID ¶ added in v1.0.2
GetStrategyID 获取策略id
func (*Labels) MarshalJSON ¶ added in v1.1.0
MarshalJSON 实现 json.Marshaler 接口
type MetricType ¶
type MetricType int
MetricType 数据源类型
const ( // MetricTypeUnknown 未知 MetricTypeUnknown MetricType = iota // 未知 // MetricTypeCounter 计数器 MetricTypeCounter // 计数器 // MetricTypeGauge 仪表盘 MetricTypeGauge // 仪表盘 // MetricTypeHistogram 直方图 MetricTypeHistogram // 直方图 // MetricTypeSummary 摘要 MetricTypeSummary // 摘要 )
type ModuleType ¶
type ModuleType int
ModuleType 模块类型
const ( // ModuleTypeUnknown 未知 ModuleTypeUnknown ModuleType = iota // 未知 // ModuleTypeMenu 菜单模块 ModuleTypeMenu // 菜单模块 )
type MultiDatasourceSustain ¶
type MultiDatasourceSustain int
MultiDatasourceSustain 持续类型定义
m时间内出现n次 m时间内最多出现n次 m时间内最少出现n次
const ( // MultiDatasourceSustainTypeUnknown 未知 MultiDatasourceSustainTypeUnknown MultiDatasourceSustain = iota // 未知 // MultiDatasourceSustainTypeAnd 所有数据告警集合一致 MultiDatasourceSustainTypeAnd // 同时满足 所有数据告警集合一致 // MultiDatasourceSustainTypeOr 其中一个满足 数据告警集合其中一个完全满足 MultiDatasourceSustainTypeOr // 其中一个满足 数据告警集合其中一个完全满足 // MultiDatasourceSustainTypeAndOr 共同满足 所有数据告警集合合并起来后满足 MultiDatasourceSustainTypeAndOr // 共同满足 所有数据告警集合合并起来后满足 )
type NotifyType ¶
type NotifyType int
NotifyType 通知类型
const ( // NotifyTypePhone 电话通知 NotifyTypePhone NotifyType = 1 << iota // NotifyTypeSMS 短信通知 NotifyTypeSMS // NotifyTypeEmail 邮件通知 NotifyTypeEmail )
func (NotifyType) EnString ¶ added in v1.1.0
func (n NotifyType) EnString() string
func (NotifyType) String ¶
func (n NotifyType) String() string
type Role ¶
type Role int
Role 系统全局角色
func (Role) IsAdminOrSuperAdmin ¶
IsAdminOrSuperAdmin 是否是:管理员 | 超级管理员
type SourceType ¶
type SourceType int
SourceType 来源类型
const ( // SourceTypeUnknown 未知 SourceTypeUnknown SourceType = iota // 未知 // SourceTypeSystem 系统来源 SourceTypeSystem // 系统来源 // SourceTypeTeam 团队来源 SourceTypeTeam // 团队来源 )
type StorageType ¶
type StorageType int
StorageType 存储类型
const ( // StorageTypeUnknown 未知 StorageTypeUnknown StorageType = iota // 未知 // StorageTypePrometheus Prometheus StorageTypePrometheus // Prometheus // StorageTypeVictoriametrics VictoriaMetrics StorageTypeVictoriametrics // VictoriaMetrics )
type StrategyTemplateSource ¶
type StrategyTemplateSource int
StrategyTemplateSource 消息类型
const ( // StrategyTemplateSourceUnknown 未知 StrategyTemplateSourceUnknown StrategyTemplateSource = iota // 未知 // StrategyTemplateSourceSystem 系统来源 StrategyTemplateSourceSystem // 系统来源 // StrategyTemplateSourceTeam 团队来源 StrategyTemplateSourceTeam // 团队来源 )
type StrategyType ¶ added in v1.1.0
type StrategyType int
StrategyType 策略类型
const ( // StrategyTypeUnknown 未知 StrategyTypeUnknown StrategyType = iota // unknown // StrategyTypeMetric 指标策略 StrategyTypeMetric // metric // StrategyTypeDomainCertificate 域名证书策略 StrategyTypeDomainCertificate // domain_certificate // StrategyTypeDomainPort 域名端口策略 StrategyTypeDomainPort // domain_port // StrategyTypePing 网络连通性策略 StrategyTypePing // ping // StrategyTypeHTTP 网站可用性策略 StrategyTypeHTTP // http )
type UserMessageType ¶ added in v1.0.2
type UserMessageType int
UserMessageType 用户消息类型
const ( // UserMessageTypeUnknown 未知 UserMessageTypeUnknown UserMessageType = iota // unknown // UserMessageTypeInfo 信息 UserMessageTypeInfo // info // UserMessageTypeWarning 警告 UserMessageTypeWarning // warning // UserMessageTypeError 错误 UserMessageTypeError // error // UserMessageTypeSuccess 成功 UserMessageTypeSuccess // success )
Source Files ¶
- alertstatus.go
- allow.go
- annotation.go
- biztype.go
- bytesize.go
- condition.go
- dashboardcharttype.go
- datasourcetype.go
- dicttype.go
- gender.go
- hookapp.go
- httpmethod.go
- invitetype.go
- label.go
- language.go
- menutype.go
- metrictype.go
- moduletype.go
- multidatasourcesustain.go
- network.go
- notifytype.go
- oauthapp.go
- role.go
- sendtype.go
- sourcetype.go
- status.go
- storagetype.go
- strategytemplatesource.go
- strategytype.go
- sustain.go
- topic.go
- usermessagetype.go