Documentation ¶
Index ¶
- Constants
- Variables
- 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 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)
Constants ¶
View Source
const ( // SummaryKey 告警摘要 SummaryKey = "summary" // DescriptionKey 告警描述 DescriptionKey = "description" )
View Source
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__" // StrategyEventExpr 事件表达式 StrategyEventExpr = "__moon__event_expr__" )
Variables ¶
View Source
var ErrUnsupportedType = errors.New("unsupported type")
ErrUnsupportedType 不支持的类型错误
Functions ¶
This section is empty.
Types ¶
type Annotations ¶
Annotations 告警文案
func NewAnnotations ¶
func NewAnnotations(annotations map[string]string) *Annotations
NewAnnotations 返回一个新的 Annotations 对象
func (*Annotations) GetDescription ¶
func (l *Annotations) GetDescription() string
GetDescription 获取描述
func (*Annotations) MarshalJSON ¶
func (l *Annotations) MarshalJSON() ([]byte, error)
MarshalJSON 实现 json.Marshaler 接口
type Labels ¶
type Labels struct {
// contains filtered or unexported fields
}
Labels 标签
func (*Labels) GetDatasourceURL ¶
GetDatasourceURL 获取数据源url
func (*Labels) MarshalJSON ¶
MarshalJSON 实现 json.Marshaler 接口
Click to show internal directories.
Click to hide internal directories.