Documentation ¶
Index ¶
- Constants
- Variables
- func AsyExec(cmd string) <-chan Command
- func CmdStart(cmd *exec.Cmd, conf *Config, env ...string) (*exec.Cmd, error)
- func CreateTmpShellFile(pattern, content string) (tmpFile string, err error)
- func GetPublicIP() (net.IP, error)
- func GetPublicIPWithUrl(url string) (net.IP, error)
- func GetResolveIP() (net.IP, error)
- func GetResolveIPV2() (net.IP, error)
- func IPIsSelf(ip string) string
- func Info() string
- func IsLanIP(IP net.IP) bool
- func IsPublicIP(IP net.IP) bool
- func PublicIPValid() bool
- func Quit()
- func Run()
- func SelfExternalIP(lan bool) string
- func Shell(args []string, config Config, env ...string) (*exec.Cmd, error)
- func StripArgs(args []string, arg string) []string
- type Chan
- type Command
- type Config
- type CpuInfo
- type DiskPath
- type Event
- type IPType
- type MemInfo
Constants ¶
View Source
const ( IptUnk = IPType(0) IptPub = IPType(1) IptPriA = IPType(2) IptPriB = IPType(3) IptPriC = IPType(4) )
View Source
const GB = 1024 * 1024 * 1024
View Source
const (
KLocalHost = "127.0.0.1"
)
Variables ¶
View Source
var ( ResolveIp = net.IP{} PublicIp = net.IP{} )
Functions ¶
func CreateTmpShellFile ¶ added in v1.1.11
CreateTmpShellFile 创建临时的 shell 脚本文件 content 创建的脚本内容
func GetPublicIP ¶ added in v0.5.39
func GetResolveIP ¶ added in v0.5.39
func GetResolveIPV2 ¶ added in v0.5.39
func IsPublicIP ¶
func PublicIPValid ¶ added in v0.7.0
func PublicIPValid() bool
func SelfExternalIP ¶ added in v1.1.3
SelfExternalIP 自己外部IP,可能是局域网IP,公网IP lan 局域网优先
Types ¶
type Command ¶ added in v1.1.11
type Command struct { Command string Err error StartTime time.Time EndTime time.Time // contains filtered or unexported fields }
type CpuInfo ¶ added in v1.0.16
type DiskPath ¶ added in v1.0.16
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event represents a one-time event that may occur in the future.
func (*Event) Done ¶
func (e *Event) Done() <-chan struct{}
Done returns a channel that will be closed when Fire is called.
type MemInfo ¶ added in v1.0.0
type MemInfo struct { // Total amount of RAM on this system Total uint64 `json:"total"` // RAM available for programs to allocate // // This value is computed from the kernel specific values. Available uint64 `json:"available"` // RAM used by programs // // This value is computed from the kernel specific values. Used uint64 `json:"used"` // Percentage of RAM used by programs // // This value is computed from the kernel specific values. UsedPercent float64 `json:"usedPercent"` }
Click to show internal directories.
Click to hide internal directories.