Documentation ¶
Index ¶
- Constants
- type AlertMuteCacheType
- func (amc *AlertMuteCacheType) GetAllStructs() map[int64][]models.AlertMute
- func (amc *AlertMuteCacheType) Gets(bgid int64) ([]*models.AlertMute, bool)
- func (amc *AlertMuteCacheType) Reset()
- func (amc *AlertMuteCacheType) Set(ms map[int64][]*models.AlertMute, total, lastUpdated int64)
- func (amc *AlertMuteCacheType) StatChanged(total, lastUpdated int64) bool
- func (amc *AlertMuteCacheType) SyncAlertMutes()
- type AlertRuleCacheType
- func (arc *AlertRuleCacheType) Get(ruleId int64) *models.AlertRule
- func (arc *AlertRuleCacheType) GetRuleIds() []int64
- func (arc *AlertRuleCacheType) Reset()
- func (arc *AlertRuleCacheType) Set(m map[int64]*models.AlertRule, total, lastUpdated int64)
- func (arc *AlertRuleCacheType) StatChanged(total, lastUpdated int64) bool
- func (arc *AlertRuleCacheType) SyncAlertRules()
- type AlertSubscribeCacheType
- func (c *AlertSubscribeCacheType) Get(ruleId int64) ([]*models.AlertSubscribe, bool)
- func (c *AlertSubscribeCacheType) GetAll() []*models.AlertSubscribe
- func (c *AlertSubscribeCacheType) GetStructs(ruleId int64) []models.AlertSubscribe
- func (c *AlertSubscribeCacheType) Reset()
- func (c *AlertSubscribeCacheType) Set(m map[int64][]*models.AlertSubscribe, total, lastUpdated int64)
- func (c *AlertSubscribeCacheType) StatChanged(total, lastUpdated int64) bool
- func (c *AlertSubscribeCacheType) SyncAlertSubscribes()
- type BusiGroupCacheType
- type DatasourceCacheType
- type NotifyConfigCacheType
- type RecordingRuleCacheType
- func (rrc *RecordingRuleCacheType) Get(ruleId int64) *models.RecordingRule
- func (rrc *RecordingRuleCacheType) GetRuleIds() []int64
- func (rrc *RecordingRuleCacheType) Reset()
- func (rrc *RecordingRuleCacheType) Set(m map[int64]*models.RecordingRule, total, lastUpdated int64)
- func (rrc *RecordingRuleCacheType) StatChanged(total, lastUpdated int64) bool
- func (rrc *RecordingRuleCacheType) SyncRecordingRules()
- type Stats
- type TargetCacheType
- func (tc *TargetCacheType) Get(ident string) (*models.Target, bool)
- func (tc *TargetCacheType) GetHostMetas(targets []*models.Target) map[string]*models.HostMeta
- func (tc *TargetCacheType) GetOffsetHost(targets []*models.Target, now, offset int64) map[string]int64
- func (tc *TargetCacheType) Reset()
- func (tc *TargetCacheType) Set(m map[string]*models.Target, total, lastUpdated int64)
- func (tc *TargetCacheType) StatChanged(total, lastUpdated int64) bool
- func (tc *TargetCacheType) SyncTargets()
- type UserCacheType
- func (uc *UserCacheType) GetByUserId(id int64) *models.User
- func (uc *UserCacheType) GetByUserIds(ids []int64) []*models.User
- func (uc *UserCacheType) GetByUsername(name string) *models.User
- func (uc *UserCacheType) GetMaintainerUsers() []*models.User
- func (uc *UserCacheType) Set(m map[int64]*models.User, total, lastUpdated int64)
- func (uc *UserCacheType) StatChanged(total, lastUpdated int64) bool
- func (uc *UserCacheType) SyncUsers()
- type UserGroupCacheType
- func (ugc *UserGroupCacheType) GetByUserGroupId(id int64) *models.UserGroup
- func (ugc *UserGroupCacheType) GetByUserGroupIds(ids []int64) []*models.UserGroup
- func (ugc *UserGroupCacheType) Set(ugs map[int64]*models.UserGroup, total, lastUpdated int64)
- func (ugc *UserGroupCacheType) StatChanged(total, lastUpdated int64) bool
- func (ugc *UserGroupCacheType) SyncUserGroups()
Constants ¶
View Source
const DefaultIbex = `
Address = "http://127.0.0.1:10090"
BasicAuthUser = "ibex"
BasicAuthPass = "ibex"
Timeout = 3000
`
View Source
const DefaultSMTP = `
Host = ""
Port = 994
User = "username"
Pass = "password"
From = "username@163.com"
InsecureSkipVerify = true
Batch = 5
`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertMuteCacheType ¶
func NewAlertMuteCache ¶
func NewAlertMuteCache(ctx *ctx.Context, stats *Stats) *AlertMuteCacheType
func (*AlertMuteCacheType) GetAllStructs ¶
func (amc *AlertMuteCacheType) GetAllStructs() map[int64][]models.AlertMute
func (*AlertMuteCacheType) Gets ¶
func (amc *AlertMuteCacheType) Gets(bgid int64) ([]*models.AlertMute, bool)
func (*AlertMuteCacheType) Reset ¶
func (amc *AlertMuteCacheType) Reset()
func (*AlertMuteCacheType) Set ¶
func (amc *AlertMuteCacheType) Set(ms map[int64][]*models.AlertMute, total, lastUpdated int64)
func (*AlertMuteCacheType) StatChanged ¶
func (amc *AlertMuteCacheType) StatChanged(total, lastUpdated int64) bool
func (*AlertMuteCacheType) SyncAlertMutes ¶
func (amc *AlertMuteCacheType) SyncAlertMutes()
type AlertRuleCacheType ¶
func NewAlertRuleCache ¶
func NewAlertRuleCache(ctx *ctx.Context, stats *Stats) *AlertRuleCacheType
func (*AlertRuleCacheType) GetRuleIds ¶
func (arc *AlertRuleCacheType) GetRuleIds() []int64
func (*AlertRuleCacheType) Reset ¶
func (arc *AlertRuleCacheType) Reset()
func (*AlertRuleCacheType) Set ¶
func (arc *AlertRuleCacheType) Set(m map[int64]*models.AlertRule, total, lastUpdated int64)
func (*AlertRuleCacheType) StatChanged ¶
func (arc *AlertRuleCacheType) StatChanged(total, lastUpdated int64) bool
func (*AlertRuleCacheType) SyncAlertRules ¶
func (arc *AlertRuleCacheType) SyncAlertRules()
type AlertSubscribeCacheType ¶
func NewAlertSubscribeCache ¶
func NewAlertSubscribeCache(ctx *ctx.Context, stats *Stats) *AlertSubscribeCacheType
func (*AlertSubscribeCacheType) Get ¶
func (c *AlertSubscribeCacheType) Get(ruleId int64) ([]*models.AlertSubscribe, bool)
func (*AlertSubscribeCacheType) GetAll ¶
func (c *AlertSubscribeCacheType) GetAll() []*models.AlertSubscribe
func (*AlertSubscribeCacheType) GetStructs ¶
func (c *AlertSubscribeCacheType) GetStructs(ruleId int64) []models.AlertSubscribe
func (*AlertSubscribeCacheType) Reset ¶
func (c *AlertSubscribeCacheType) Reset()
func (*AlertSubscribeCacheType) Set ¶
func (c *AlertSubscribeCacheType) Set(m map[int64][]*models.AlertSubscribe, total, lastUpdated int64)
func (*AlertSubscribeCacheType) StatChanged ¶
func (c *AlertSubscribeCacheType) StatChanged(total, lastUpdated int64) bool
func (*AlertSubscribeCacheType) SyncAlertSubscribes ¶
func (c *AlertSubscribeCacheType) SyncAlertSubscribes()
type BusiGroupCacheType ¶
func NewBusiGroupCache ¶
func NewBusiGroupCache(ctx *ctx.Context, stats *Stats) *BusiGroupCacheType
func (*BusiGroupCacheType) GetByBusiGroupId ¶
func (c *BusiGroupCacheType) GetByBusiGroupId(id int64) *models.BusiGroup
func (*BusiGroupCacheType) Set ¶
func (c *BusiGroupCacheType) Set(ugs map[int64]*models.BusiGroup, total, lastUpdated int64)
func (*BusiGroupCacheType) StatChanged ¶
func (c *BusiGroupCacheType) StatChanged(total, lastUpdated int64) bool
func (*BusiGroupCacheType) SyncBusiGroups ¶
func (c *BusiGroupCacheType) SyncBusiGroups()
type DatasourceCacheType ¶
func NewDatasourceCache ¶
func NewDatasourceCache(ctx *ctx.Context, stats *Stats) *DatasourceCacheType
func (*DatasourceCacheType) GetById ¶
func (d *DatasourceCacheType) GetById(id int64) *models.Datasource
func (*DatasourceCacheType) Set ¶
func (d *DatasourceCacheType) Set(ds map[int64]*models.Datasource, total, lastUpdated int64)
func (*DatasourceCacheType) StatChanged ¶
func (d *DatasourceCacheType) StatChanged(total, lastUpdated int64) bool
func (*DatasourceCacheType) SyncDatasources ¶
func (d *DatasourceCacheType) SyncDatasources()
type NotifyConfigCacheType ¶
func NewNotifyConfigCache ¶
func NewNotifyConfigCache(ctx *ctx.Context) *NotifyConfigCacheType
func (*NotifyConfigCacheType) GetIbex ¶
func (w *NotifyConfigCacheType) GetIbex() aconf.Ibex
func (*NotifyConfigCacheType) GetNotifyScript ¶
func (w *NotifyConfigCacheType) GetNotifyScript() models.NotifyScript
func (*NotifyConfigCacheType) GetSMTP ¶
func (w *NotifyConfigCacheType) GetSMTP() aconf.SMTPConfig
func (*NotifyConfigCacheType) GetWebhooks ¶
func (w *NotifyConfigCacheType) GetWebhooks() []*models.Webhook
func (*NotifyConfigCacheType) SyncNotifyConfigs ¶
func (w *NotifyConfigCacheType) SyncNotifyConfigs()
type RecordingRuleCacheType ¶
func NewRecordingRuleCache ¶
func NewRecordingRuleCache(ctx *ctx.Context, stats *Stats) *RecordingRuleCacheType
func (*RecordingRuleCacheType) Get ¶
func (rrc *RecordingRuleCacheType) Get(ruleId int64) *models.RecordingRule
func (*RecordingRuleCacheType) GetRuleIds ¶
func (rrc *RecordingRuleCacheType) GetRuleIds() []int64
func (*RecordingRuleCacheType) Reset ¶
func (rrc *RecordingRuleCacheType) Reset()
func (*RecordingRuleCacheType) Set ¶
func (rrc *RecordingRuleCacheType) Set(m map[int64]*models.RecordingRule, total, lastUpdated int64)
func (*RecordingRuleCacheType) StatChanged ¶
func (rrc *RecordingRuleCacheType) StatChanged(total, lastUpdated int64) bool
func (*RecordingRuleCacheType) SyncRecordingRules ¶
func (rrc *RecordingRuleCacheType) SyncRecordingRules()
type Stats ¶
type Stats struct { GaugeCronDuration *prometheus.GaugeVec GaugeSyncNumber *prometheus.GaugeVec }
func NewSyncStats ¶
func NewSyncStats() *Stats
type TargetCacheType ¶
1. append note to alert_event 2. append tags to series
func NewTargetCache ¶
func (*TargetCacheType) GetHostMetas ¶
func (*TargetCacheType) GetOffsetHost ¶
func (*TargetCacheType) Reset ¶
func (tc *TargetCacheType) Reset()
func (*TargetCacheType) Set ¶
func (tc *TargetCacheType) Set(m map[string]*models.Target, total, lastUpdated int64)
func (*TargetCacheType) StatChanged ¶
func (tc *TargetCacheType) StatChanged(total, lastUpdated int64) bool
func (*TargetCacheType) SyncTargets ¶
func (tc *TargetCacheType) SyncTargets()
type UserCacheType ¶
func NewUserCache ¶
func NewUserCache(ctx *ctx.Context, stats *Stats) *UserCacheType
func (*UserCacheType) GetByUserId ¶
func (uc *UserCacheType) GetByUserId(id int64) *models.User
func (*UserCacheType) GetByUserIds ¶
func (uc *UserCacheType) GetByUserIds(ids []int64) []*models.User
func (*UserCacheType) GetByUsername ¶
func (uc *UserCacheType) GetByUsername(name string) *models.User
func (*UserCacheType) GetMaintainerUsers ¶
func (uc *UserCacheType) GetMaintainerUsers() []*models.User
func (*UserCacheType) Set ¶
func (uc *UserCacheType) Set(m map[int64]*models.User, total, lastUpdated int64)
func (*UserCacheType) StatChanged ¶
func (uc *UserCacheType) StatChanged(total, lastUpdated int64) bool
func (*UserCacheType) SyncUsers ¶
func (uc *UserCacheType) SyncUsers()
type UserGroupCacheType ¶
func NewUserGroupCache ¶
func NewUserGroupCache(ctx *ctx.Context, stats *Stats) *UserGroupCacheType
func (*UserGroupCacheType) GetByUserGroupId ¶
func (ugc *UserGroupCacheType) GetByUserGroupId(id int64) *models.UserGroup
func (*UserGroupCacheType) GetByUserGroupIds ¶
func (ugc *UserGroupCacheType) GetByUserGroupIds(ids []int64) []*models.UserGroup
func (*UserGroupCacheType) Set ¶
func (ugc *UserGroupCacheType) Set(ugs map[int64]*models.UserGroup, total, lastUpdated int64)
func (*UserGroupCacheType) StatChanged ¶
func (ugc *UserGroupCacheType) StatChanged(total, lastUpdated int64) bool
func (*UserGroupCacheType) SyncUserGroups ¶
func (ugc *UserGroupCacheType) SyncUserGroups()
Click to show internal directories.
Click to hide internal directories.