utils

package
v0.0.0-...-a0852ec Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountLimitOffset

func CountLimitOffset(contentLength, concurrent int) map[int]LimitOffsetData

func CreateFile

func CreateFile(filename string) (*os.File, error)

func DeletePartFile

func DeletePartFile() error

func GetContentLenght

func GetContentLenght(resp *http.Response) (int, error)

func HandleCancelation

func HandleCancelation(filename string, limitOffsetData map[int]LimitOffsetData) map[int]int

func HasPartFile

func HasPartFile(filename string, concurrent int) bool

func IsDownloadComplete

func IsDownloadComplete(filename string, tracker map[int]int, limitOffsetData map[int]LimitOffsetData) (bool, error)

func NewWriter

func NewWriter(w io.WriterAt, off, writerID int, counterStream chan CounterStream) *writer

func ParsePartFile

func ParsePartFile(filename string, concurrent int) (map[int]LimitOffsetData, error)

func SetupProgressBar

func SetupProgressBar(concurrent int, limitOffsetData map[int]LimitOffsetData) []*uiprogress.Bar

func WritePartFile

func WritePartFile(tracker map[int]int, filename string, limitfOffsetData map[int]LimitOffsetData) error

Types

type CounterStream

type CounterStream struct {
	ID   int
	Data int
}

type LimitOffsetData

type LimitOffsetData struct {
	Limit  int
	Offset int
}

type WriteCounter

type WriteCounter struct {
	Total uint
}

Jump to

Keyboard shortcuts

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