Documentation
¶
Index ¶
- Variables
- func DeleteAllStatusByUserID(userID int64) error
- func DeleteRankByUserID(userID int64) error
- func GetURLByID(id int64) (string, error)
- func Init()
- type Message
- type RankList
- func GetDiskTotalTop(limit int) []*RankList
- func GetDiskUsedTop(limit int) []*RankList
- func GetLoad15Top(limit int) []*RankList
- func GetMemTotalTop(limit int) []*RankList
- func GetMemUsedTop(limit int) []*RankList
- func GetOnlineCountTop(limit int) []*RankList
- func GetServerCountTop(limit int) []*RankList
- type Status
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func DeleteAllStatusByUserID ¶
func DeleteRankByUserID ¶ added in v0.0.3
func GetURLByID ¶
Types ¶
type Message ¶
type Message struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
tele.StoredMessage
}
func GetAllMessage ¶
func GetAllMessage() []Message
func GetAllMessageBefore ¶
type RankList ¶
type RankList struct {
UserID int64 `gorm:"primary_key"`
ServerCount int
OnlineCount int
MemTotal int64
MemUsedTotal int64
DiskTotal int64
DiskUsedTotal int64
Load15Total float64
}
func GetDiskTotalTop ¶
func GetDiskUsedTop ¶
func GetLoad15Top ¶
func GetMemTotalTop ¶
func GetMemUsedTop ¶
func GetOnlineCountTop ¶
func GetServerCountTop ¶
type Status ¶
type Status struct {
ID int64 `gorm:"primary_key,unique_index,auto_increment"`
UserID int64
ServerID int
RecordTime time.Time
RecordType int // 0-Raw, 1-Avg5min, 2-Avg15min, 3-Avg60Min 4-Avg24Hour
IsOnline bool
MemTotal int64
SwapTotal int
DiskTotal int64
CPUUsed float64
MemUsed int64
SwapUsed int
DiskUsed int64
NetInTransfer int64
NetOutTransfer int64
NetInSpeed int
NetOutSpeed int
Load1 float64
Load5 float64
Load15 float64
TCPConnCount int
UDPConnCount int
ProcessCount int
}
type User ¶
type User struct {
ID int64 `gorm:"primary_key"`
UserID int64 `gorm:"unique_index"` //Telegram ID
UserName string
FirstName string
LastName string
Valid bool
ConnectType int // 0: websocket, 1: API
URL string
Token string
}
func GetAllInvalidUser ¶ added in v0.0.3
func GetAllValidUser ¶
func GetUserByID ¶
func GetUserWithMissInfo ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.