helper

package
v2.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(url, saveDir string, rename ...string) error

Download file from remote URL. from https://gist.github.com/albulescu/e61979cc852e4ee8f49c

func GetTerminalSize added in v2.1.1

func GetTerminalSize(refresh ...bool) (w int, h int)

GetTerminalSize for current console terminal.

func RenderText

func RenderText(input string, data interface{}, fns template.FuncMap, isFile ...bool) string

RenderText render text template with data

func SimpleDownload

func SimpleDownload(url, saveAs string) (err error)

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

func (*Downloader) Download

func (d *Downloader) Download() error

Download begin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL