memsto

package
v6.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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

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

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 ConfigCache added in v6.4.0

type ConfigCache struct {
	// contains filtered or unexported fields
}

func NewConfigCache added in v6.4.0

func NewConfigCache(ctx *ctx.Context, status *Stats, privateKey []byte, passWord string) *ConfigCache

func (*ConfigCache) Get added in v6.4.0

func (c *ConfigCache) Get() map[string]string

func (*ConfigCache) Set added in v6.4.0

func (c *ConfigCache) Set(decryptMap map[string]string, total int64, updated int64)

type DatasourceCacheType

type DatasourceCacheType struct {
	DatasourceCheckHook func(*gin.Context) bool
	DatasourceFilter    func([]*models.Datasource, *models.User) []*models.Datasource

	sync.RWMutex
	// contains filtered or unexported fields
}

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

type NotifyConfigCacheType struct {
	ConfigCache *ConfigCache

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewNotifyConfigCache

func NewNotifyConfigCache(ctx *ctx.Context, configCache *ConfigCache) *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

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, redis storage.Redis) *TargetCacheType

func (*TargetCacheType) Get

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

func (*TargetCacheType) GetHostMetas

func (tc *TargetCacheType) GetHostMetas(targets []*models.Target) map[string]*models.HostMeta

func (*TargetCacheType) GetOffsetHost

func (tc *TargetCacheType) GetOffsetHost(targets []*models.Target, now, offset int64) map[string]int64

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

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

Jump to

Keyboard shortcuts

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