Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidURL is returned if the regexp did not match the given URL. ErrInvalidURL = errors.New("invalid nar URL") )
View Source
var ErrUnknownFileExtension = errors.New("file extension is not known")
ErrUnknownFileExtension is returned if the file extension is not known.
Functions ¶
This section is empty.
Types ¶
type CompressionType ¶
type CompressionType string
CompressionType represents the compression types supported by Nix. See: https://github.com/NixOS/nix/blob/f1187cb696584739884687d788a6fbb4dd36c61c/src/libstore/binary-cache-store.cc#L166
const ( CompressionTypeNone CompressionType = "none" CompressionTypeBzip2 CompressionType = "bzip2" CompressionTypeZstd CompressionType = "zstd" CompressionTypeLzip CompressionType = "lzip" CompressionTypeLz4 CompressionType = "lz4" CompressionTypeBr CompressionType = "br" CompressionTypeXz CompressionType = "xz" )
func CompressionTypeFromExtension ¶
func CompressionTypeFromExtension(ext string) (CompressionType, error)
CompressionTypeFromExtension returns the compression type given an extension.
func CompressionTypeFromString ¶
func CompressionTypeFromString(ct string) CompressionType
CompressionTypeFromString returns the string compression type as CompressionType.
func (CompressionType) String ¶
func (ct CompressionType) String() string
String returns the CompressionType as a string.
func (CompressionType) ToFileExtension ¶
func (ct CompressionType) ToFileExtension() string
ToFileExtension returns the file extensions associated with the compression type.
type URL ¶
type URL struct {
Hash string
Compression CompressionType
Query url.Values
}
URL represents a nar URL.
func (URL) ToFilePath ¶
ToFilePath returns the filepath in the store for a given nar URL.
Click to show internal directories.
Click to hide internal directories.