Documentation
¶
Overview ¶
Package tools 存放辅助方法
Index ¶
- func CollectLocalNames() []string
- func CollectTopProcesses() types.TopProcesses
- func CurrentInfo(nets, disks []string) types.CurrentInfo
- func FormatBytes(size float64) string
- func GetLocalIPv4() (string, error)
- func GetLocalIPv6() (string, error)
- func GetPublicIPv4() (string, error)
- func GetPublicIPv6() (string, error)
- func IsChina() bool
- func IsIPv6(host string) bool
- func RestartPanel()
- func RestartServer()
- func StopPanel()
- func UnwrapIPv6(host string) string
- func WrapIPv6(host string) string
- type NoopLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectLocalNames ¶ added in v3.2.0
func CollectLocalNames() []string
CollectLocalNames 收集本机所有 IP 地址
func CollectTopProcesses ¶
func CollectTopProcesses() types.TopProcesses
CollectTopProcesses 采集各指标 Top 5 进程
func UnwrapIPv6 ¶ added in v3.2.6
UnwrapIPv6 去除 IPv6 地址的方括号(如 [::1] → ::1),非此形式则原样返回
Types ¶
type NoopLogger ¶
type NoopLogger struct{}
NoopLogger 给 go-resty 使用的空日志
func (NoopLogger) Debugf ¶
func (NoopLogger) Debugf(format string, v ...any)
func (NoopLogger) Errorf ¶
func (NoopLogger) Errorf(format string, v ...any)
func (NoopLogger) Warnf ¶
func (NoopLogger) Warnf(format string, v ...any)
Click to show internal directories.
Click to hide internal directories.