helper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSizeSuffix = errors.New("invalid size suffix")

ErrInvalidSizeSuffix is returned if the suffix is not valid.

Functions

func FilePathWithSharding added in v0.0.12

func FilePathWithSharding(fn string) string

FilePathWithSharding returns the path to a file with sharding.

func MustRandString added in v0.0.11

func MustRandString(n int, r io.Reader) string

MustRandString returns the string returned by RandString. If RandString returns an error, it will panic.

func NarFilePath added in v0.0.12

func NarFilePath(hash, compression string) string

NarFilePath returns the path of the nar file given a hash and an optional compression.

func NarInfoFilePath added in v0.0.12

func NarInfoFilePath(hash string) string

NarInfoFilePath returns the path of the narinfo file given a hash.

func NarInfoURLPath added in v0.0.12

func NarInfoURLPath(hash string) string

NarInfoURLPath returns the path of the narinfo file given a hash.

func ParseSize added in v0.0.11

func ParseSize(str string) (uint64, error)

ParseSize parses size with units and returns the same size in bytes.

func RandString added in v0.0.4

func RandString(n int, r io.Reader) (string, error)

RandString returns a random string of length n using r as the random reader; If r is nil, rand.Reader will be used instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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