Versions in this module Expand all Collapse all v0 v0.0.1 Jun 24, 2022 Changes in this version + const CacheKeyOauth2State + const ConfigCoverAll + const ConfigCoverIgnoreAll + const ConfigTypeGitHub + const ConfigTypeGitee + const ConfigTypeGitlab + const ConfigTypeJihulab + const CronCoverAll + const CronCoverIgnoreAll + const CtxKeyAuthorizedUser + const MTReportHostState + const MonitorCoverAll + const MonitorCoverIgnoreAll + const NotificationRequestMethodGET + const NotificationRequestMethodPOST + const NotificationRequestTypeForm + const NotificationRequestTypeJSON + const RuleCoverAll + const RuleCoverIgnoreAll + const TaskTypeCommand + const TaskTypeHTTPGET + const TaskTypeICMPPing + const TaskTypeKeepalive + const TaskTypeTCPPing + const TaskTypeTerminal + const TaskTypeUpgrade + var DashboardThemes = map[string]string + var Languages = map[string]string + var Themes = map[string]string + func IsServiceSentinelNeeded(t uint64) bool + type AgentCliParam struct + ClientSecret string + Debug bool + DisableAutoUpdate bool + DisableCommandExecute bool + DisableForceUpdate bool + DiskMultiplier int + MemoryMultiplier int + NetworkSpeedMultiplier int + NetworkTrafficMultiplier int + ReportDelay int + Server string + SkipConnectionCount bool + SkipProcsCount bool + TLS bool + type AgentConfig struct + HardDrivePartitionAllowlist []string + NICAllowlist map[string]bool + func (c *AgentConfig) Read(path string) error + func (c *AgentConfig) Save() error + type AlertRule struct + Enable *bool + Name string + NotificationTag string + Rules []Rule + RulesRaw string + func (r *AlertRule) AfterFind(tx *gorm.DB) error + func (r *AlertRule) BeforeSave(tx *gorm.DB) error + func (r *AlertRule) Check(points [][]interface{}) (int, bool) + func (r *AlertRule) Enabled() bool + func (r *AlertRule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, db *gorm.DB) []interface{} + type ApiToken struct + Note string + Token string + UserID uint64 + type Common struct + CreatedAt time.Time + DeletedAt *time.Time + ID uint64 + UpdatedAt time.Time + type Config struct + Cover uint8 + Debug bool + EnableIPChangeNotification bool + EnablePlainIPInNotification bool + GRPCHost string + GRPCPort uint + HTTPPort uint + IPChangeNotificationTag string + IgnoredIPNotification string + IgnoredIPNotificationServerIDs map[uint64]bool + Language string + Oauth2 struct{ ... } + ProxyGRPCPort uint + Site struct{ ... } + TLS bool + func (c *Config) Read(path string) error + func (c *Config) Save() error + type Cron struct + Command string + Cover uint8 + CronJobID cron.EntryID + LastExecutedAt time.Time + LastResult bool + Name string + NotificationTag string + PushSuccessful bool + Scheduler string + Servers []uint64 + ServersRaw string + func (c *Cron) AfterFind(tx *gorm.DB) error + type CycleTransferStats struct + From time.Time + Max uint64 + Min uint64 + Name string + NextUpdate map[uint64]time.Time + ServerName map[uint64]string + To time.Time + Transfer map[uint64]uint64 + type Host struct + Arch string + BootTime uint64 + CPU []string + CountryCode string + DiskTotal uint64 + IP string + MemTotal uint64 + Platform string + PlatformVersion string + SwapTotal uint64 + Version string + Virtualization string + func PB2Host(h *pb.Host) Host + func (h *Host) PB() *pb.Host + type HostState struct + CPU float64 + DiskUsed uint64 + Load1 float64 + Load15 float64 + Load5 float64 + MemUsed uint64 + NetInSpeed uint64 + NetInTransfer uint64 + NetOutSpeed uint64 + NetOutTransfer uint64 + ProcessCount uint64 + SwapUsed uint64 + TcpConnCount uint64 + UdpConnCount uint64 + Uptime uint64 + func PB2State(s *pb.State) HostState + func (s *HostState) PB() *pb.State + type Monitor struct + Cover uint8 + CronJobID cron.EntryID + Duration uint64 + Name string + NotificationTag string + Notify bool + SkipServers map[uint64]bool + SkipServersRaw string + Target string + Type uint8 + func (m *Monitor) AfterFind(tx *gorm.DB) error + func (m *Monitor) CronSpec() string + func (m *Monitor) InitSkipServers() error + func (m *Monitor) PB() *pb.Task + type MonitorHistory struct + Data string + Delay float32 + MonitorID uint64 + Successful bool + func PB2MonitorHistory(r *pb.TaskResult) MonitorHistory + type NResult struct + N uint64 + type Notification struct + Name string + RequestBody string + RequestHeader string + RequestMethod int + RequestType int + Tag string + URL string + VerifySSL *bool + type NotificationServerBundle struct + Notification *Notification + Server *Server + func (ns *NotificationServerBundle) Send(message string) error + type Response struct + Code int + Message string + Result interface{} + type Rule struct + Cover uint64 + CycleInterval uint64 + CycleStart *time.Time + CycleUnit string + Duration uint64 + Ignore map[uint64]bool + LastCycleStatus map[uint64]interface{} + Max float64 + Min float64 + NextTransferAt map[uint64]time.Time + Type string + func (rule Rule) GetTransferDurationEnd() time.Time + func (rule Rule) GetTransferDurationStart() time.Time + func (rule Rule) IsTransferDurationRule() bool + func (u *Rule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, db *gorm.DB) interface{} + type Server struct + DisplayIndex int + Host *Host + LastActive time.Time + Name string + Note string + PrevHourlyTransferIn int64 + PrevHourlyTransferOut int64 + Secret string + State *HostState + Tag string + TaskClose chan error + TaskStream pb.NezhaService_RequestTaskServer + func (s *Server) CopyFromRunningServer(old *Server) + func (s Server) Marshal() template.JS + type ServiceItemResponse struct + CurrentDown uint64 + CurrentUp uint64 + Delay *[30]float32 + Down *[30]int + Monitor *Monitor + TotalDown uint64 + TotalUp uint64 + Up *[30]int + func (r ServiceItemResponse) TotalUptime() float32 + type TerminalTask struct + Cookie string + Host string + Session string + UseSSL bool + type Transfer struct + In uint64 + Out uint64 + ServerID uint64 + type User struct + AvatarURL string + Bio string + Blog string + Email string + Hireable bool + Login string + Name string + SuperAdmin bool + Token string + TokenExpired time.Time + func NewUserFromGitHub(gu *github.User) User + func NewUserFromGitlab(gu *gitlab.User) User + func (u *User) IssueNewToken()