utils

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: GPL-3.0 Imports: 12 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 Copy added in v0.0.15

func Copy[T any](obj T) (*T, error)

func ExtractMod added in v0.0.9

func ExtractMod(f io.ReaderAt, size int64, location string, hash string, updates chan<- GenericProgress, d disk.Disk) error

func SHA256Data added in v0.0.9

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

Types

type GenericProgress added in v0.2.0

type GenericProgress struct {
	Completed int64
	Total     int64
}

func (GenericProgress) Percentage added in v0.2.0

func (gp GenericProgress) Percentage() float64

type Progresser added in v0.0.9

type Progresser struct {
	Updates chan<- GenericProgress
	Total   int64
	Running int64
}

func (*Progresser) Write added in v0.4.0

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

Jump to

Keyboard shortcuts

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