helper

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInputTooShort = errors.New("input is less than 3 characters long")

ErrInputTooShort is returned if the input is less than 3 characters long.

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

ErrInvalidSizeSuffix is returned if the suffix is not valid.

Functions

func EnsureDirWritable added in v0.9.3

func EnsureDirWritable(d string) error

func FilePathWithSharding added in v0.0.12

func FilePathWithSharding(fn string) (string, error)

FilePathWithSharding returns the path to a file with sharding.

func NarInfoURLPath added in v0.0.12

func NarInfoURLPath(hash string) string

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

func NewMultiReadCloser added in v0.9.3

func NewMultiReadCloser(r io.Reader, closers ...io.Closer) io.ReadCloser

NewMultiReadCloser creating a new MultiReadCloser that wraps the given reader and closers.

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.

Types

type MultiReadCloser added in v0.9.3

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

MultiReadCloser wraps an io.Reader and multiple io.Closers into a single io.ReadCloser. When Close() is called, it calls Close() on all provided closers.

func (*MultiReadCloser) Close added in v0.9.3

func (m *MultiReadCloser) Close() error

Close calls Close() on all underlying closers. It returns an error that wraps all errors encountered.

Jump to

Keyboard shortcuts

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