Documentation ¶
Index ¶
- func AlertCurEventDel(ids []int64) error
- func AlertCurEventDelByHash(hash string) error
- func AlertCurEventExists(where string, args ...interface{}) (bool, error)
- func AlertCurEventGetMap(cluster string) (map[int64]map[string]struct{}, error)
- func AlertCurEventTotal(bgid, stime, etime int64, severity int, clusters []string, query string) (int64, error)
- func AlertHisEventTotal(bgid, stime, etime int64, severity int, recovered int, clusters []string, ...) (int64, error)
- func AlertMuteDel(ids []int64) error
- func AlertNumbers(bgids []int64) (map[int64]int64, error)
- func AlertRuleDels(ids []int64, busiGroupId int64) error
- func AlertRuleExists(where string, args ...interface{}) (bool, error)
- func AlertRuleGetName(id int64) (string, error)
- func AlertSubscribeDel(ids []int64) error
- func BusiGroupAdd(name string, members []BusiGroupMember, creator string) error
- func BusiGroupExists(where string, args ...interface{}) (bool, error)
- func BusiGroupIds(userGroupIds []int64, permFlag ...string) ([]int64, error)
- func BusiGroupMemberAdd(member BusiGroupMember) error
- func BusiGroupMemberCount(where string, args ...interface{}) (int64, error)
- func BusiGroupMemberDel(where string, args ...interface{}) error
- func ChartGroupIdsOf(dashId int64) ([]int64, error)
- func CollectRuleDels(ids []int64, busiGroupId int64) error
- func CollectRuleExists(where string, args ...interface{}) (bool, error)
- func ConfigsGet(ckey string) (string, error)
- func ConfigsGets(ckeys []string) (map[string]string, error)
- func ConfigsSet(ckey, cval string) error
- func Count(tx *gorm.DB) (int64, error)
- func CryptoPass(raw string) (string, error)
- func DB() *gorm.DB
- func DashboardCount(where string, args ...interface{}) (num int64, err error)
- func DashboardExists(where string, args ...interface{}) (bool, error)
- func Exists(tx *gorm.DB) (bool, error)
- func IdentsFilter(idents []string, where string, args ...interface{}) ([]string, error)
- func InitRoot()
- func InitSalt()
- func Insert(obj interface{}) error
- func MemberIds(groupId int64) ([]int64, error)
- func MetricDescriptionDel(ids []int64) error
- func MetricDescriptionMapper(metrics []string) (map[string]string, error)
- func MetricDescriptionTotal(query string) (int64, error)
- func MetricDescriptionUpdate(mds []MetricDescription) error
- func MyGroupIds(userId int64) ([]int64, error)
- func NewDefaultChartGroup(dashId int64) error
- func OperationsOfRole(roles []string) ([]string, error)
- func RoleHasOperation(roles []string, operation string) (bool, error)
- func TargetDel(idents []string) error
- func TargetGetTags(idents []string) ([]string, error)
- func TargetIdents(ids []int64) ([]string, error)
- func TargetIds(idents []string) ([]int64, error)
- func TargetTotal(bgid int64, clusters []string, query string) (int64, error)
- func TargetUpdateBgid(idents []string, bgid int64, clearTags bool) error
- func TargetUpdateNote(idents []string, note string) error
- func TaskRecordTotal(bgid, beginTime int64, createBy, query string) (int64, error)
- func TaskTplTotal(groupId int64, query string) (int64, error)
- func UserGroupCount(where string, args ...interface{}) (num int64, err error)
- func UserGroupIdsOfBusiGroup(busiGroupId int64, permFlag ...string) ([]int64, error)
- func UserGroupMemberAdd(groupId, userId int64) error
- func UserGroupMemberCount(where string, args ...interface{}) (int64, error)
- func UserGroupMemberDel(groupId int64, userIds []int64) error
- func UserTotal(query string) (num int64, err error)
- type AlertCurEvent
- func AlertCurEventGet(where string, args ...interface{}) (*AlertCurEvent, error)
- func AlertCurEventGetAll(cluster string) ([]*AlertCurEvent, error)
- func AlertCurEventGetById(id int64) (*AlertCurEvent, error)
- func AlertCurEventGetByRule(ruleId int64) ([]*AlertCurEvent, error)
- func AlertCurEventGets(bgid, stime, etime int64, severity int, clusters []string, query string, ...) ([]AlertCurEvent, error)
- func AlertCurEventNeedRepeat(cluster string) ([]*AlertCurEvent, error)
- func (e *AlertCurEvent) Add() error
- func (e *AlertCurEvent) DB2FE()
- func (e *AlertCurEvent) DB2Mem()
- func (e *AlertCurEvent) FillNotifyGroups(cache map[int64]*UserGroup) error
- func (e *AlertCurEvent) IncRepeatStep(step int64) error
- func (e *AlertCurEvent) TableName() string
- func (e *AlertCurEvent) ToHis() *AlertHisEvent
- type AlertHisEvent
- type AlertMute
- type AlertNumber
- type AlertRule
- func (ar *AlertRule) Add() error
- func (ar *AlertRule) DB2FE()
- func (ar *AlertRule) FE2DB()
- func (ar *AlertRule) FillNotifyGroups(cache map[int64]*UserGroup) error
- func (ar *AlertRule) TableName() string
- func (ar *AlertRule) Update(arf AlertRule) error
- func (ar *AlertRule) UpdateFieldsMap(fields map[string]interface{}) error
- func (ar *AlertRule) Verify() error
- type AlertSubscribe
- func (s *AlertSubscribe) Add() error
- func (s *AlertSubscribe) FillRuleName(cache map[int64]string) error
- func (s *AlertSubscribe) FillUserGroups(cache map[int64]*UserGroup) error
- func (s *AlertSubscribe) Parse() error
- func (s *AlertSubscribe) TableName() string
- func (s *AlertSubscribe) Update(selectField interface{}, selectFields ...interface{}) error
- func (s *AlertSubscribe) Verify() error
- type BusiGroup
- func (bg *BusiGroup) AddMembers(members []BusiGroupMember, username string) error
- func (bg *BusiGroup) Del() error
- func (bg *BusiGroup) DelMembers(members []BusiGroupMember, username string) error
- func (bg *BusiGroup) FillUserGroups() error
- func (bg *BusiGroup) TableName() string
- func (bg *BusiGroup) Update(name string, updateBy string) error
- type BusiGroupMember
- type Chart
- type ChartGroup
- type ChartShare
- type CollectRule
- type Configs
- type Dashboard
- type LogConfig
- type MetricDescription
- type PortConfig
- type ProcConfig
- type Role
- type RoleOperation
- type ScriptConfig
- type Statistics
- func AlertMuteStatistics(cluster string) (*Statistics, error)
- func AlertRuleStatistics(cluster string) (*Statistics, error)
- func AlertSubscribeStatistics(cluster string) (*Statistics, error)
- func MetricDescStatistics() (*Statistics, error)
- func TargetStatistics(cluster string) (*Statistics, error)
- func UserGroupStatistics() (*Statistics, error)
- func UserStatistics() (*Statistics, error)
- type TagFilter
- type Target
- func TargetGet(where string, args ...interface{}) (*Target, error)
- func TargetGetById(id int64) (*Target, error)
- func TargetGetByIdent(ident string) (*Target, error)
- func TargetGets(bgid int64, clusters []string, query string, limit, offset int) ([]*Target, error)
- func TargetGetsByCluster(cluster string) ([]*Target, error)
- type TaskRecord
- type TaskTpl
- func (t *TaskTpl) AddTags(tags []string, updateBy string) error
- func (t *TaskTpl) CleanFields() error
- func (t *TaskTpl) Del() error
- func (t *TaskTpl) DelTags(tags []string, updateBy string) error
- func (t *TaskTpl) Hosts() ([]string, error)
- func (t *TaskTpl) Save(hosts []string) error
- func (t *TaskTpl) TableName() string
- func (t *TaskTpl) Update(hosts []string) error
- func (t *TaskTpl) UpdateGroup(groupId int64, updateBy string) error
- type User
- func LdapLogin(username, pass string) (*User, error)
- func PassLogin(username, pass string) (*User, error)
- func UserGet(where string, args ...interface{}) (*User, error)
- func UserGetAll() ([]*User, error)
- func UserGetById(id int64) (*User, error)
- func UserGetByUsername(username string) (*User, error)
- func UserGets(query string, limit, offset int) ([]User, error)
- func UserGetsByIds(ids []int64) ([]User, error)
- func (u *User) Add() error
- func (u *User) BusiGroups(limit int, query string, all ...bool) ([]BusiGroup, error)
- func (u *User) CanDoBusiGroup(bg *BusiGroup, permFlag ...string) (bool, error)
- func (u *User) CanModifyUserGroup(ug *UserGroup) (bool, error)
- func (u *User) ChangePassword(oldpass, newpass string) error
- func (u *User) CheckPerm(operation string) (bool, error)
- func (u *User) Del() error
- func (u *User) IsAdmin() bool
- func (u *User) NopriIdents(idents []string) ([]string, error)
- func (u *User) TableName() string
- func (u *User) UpdateAllFields() error
- func (u *User) UpdatePassword(password, updateBy string) error
- func (u *User) UserGroups(limit int, query string) ([]UserGroup, error)
- func (u *User) Verify() error
- type UserGroup
- func (ug *UserGroup) Add() error
- func (ug *UserGroup) AddMembers(userIds []int64) error
- func (ug *UserGroup) Del() error
- func (ug *UserGroup) DelMembers(userIds []int64) error
- func (ug *UserGroup) TableName() string
- func (ug *UserGroup) Update(selectField interface{}, selectFields ...interface{}) error
- func (ug *UserGroup) Verify() error
- type UserGroupMember
- type UserGroupWithPermFlag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertCurEventDel ¶
func AlertCurEventDelByHash ¶
func AlertCurEventExists ¶
func AlertCurEventGetMap ¶
func AlertCurEventTotal ¶
func AlertHisEventTotal ¶
func AlertMuteDel ¶
func AlertNumbers ¶
for busi_group list page
func AlertRuleDels ¶
func AlertRuleExists ¶
func AlertRuleGetName ¶
func AlertSubscribeDel ¶
func BusiGroupAdd ¶
func BusiGroupAdd(name string, members []BusiGroupMember, creator string) error
func BusiGroupExists ¶
func BusiGroupMemberAdd ¶
func BusiGroupMemberAdd(member BusiGroupMember) error
func BusiGroupMemberCount ¶
func BusiGroupMemberDel ¶
func ChartGroupIdsOf ¶
func CollectRuleDels ¶
func CollectRuleExists ¶
func ConfigsGet ¶
func ConfigsSet ¶
func DashboardCount ¶
func DashboardExists ¶
func IdentsFilter ¶
func MetricDescriptionDel ¶
func MetricDescriptionMapper ¶
func MetricDescriptionTotal ¶
func MetricDescriptionUpdate ¶
func MetricDescriptionUpdate(mds []MetricDescription) error
func MyGroupIds ¶
func NewDefaultChartGroup ¶
func OperationsOfRole ¶
func TargetGetTags ¶
func TargetIdents ¶
func TargetUpdateNote ¶
func TaskRecordTotal ¶
list task, filter by group_id, create_by
func UserGroupCount ¶
func UserGroupIdsOfBusiGroup ¶
func UserGroupMemberAdd ¶
func UserGroupMemberCount ¶
func UserGroupMemberDel ¶
Types ¶
type AlertCurEvent ¶
type AlertCurEvent struct { Id int64 `json:"id" gorm:"primaryKey"` Cluster string `json:"cluster"` GroupId int64 `json:"group_id"` // busi group id Hash string `json:"hash"` // rule_id + vector_key RuleId int64 `json:"rule_id"` RuleName string `json:"rule_name"` RuleNote string `json:"rule_note"` Severity int `json:"severity"` PromForDuration int `json:"prom_for_duration"` PromQl string `json:"prom_ql"` PromEvalInterval int `json:"prom_eval_interval"` Callbacks string `json:"-"` // for db CallbacksJSON []string `json:"callbacks" gorm:"-"` // for fe RunbookUrl string `json:"runbook_url"` NotifyRecovered int `json:"notify_recovered"` NotifyChannels string `json:"-"` // for db NotifyChannelsJSON []string `json:"notify_channels" gorm:"-"` // for fe NotifyGroups string `json:"-"` // for db NotifyGroupsJSON []string `json:"notify_groups" gorm:"-"` // for fe NotifyGroupsObj []*UserGroup `json:"notify_groups_obj" gorm:"-"` // for fe NotifyRepeatNext int64 `json:"notify_repeat_next"` TargetIdent string `json:"target_ident"` TargetNote string `json:"target_note"` TriggerTime int64 `json:"trigger_time"` TriggerValue string `json:"trigger_value"` Tags string `json:"-"` // for db TagsJSON []string `json:"tags" gorm:"-"` // for fe TagsMap map[string]string `json:"-" gorm:"-"` // for internal usage IsRecovered bool `json:"is_recovered" gorm:"-"` // for notify.py NotifyUsersObj []*User `json:"notify_users_obj" gorm:"-"` // for notify.py LastEvalTime int64 `json:"last_eval_time" gorm:"-"` // for notify.py 上次计算的时间 LastSentTime int64 `json:"last_sent_time" gorm:"-"` // 上次发送时间 }
func AlertCurEventGet ¶
func AlertCurEventGet(where string, args ...interface{}) (*AlertCurEvent, error)
func AlertCurEventGetAll ¶
func AlertCurEventGetAll(cluster string) ([]*AlertCurEvent, error)
func AlertCurEventGetById ¶
func AlertCurEventGetById(id int64) (*AlertCurEvent, error)
func AlertCurEventGetByRule ¶
func AlertCurEventGetByRule(ruleId int64) ([]*AlertCurEvent, error)
func AlertCurEventGets ¶
func AlertCurEventNeedRepeat ¶
func AlertCurEventNeedRepeat(cluster string) ([]*AlertCurEvent, error)
func (*AlertCurEvent) Add ¶
func (e *AlertCurEvent) Add() error
func (*AlertCurEvent) DB2FE ¶
func (e *AlertCurEvent) DB2FE()
func (*AlertCurEvent) DB2Mem ¶
func (e *AlertCurEvent) DB2Mem()
func (*AlertCurEvent) FillNotifyGroups ¶
func (e *AlertCurEvent) FillNotifyGroups(cache map[int64]*UserGroup) error
for webui
func (*AlertCurEvent) IncRepeatStep ¶
func (e *AlertCurEvent) IncRepeatStep(step int64) error
func (*AlertCurEvent) TableName ¶
func (e *AlertCurEvent) TableName() string
func (*AlertCurEvent) ToHis ¶
func (e *AlertCurEvent) ToHis() *AlertHisEvent
type AlertHisEvent ¶
type AlertHisEvent struct { Id int64 `json:"id" gorm:"primaryKey"` IsRecovered int `json:"is_recovered"` Cluster string `json:"cluster"` GroupId int64 `json:"group_id"` Hash string `json:"hash"` RuleId int64 `json:"rule_id"` RuleName string `json:"rule_name"` RuleNote string `json:"rule_note"` Severity int `json:"severity"` PromForDuration int `json:"prom_for_duration"` PromQl string `json:"prom_ql"` PromEvalInterval int `json:"prom_eval_interval"` Callbacks string `json:"-"` CallbacksJSON []string `json:"callbacks" gorm:"-"` RunbookUrl string `json:"runbook_url"` NotifyRecovered int `json:"notify_recovered"` NotifyChannels string `json:"-"` NotifyChannelsJSON []string `json:"notify_channels" gorm:"-"` NotifyGroups string `json:"-"` NotifyGroupsJSON []string `json:"notify_groups" gorm:"-"` NotifyGroupsObj []UserGroup `json:"notify_groups_obj" gorm:"-"` TargetIdent string `json:"target_ident"` TargetNote string `json:"target_note"` TriggerTime int64 `json:"trigger_time"` TriggerValue string `json:"trigger_value"` RecoverTime int64 `json:"recover_time"` LastEvalTime int64 `json:"last_eval_time"` Tags string `json:"-"` TagsJSON []string `json:"tags" gorm:"-"` }
func AlertHisEventGet ¶
func AlertHisEventGet(where string, args ...interface{}) (*AlertHisEvent, error)
func AlertHisEventGetById ¶
func AlertHisEventGetById(id int64) (*AlertHisEvent, error)
func AlertHisEventGets ¶
func (*AlertHisEvent) Add ¶
func (e *AlertHisEvent) Add() error
func (*AlertHisEvent) DB2FE ¶
func (e *AlertHisEvent) DB2FE()
func (*AlertHisEvent) FillNotifyGroups ¶
func (e *AlertHisEvent) FillNotifyGroups(cache map[int64]*UserGroup) error
func (*AlertHisEvent) TableName ¶
func (e *AlertHisEvent) TableName() string
type AlertMute ¶
type AlertMute struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` Cluster string `json:"cluster"` Tags ormx.JSONArr `json:"tags"` Cause string `json:"cause"` Btime int64 `json:"btime"` Etime int64 `json:"etime"` CreateBy string `json:"create_by"` CreateAt int64 `json:"create_at"` ITags []TagFilter `json:"-" gorm:"-"` // inner tags }
func AlertMuteGets ¶
func AlertMuteGetsByCluster ¶
type AlertNumber ¶
type AlertRule ¶
type AlertRule struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` // busi group id Cluster string `json:"cluster"` // take effect by cluster Name string `json:"name"` // rule name Note string `json:"note"` // will sent in notify Severity int `json:"severity"` // 0: Emergency 1: Warning 2: Notice Disabled int `json:"disabled"` // 0: enabled, 1: disabled PromForDuration int `json:"prom_for_duration"` // prometheus for, unit:s PromQl string `json:"prom_ql"` // just one ql PromEvalInterval int `json:"prom_eval_interval"` // unit:s EnableStime string `json:"enable_stime"` // e.g. 00:00 EnableEtime string `json:"enable_etime"` // e.g. 23:59 EnableDaysOfWeek string `json:"-"` // split by space: 0 1 2 3 4 5 6 EnableDaysOfWeekJSON []string `json:"enable_days_of_week" gorm:"-"` // for fe EnableInBG int `json:"enable_in_bg"` // 0: global 1: enable one busi-group NotifyRecovered int `json:"notify_recovered"` // whether notify when recovery NotifyChannels string `json:"-"` // split by space: sms voice email dingtalk wecom NotifyChannelsJSON []string `json:"notify_channels" gorm:"-"` // for fe NotifyGroups string `json:"-"` // split by space: 233 43 NotifyGroupsObj []UserGroup `json:"notify_groups_obj" gorm:"-"` // for fe NotifyGroupsJSON []string `json:"notify_groups" gorm:"-"` // for fe NotifyRepeatStep int `json:"notify_repeat_step"` // notify repeat interval, unit: min RecoverDuration int64 `json:"recover_duration"` // unit: s Callbacks string `json:"-"` // split by space: http://a.com/api/x http://a.com/api/y' CallbacksJSON []string `json:"callbacks" gorm:"-"` // for fe RunbookUrl string `json:"runbook_url"` // sop url AppendTags string `json:"-"` // split by space: service=n9e mod=api AppendTagsJSON []string `json:"append_tags" gorm:"-"` // for fe CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` }
func AlertRuleGet ¶
func AlertRuleGetById ¶
func AlertRuleGets ¶
func AlertRuleGetsByCluster ¶
func (*AlertRule) FillNotifyGroups ¶
func (*AlertRule) UpdateFieldsMap ¶
type AlertSubscribe ¶
type AlertSubscribe struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` Cluster string `json:"cluster"` RuleId int64 `json:"rule_id"` RuleName string `json:"rule_name" gorm:"-"` // for fe Tags ormx.JSONArr `json:"tags"` RedefineSeverity int `json:"redefine_severity"` NewSeverity int `json:"new_severity"` RedefineChannels int `json:"redefine_channels"` NewChannels string `json:"new_channels"` UserGroupIds string `json:"user_group_ids"` UserGroups []UserGroup `json:"user_groups" gorm:"-"` // for fe CreateBy string `json:"create_by"` CreateAt int64 `json:"create_at"` UpdateBy string `json:"update_by"` UpdateAt int64 `json:"update_at"` ITags []TagFilter `json:"-" gorm:"-"` // inner tags }
func AlertSubscribeGet ¶
func AlertSubscribeGet(where string, args ...interface{}) (*AlertSubscribe, error)
func AlertSubscribeGets ¶
func AlertSubscribeGets(groupId int64) (lst []AlertSubscribe, err error)
func AlertSubscribeGetsByCluster ¶
func AlertSubscribeGetsByCluster(cluster string) ([]*AlertSubscribe, error)
func (*AlertSubscribe) Add ¶
func (s *AlertSubscribe) Add() error
func (*AlertSubscribe) FillRuleName ¶
func (s *AlertSubscribe) FillRuleName(cache map[int64]string) error
func (*AlertSubscribe) FillUserGroups ¶
func (s *AlertSubscribe) FillUserGroups(cache map[int64]*UserGroup) error
func (*AlertSubscribe) Parse ¶
func (s *AlertSubscribe) Parse() error
func (*AlertSubscribe) TableName ¶
func (s *AlertSubscribe) TableName() string
func (*AlertSubscribe) Update ¶
func (s *AlertSubscribe) Update(selectField interface{}, selectFields ...interface{}) error
func (*AlertSubscribe) Verify ¶
func (s *AlertSubscribe) Verify() error
type BusiGroup ¶
type BusiGroup struct { Id int64 `json:"id" gorm:"primaryKey"` Name string `json:"name"` CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` UserGroups []UserGroupWithPermFlag `json:"user_groups" gorm:"-"` }
func BusiGroupGet ¶
func BusiGroupGetById ¶
func (*BusiGroup) AddMembers ¶
func (bg *BusiGroup) AddMembers(members []BusiGroupMember, username string) error
func (*BusiGroup) DelMembers ¶
func (bg *BusiGroup) DelMembers(members []BusiGroupMember, username string) error
func (*BusiGroup) FillUserGroups ¶
type BusiGroupMember ¶
type BusiGroupMember struct { BusiGroupId int64 `json:"busi_group_id"` UserGroupId int64 `json:"user_group_id"` PermFlag string `json:"perm_flag"` }
func BusiGroupMemberGet ¶
func BusiGroupMemberGet(where string, args ...interface{}) (*BusiGroupMember, error)
func BusiGroupMemberGets ¶
func BusiGroupMemberGets(where string, args ...interface{}) ([]BusiGroupMember, error)
func BusiGroupMemberGetsByBusiGroupId ¶
func BusiGroupMemberGetsByBusiGroupId(busiGroupId int64) ([]BusiGroupMember, error)
func (BusiGroupMember) TableName ¶
func (BusiGroupMember) TableName() string
type Chart ¶
type ChartGroup ¶
type ChartGroup struct { Id int64 `json:"id" gorm:"primaryKey"` DashboardId int64 `json:"dashboard_id"` Name string `json:"name"` Weight int `json:"weight"` }
func ChartGroupsOf ¶
func ChartGroupsOf(dashId int64) ([]ChartGroup, error)
func (*ChartGroup) Add ¶
func (cg *ChartGroup) Add() error
func (*ChartGroup) Del ¶
func (cg *ChartGroup) Del() error
func (*ChartGroup) TableName ¶
func (cg *ChartGroup) TableName() string
func (*ChartGroup) Update ¶
func (cg *ChartGroup) Update(selectField interface{}, selectFields ...interface{}) error
func (*ChartGroup) Verify ¶
func (cg *ChartGroup) Verify() error
type ChartShare ¶
type ChartShare struct {}
func ChartShareGetsByIds ¶
func ChartShareGetsByIds(ids []int64) ([]ChartShare, error)
func (*ChartShare) Add ¶
func (cs *ChartShare) Add() error
func (*ChartShare) TableName ¶
func (cs *ChartShare) TableName() string
type CollectRule ¶
type CollectRule struct { Id int64 `json:"id"` GroupId int64 `json:"group_id"` Cluster string `json:"cluster"` TargetIdents string `json:"-"` TargetIdentsJSON []string `json:"target_idents" gorm:"-"` TargetTags string `json:"-"` TargetTagsJSON []string `json:"target_tags" gorm:"-"` Name string `json:"name"` Note string `json:"note"` Step int `json:"step"` Type string `json:"type"` Data string `json:"data"` AppendTags string `json:"-"` AppendTagsJSON []string `json:"append_tags" gorm:"-"` CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` }
func CollectRuleGet ¶
func CollectRuleGet(where string, args ...interface{}) (*CollectRule, error)
func CollectRuleGetById ¶
func CollectRuleGetById(id int64) (*CollectRule, error)
func CollectRuleGets ¶
func CollectRuleGets(groupId int64, typ string) ([]CollectRule, error)
func (*CollectRule) Add ¶
func (cr *CollectRule) Add() error
func (*CollectRule) DB2FE ¶
func (cr *CollectRule) DB2FE()
func (*CollectRule) FE2DB ¶
func (cr *CollectRule) FE2DB()
func (*CollectRule) TableName ¶
func (cr *CollectRule) TableName() string
func (*CollectRule) Update ¶
func (cr *CollectRule) Update(crf CollectRule) error
func (*CollectRule) Verify ¶
func (cr *CollectRule) Verify() error
type Dashboard ¶
type Dashboard struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` Name string `json:"name"` Tags string `json:"-"` TagsLst []string `json:"tags" gorm:"-"` Configs string `json:"configs"` CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` }
func DashboardGet ¶
func DashboardGetsByIds ¶
type MetricDescription ¶
type MetricDescription struct { Id int64 `json:"id"` Metric string `json:"metric"` Description string `json:"description"` UpdateAt int64 `json:"update_at"` }
func MetricDescGetAll ¶
func MetricDescGetAll() ([]MetricDescription, error)
func MetricDescriptionGet ¶
func MetricDescriptionGet(where string, args ...interface{}) (*MetricDescription, error)
func MetricDescriptionGets ¶
func MetricDescriptionGets(query string, limit, offset int) ([]MetricDescription, error)
func (*MetricDescription) TableName ¶
func (md *MetricDescription) TableName() string
type PortConfig ¶
type ProcConfig ¶
type Role ¶
type Role struct { Id int64 `json:"id" gorm:"primaryKey"` Name string `json:"name"` Note string `json:"note"` }
func RoleGetsAll ¶
type RoleOperation ¶
func (RoleOperation) TableName ¶
func (RoleOperation) TableName() string
type ScriptConfig ¶
type Statistics ¶
func AlertMuteStatistics ¶
func AlertMuteStatistics(cluster string) (*Statistics, error)
func AlertRuleStatistics ¶
func AlertRuleStatistics(cluster string) (*Statistics, error)
func AlertSubscribeStatistics ¶
func AlertSubscribeStatistics(cluster string) (*Statistics, error)
func MetricDescStatistics ¶
func MetricDescStatistics() (*Statistics, error)
func TargetStatistics ¶
func TargetStatistics(cluster string) (*Statistics, error)
func UserGroupStatistics ¶
func UserGroupStatistics() (*Statistics, error)
func UserStatistics ¶
func UserStatistics() (*Statistics, error)
type Target ¶
type Target struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` GroupObj *BusiGroup `json:"group_obj" gorm:"-"` Cluster string `json:"cluster"` Ident string `json:"ident"` Note string `json:"note"` Tags string `json:"-"` TagsJSON []string `json:"tags" gorm:"-"` TagsMap map[string]string `json:"-" gorm:"-"` // internal use, append tags to series UpdateAt int64 `json:"update_at"` }
func TargetGetById ¶
func TargetGetByIdent ¶
func TargetGets ¶
func TargetGetsByCluster ¶
type TaskRecord ¶
type TaskRecord struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` IbexAddress string `json:"ibex_address"` IbexAuthUser string `json:"ibex_auth_user"` IbexAuthPass string `json:"ibex_auth_pass"` Title string `json:"title"` Account string `json:"account"` Batch int `json:"batch"` Tolerance int `json:"tolerance"` Timeout int `json:"timeout"` Pause string `json:"pause"` Script string `json:"script"` Args string `json:"args"` CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` }
func TaskRecordGets ¶
func TaskRecordGets(bgid, beginTime int64, createBy, query string, limit, offset int) ([]*TaskRecord, error)
func (*TaskRecord) TableName ¶
func (r *TaskRecord) TableName() string
func (*TaskRecord) UpdateIsDone ¶
func (r *TaskRecord) UpdateIsDone(isDone int) error
update is_done field
type TaskTpl ¶
type TaskTpl struct { Id int64 `json:"id" gorm:"primaryKey"` GroupId int64 `json:"group_id"` Title string `json:"title"` Batch int `json:"batch"` Tolerance int `json:"tolerance"` Timeout int `json:"timeout"` Pause string `json:"pause"` Script string `json:"script"` Args string `json:"args"` Tags string `json:"-"` TagsJSON []string `json:"tags" gorm:"-"` Account string `json:"account"` CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` }
func TaskTplGet ¶
func TaskTplGets ¶
func (*TaskTpl) CleanFields ¶
type User ¶
type User struct { Id int64 `json:"id" gorm:"primaryKey"` Username string `json:"username"` Nickname string `json:"nickname"` Password string `json:"-"` Phone string `json:"phone"` Email string `json:"email"` Portrait string `json:"portrait"` Roles string `json:"-"` // 这个字段写入数据库 RolesLst []string `json:"roles" gorm:"-"` // 这个字段和前端交互 Contacts ormx.JSONObj `json:"contacts"` // 内容为 map[string]string 结构 CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` Admin bool `json:"admin" gorm:"-"` // 方便前端使用 }
func UserGetAll ¶
func UserGetById ¶
func UserGetByUsername ¶
func UserGetsByIds ¶
func (*User) BusiGroups ¶
我是管理员,返回所有 或者我是成员
func (*User) CanDoBusiGroup ¶
func (*User) ChangePassword ¶
func (*User) UpdateAllFields ¶
func (*User) UpdatePassword ¶
func (*User) UserGroups ¶ added in v5.3.4
type UserGroup ¶
type UserGroup struct { Id int64 `json:"id" gorm:"primaryKey"` Name string `json:"name"` Note string `json:"note"` CreateAt int64 `json:"create_at"` CreateBy string `json:"create_by"` UpdateAt int64 `json:"update_at"` UpdateBy string `json:"update_by"` UserIds []int64 `json:"-" gorm:"-"` }
func UserGroupGet ¶
func UserGroupGetAll ¶
func UserGroupGetById ¶
func UserGroupGetByIds ¶
func (*UserGroup) AddMembers ¶
func (*UserGroup) DelMembers ¶
type UserGroupMember ¶
func UserGroupMemberGetAll ¶
func UserGroupMemberGetAll() ([]UserGroupMember, error)
func (UserGroupMember) TableName ¶
func (UserGroupMember) TableName() string
type UserGroupWithPermFlag ¶
Source Files ¶
- alert_cur_event.go
- alert_his_event.go
- alert_mute.go
- alert_rule.go
- alert_subscribe.go
- busi_group.go
- busi_group_member.go
- chart.go
- chart_group.go
- chart_share.go
- collect_rule.go
- common.go
- configs.go
- dashboard.go
- metric_description.go
- role.go
- role_operation.go
- target.go
- task_record.go
- task_tpl.go
- user.go
- user_group.go
- user_group_member.go
Click to show internal directories.
Click to hide internal directories.