utils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SemVerRegex = regexp.MustCompile(`^(<=|<|>|>=|\^)?(0|[1-9]\d*)\.(0|[1-9]d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)

Functions

func CopyMap added in v0.0.9

func CopyMap[T comparable, M any](m map[T]M) map[T]M

func DownloadOrCache added in v0.0.9

func DownloadOrCache(cacheKey string, hash string, url string, updates chan GenericUpdate) (r io.ReaderAt, size int64, err error)

func ExtractMod added in v0.0.9

func ExtractMod(f io.ReaderAt, size int64, location string, updates chan GenericUpdate) error

func SHA256Data added in v0.0.9

func SHA256Data(f io.Reader) (string, error)

Types

type GenericUpdate added in v0.0.9

type GenericUpdate struct {
	Progress float64
}

type Progresser added in v0.0.9

type Progresser struct {
	io.Reader
	// contains filtered or unexported fields
}

func (*Progresser) Read added in v0.0.9

func (pt *Progresser) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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