Documentation ¶
Index ¶
- func Download(url, saveDir string, rename ...string) error
- func GetScreenSize() (w int, h int)
- func RenderText(input string, data interface{}, fns template.FuncMap, isFile ...bool) string
- func ShellExec(cmdStr string, dirAndShell ...string) (string, error)
- func SimpleDownload(url, saveAs string) (err error)
- type Downloader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
Download file from remote URL. from https://gist.github.com/albulescu/e61979cc852e4ee8f49c
func GetScreenSize ¶
GetScreenSize for current console terminal. TODO ...
func RenderText ¶
RenderText render text template with data
func ShellExec ¶
ShellExec exec a CLI command by shell and return output. Usage:
ShellExec("ls -al") ShellExec("ls -al", "/usr/lib") ShellExec("ls -al", "/usr/lib", "/bin/zsh")
func SimpleDownload ¶
SimpleDownload simple download
Types ¶
type Downloader ¶
type Downloader struct { FileURL string SaveDir string Filename string // save file name. Progress bool // display progress info // contains filtered or unexported fields }
Downloader struct definition. refer: https://gist.github.com/albulescu/e61979cc852e4ee8f49c
Click to show internal directories.
Click to hide internal directories.