Versions in this module Expand all Collapse all v0 v0.0.1 Jun 24, 2022 Changes in this version + const StatusDown + const StatusGood + const StatusLowAvailability + const StatusNoData + var Alerts []*model.AlertRule + var AlertsCycleTransferStatsStore map[uint64]*model.CycleTransferStats + var AlertsLock sync.RWMutex + var ApiLock sync.RWMutex + var ApiTokenList = make(map[string]*model.ApiToken) + var Cache *cache.Cache + var Conf *model.Config + var Cron *cron.Cron + var CronLock sync.RWMutex + var Crons map[uint64]*model.Cron + var DB *gorm.DB + var Loc *time.Location + var Localizer *i18n.Localizer + var NotificationIDToTag map[uint64]string + var NotificationList map[string]map[uint64]*model.Notification + var SecretToID map[string]uint64 + var ServerAPI = &ServerAPIService + var ServerList map[uint64]*model.Server + var ServerLock sync.RWMutex + var ServerTagToIDList map[string][]uint64 + var SortedServerList []*model.Server + var SortedServerLock sync.RWMutex + var UserIDToApiTokenList = make(map[uint64][]string) + var Version = "v0.13.30" + func AddNotificationToList(n *model.Notification) + func AlertSentinelStart() + func CleanMonitorHistory() + func CronTrigger(cr model.Cron) func() + func GetStatusCode(percent T) int + func IPDesensitize(ip string) string + func Init() + func InitAPI() + func InitConfigFromPath(path string) + func InitCronTask() + func InitDBFromPath(path string) + func InitLocalizer() + func InitNotification() + func InitServer() + func LoadAPI() + func LoadCronTasks() + func LoadNotifications() + func LoadServers() + func LoadSingleton() + func ManualTrigger(c model.Cron) + func NewServiceSentinel(serviceSentinelDispatchBus chan<- model.Monitor) + func OnDeleteAlert(id uint64) + func OnDeleteNotification(id uint64) + func OnRefreshOrAddAlert(alert model.AlertRule) + func OnRefreshOrAddNotification(n *model.Notification) + func ReSortServer() + func RecordTransferHourlyUsage() + func SendNotification(notificationTag string, desc string, mutable bool, ext ...*model.Server) + func SetDefaultNotificationTagInDB(n *model.Notification) + func StatusCodeToString(statusCode int) string + func UpdateNotificationInList(n *model.Notification) + type CommonResponse struct + Code int + Message string + type CommonServerInfo struct + ID uint64 + IPV4 string + IPV6 string + LastActive int64 + Name string + Tag string + ValidIP string + type NotificationHistory struct + Duration time.Duration + Until time.Time + type ReportData struct + Data *pb.TaskResult + Reporter uint64 + type ServerAPIService struct + func (s *ServerAPIService) GetAllList() *ServerInfoResponse + func (s *ServerAPIService) GetAllStatus() *ServerStatusResponse + func (s *ServerAPIService) GetListByTag(tag string) *ServerInfoResponse + func (s *ServerAPIService) GetStatusByIDList(idList []uint64) *ServerStatusResponse + func (s *ServerAPIService) GetStatusByTag(tag string) *ServerStatusResponse + type ServerInfoResponse struct + Result []*CommonServerInfo + type ServerStatusResponse struct + Result []*StatusResponse + type ServiceSentinel struct + var ServiceSentinelShared *ServiceSentinel + func (ss *ServiceSentinel) Dispatch(r ReportData) + func (ss *ServiceSentinel) LoadStats() map[uint64]*model.ServiceItemResponse + func (ss *ServiceSentinel) Monitors() []*model.Monitor + func (ss *ServiceSentinel) OnMonitorDelete(id uint64) + func (ss *ServiceSentinel) OnMonitorUpdate(m model.Monitor) error + type StatusResponse struct + Host *model.Host + Status *model.HostState