narinfo

package
v0.0.0-...-93cb24a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NarInfo

type NarInfo struct {
	StorePath string // The full nix store path (/nix/store/…-pname-version)

	URL         string // The relative location to the .nar[.xz,…] file. Usually nar/$fileHash.nar[.xz]
	Compression string // The compression method file at URL is compressed with (none,xz,…)

	FileHash *hash.Hash // The hash of the file at URL
	FileSize uint64     // The size of the file at URL, in bytes

	// The hash of the .nar file, after possible decompression
	// Identical to FileHash if no compression is used.
	NarHash *hash.Hash
	// The size of the .nar file, after possible decompression, in bytes.
	// Identical to FileSize if no compression is used.
	NarSize uint64

	// References to other store paths, contained in the .nar file
	References []string

	// Path of the .drv for this store path
	Deriver string

	// This doesn't seem to be used at all?
	System string

	// Signatures, if any.
	Signatures []signature.Signature

	// TODO: Figure out the meaning of this
	CA string
}

NarInfo represents a parsed .narinfo file.

func Parse

func Parse(r io.Reader) (*NarInfo, error)

Parse reads a .narinfo file content and returns a NarInfo struct with the parsed data.

func (*NarInfo) Check

func (n *NarInfo) Check() error

Check does some sanity checking on a NarInfo struct, such as:

  • ensuring the paths in StorePath, References and Deriver are syntactically valid (references and deriver first need to be made absolute)
  • when no compression is present, ensuring File{Hash,Size} and Nar{Hash,Size} are equal

func (NarInfo) ContentType

func (n NarInfo) ContentType() string

ContentType returns the mime content type of the object.

func (NarInfo) Fingerprint

func (n NarInfo) Fingerprint() string

Fingerprint is the digest that will be used with a private key to generate one of the signatures.

func (*NarInfo) String

func (n *NarInfo) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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