helper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 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

func FilePathWithSharding(fn string) string

FilePathWithSharding returns the path to a file with sharding.

func MustRandString

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

func NarFilePath(hash, compression string) string

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

func NarInfoFilePath

func NarInfoFilePath(hash string) string

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

func NarInfoURLPath

func NarInfoURLPath(hash string) string

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

func ParseSize

func ParseSize(str string) (uint64, error)

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

func RandString

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