tools

package
v2.2.27 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package tools 存放辅助方法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateVersions

func GenerateVersions(start, end string) ([]string, error)

GenerateVersions 获取版本列表

func GetPublicIP

func GetPublicIP() (string, error)

GetPublicIP 获取公网IP

func IsChina

func IsChina() bool

IsChina 是否中国大陆

func RestartPanel

func RestartPanel()

func UpdatePanel

func UpdatePanel(panelInfo PanelInfo) error

UpdatePanel 更新面板

Types

type MonitoringInfo

type MonitoringInfo struct {
	Cpus      []cpu.InfoStat         `json:"cpus"`
	Percent   []float64              `json:"percent"`
	Load      *load.AvgStat          `json:"load"`
	Host      *host.InfoStat         `json:"host"`
	Mem       *mem.VirtualMemoryStat `json:"mem"`
	Swap      *mem.SwapMemoryStat    `json:"swap"`
	Net       []net.IOCountersStat   `json:"net"`
	DiskIO    []disk.IOCountersStat  `json:"disk_io"`
	Disk      []disk.PartitionStat   `json:"disk"`
	DiskUsage []disk.UsageStat       `json:"disk_usage"`
}

MonitoringInfo 监控信息

func GetMonitoringInfo

func GetMonitoringInfo() MonitoringInfo

GetMonitoringInfo 获取监控数据

type PanelInfo

type PanelInfo struct {
	Name         string `json:"name"`
	Version      string `json:"version"`
	DownloadName string `json:"download_name"`
	DownloadUrl  string `json:"download_url"`
	Body         string `json:"body"`
	Date         string `json:"date"`
	Checksums    string `json:"checksums"`
	ChecksumsUrl string `json:"checksums_url"`
}

func GetLatestPanelVersion

func GetLatestPanelVersion() (PanelInfo, error)

GetLatestPanelVersion 获取最新版本

func GetPanelVersion

func GetPanelVersion(version string) (PanelInfo, error)

GetPanelVersion 获取指定面板版本

Jump to

Keyboard shortcuts

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