lib

package
v0.0.0-...-8fd8d89 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHttpByte

func GetHttpByte(url string) ([]byte, error)

func GetHttpJson

func GetHttpJson(url string, model any) (interface{}, error)

func GetHttpString

func GetHttpString(url string) (string, error)

func SHA512sum

func SHA512sum(filename string) (string, error)

SHA256sum returns SHA256 checksum of filename @Todo: please remember to commit a orginal package SHA512sum

func TMI

func TMI(item interface{}) map[string]interface{}

Types

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

func StartDownload

func StartDownload(url string, dest string, percentFunc func(float64, int64, int64), doneFunc func(string, int64, time.Duration)) (*Downloader, error)

func (*Downloader) Download

func (d *Downloader) Download(url string, dest string, percentFunc func(float64, int64, int64), doneFunc func(string, int64, time.Duration)) error

func (*Downloader) SendDone

func (d *Downloader) SendDone(path string, total int64, duration time.Duration)

func (*Downloader) SendDownloadPercent

func (d *Downloader) SendDownloadPercent(percent func(float64, int64, int64), path string, total int64)

func (*Downloader) SendPerc

func (d *Downloader) SendPerc(perc float64, received int64, total int64)

func (*Downloader) Wait

func (d *Downloader) Wait()

Jump to

Keyboard shortcuts

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