Documentation ¶
Index ¶
- Constants
- func Download(url, saveDir string, rename ...string) error
- func IsGoodCmdId(name string) bool
- func IsGoodCmdName(name string) bool
- func IsGoodName(name string) bool
- func Panicf(format string, v ...any)
- func RenderText(input string, data any, fns template.FuncMap, isFile ...bool) string
- func SimpleDownload(url, saveAs string) (err error)
- type Downloader
Constants ¶
View Source
const ( // RegGoodName match a good option, argument name RegGoodName = `^[a-zA-Z][\w-]*$` // RegGoodCmdName match a good command name RegGoodCmdName = `^[a-zA-Z][\w-]*$` // RegGoodCmdId match command id. eg: "self:init" RegGoodCmdId = `^[a-zA-Z][\w:-]*$` )
Variables ¶
This section is empty.
Functions ¶
func Download ¶
Download file from remote URL. from https://gist.github.com/albulescu/e61979cc852e4ee8f49c
func RenderText ¶
RenderText render text template with data. TODO use strutil.RenderText()
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.