Documentation ¶
Index ¶
- Constants
- func GeneratePassword(length int) string
- func Lenf(han string) (l int)
- func MaxAndMin(data []float64) (max, min float64)
- func Pad(s, pad string, width int, align int) string
- func PadCenter(s, pad string, width int) string
- func PadLeft(s, pad string, width int) string
- func PadRight(s, pad string, width int) string
- func PrintCollectTrend(data []float64) (buf string)
- func SetProxy(proxy, proxyAuth string, tr *http.Transport) (err error)
- type HTTPDownloader
- type ProgressIndicator
- type Table
Constants ¶
View Source
const ( // ContentType is for the http header of content type ContentType = "Content-Type" // ApplicationForm is for the form submit ApplicationForm = "application/x-www-form-urlencoded" )
View Source
const ( // AlignLeft align left AlignLeft = 0 // AlignCenter align center AlignCenter = 1 // AlignRight align right AlignRight = 2 )
Variables ¶
This section is empty.
Functions ¶
func GeneratePassword ¶ added in v0.0.18
GeneratePassword generates a password with the specific length
func PrintCollectTrend ¶ added in v0.0.21
PrintCollectTrend print the trend of data
Types ¶
type HTTPDownloader ¶ added in v0.0.18
type HTTPDownloader struct { TargetFilePath string URL string ShowProgress bool UserName string Password string Proxy string ProxyAuth string Debug bool RoundTripper http.RoundTripper }
HTTPDownloader is the downloader for http request
func (*HTTPDownloader) DownloadFile ¶ added in v0.0.18
func (h *HTTPDownloader) DownloadFile() error
DownloadFile download a file with the progress
type ProgressIndicator ¶ added in v0.0.18
type ProgressIndicator struct { Writer io.Writer Reader io.Reader Title string // bytes.Buffer Total float64 // contains filtered or unexported fields }
ProgressIndicator hold the progress of io operation
func (*ProgressIndicator) Init ¶ added in v0.0.18
func (i *ProgressIndicator) Init()
Init set the default value for progress indicator
type Table ¶
type Table struct { Out io.Writer Rows [][]string ColumnWidths []int ColumnAlign []int Separator string }
Table for console print
func (*Table) GetColumnAlign ¶
GetColumnAlign return the column alignment
func (*Table) SetColumnAlign ¶
SetColumnAlign sets the column alignment for the given column index
func (*Table) SetColumnsAligns ¶
SetColumnsAligns sets the alignment of the columns
Click to show internal directories.
Click to hide internal directories.