Documentation
¶
Index ¶
- Variables
- func AddExecutablePermission(filePath string) error
- func AskYN(prompt string) bool
- func ClearScreen()
- func CommandExists(cmd string) bool
- func CreateHTTPClient(timeoutsec time.Duration) *http.Client
- func DownloadFile(filepath string, url string) (err error)
- func DownloadFileWithProgress(filepath string, url string) (err error)
- func GetExecutableBasename() (string, error)
- func GetExecutablePath() (string, error)
- func GetLinuxDistro() string
- func GetRandomUA() string
- func GetTermSize() (int, int, error)
- func HasAnyFlag(flags ...string) bool
- func IsPathExists(p string) bool
- func IsPortInUseOnWindows(port int) bool
- func IsPortOpen(port int) bool
- func LoadJson(fpath string, v any) (err error)
- func Output2PagerVer1(pager *exec.Cmd, output string) (err error)
- func Output2PagerVer2(pager *exec.Cmd, output string) (err error)
- func OutputResult(out string, paging bool, pagerCmd string, doClear bool) error
- func SaveJson(fpath string, v any) (err error)
- type OSInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var EXECUTABLE_BASENAME string
View Source
var EXECUTABLE_PATH string
Functions ¶
func AddExecutablePermission ¶
func ClearScreen ¶
func ClearScreen()
func CommandExists ¶
func DownloadFile ¶
func DownloadFileWithProgress ¶ added in v0.0.12
func GetExecutableBasename ¶
func GetExecutablePath ¶
func GetLinuxDistro ¶
func GetLinuxDistro() string
func GetRandomUA ¶ added in v0.0.4
func GetRandomUA() string
func GetTermSize ¶
func HasAnyFlag ¶ added in v0.0.12
func IsPathExists ¶
func IsPortInUseOnWindows ¶ added in v0.0.6
func IsPortOpen ¶ added in v0.0.6
func OutputResult ¶
pager or print config > $PAGER > less -f TODO 增加检测pager可用
Types ¶
Click to show internal directories.
Click to hide internal directories.