memsto

package
v6.0.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertMuteCacheType

type AlertMuteCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type AlertRuleCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewAlertRuleCache

func NewAlertRuleCache(ctx *ctx.Context, stats *Stats) *AlertRuleCacheType

func (*AlertRuleCacheType) Get

func (arc *AlertRuleCacheType) Get(ruleId int64) *models.AlertRule

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

type AlertSubscribeCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewAlertSubscribeCache

func NewAlertSubscribeCache(ctx *ctx.Context, stats *Stats) *AlertSubscribeCacheType

func (*AlertSubscribeCacheType) Get

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

type BusiGroupCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type DatasourceCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDatasourceCache

func NewDatasourceCache(ctx *ctx.Context, stats *Stats) *DatasourceCacheType

func (*DatasourceCacheType) GetBId

func (d *DatasourceCacheType) GetBId(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 NotifyScriptCacheType

type NotifyScriptCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewNotifyScript

func NewNotifyScript(ctx *ctx.Context) *NotifyScriptCacheType

func (*NotifyScriptCacheType) GetNotifyScript

func (w *NotifyScriptCacheType) GetNotifyScript() models.NotifyScript

func (*NotifyScriptCacheType) SyncNotifyScript

func (w *NotifyScriptCacheType) SyncNotifyScript()

type RecordingRuleCacheType

type RecordingRuleCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRecordingRuleCache

func NewRecordingRuleCache(ctx *ctx.Context, stats *Stats) *RecordingRuleCacheType

func (*RecordingRuleCacheType) Get

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

type TargetCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

1. append note to alert_event 2. append tags to series

func NewTargetCache

func NewTargetCache(ctx *ctx.Context, stats *Stats) *TargetCacheType

func (*TargetCacheType) Get

func (tc *TargetCacheType) Get(ident string) (*models.Target, bool)

func (*TargetCacheType) GetDeads

func (tc *TargetCacheType) GetDeads(actives map[string]struct{}) map[string]*models.Target

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

type UserCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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) 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

type UserGroupCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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()

type WebhookCacheType

type WebhookCacheType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewWebhookCache

func NewWebhookCache(ctx *ctx.Context) *WebhookCacheType

func (*WebhookCacheType) GetWebhooks

func (w *WebhookCacheType) GetWebhooks() []*models.Webhook

func (*WebhookCacheType) SyncWebhooks

func (w *WebhookCacheType) SyncWebhooks()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL