cmd

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ISSUE_MSG = " Please open up a Github issue to report this error! https://github.com/karl-cardenas-coding/disaster-cli"
)

Variables

View Source
var (
	ApikeyFlag       string
	OutputFlag       string
	DisplayMapFlag   bool
	GenerateDocFlag  bool
	VersionString    string = "No version provided"
	FiltersFlag             = make([]string, 0, 10)
	DownloadTempPath string
)

Functions

func DownloadFile added in v1.3.1

func DownloadFile(filePath string, url string) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory. We pass an io.TeeReader into Copy() to report progress on the download.

func Execute

func Execute()

Types

type WriteCounter added in v1.3.1

type WriteCounter struct {
	Total uint64
}

https://golangcode.com/download-a-file-with-progress/ WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (WriteCounter) PrintProgress added in v1.3.1

func (wc WriteCounter) PrintProgress()

func (*WriteCounter) Write added in v1.3.1

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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