manifest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFilename = "manifest.wall"
View Source
const Schema = "1.0"

Variables

This section is empty.

Functions

func FindPaths

func FindPaths(slices []*setup.Slice) map[string][]*setup.Slice

FindPaths finds the paths marked with "generate:manifest" and returns a map from the manifest path to all the slices that declare it.

func SetDebug

func SetDebug(debug bool)

Enable the delivery of debug messages to the logger. Only meaningful if a logger is also set.

func SetLogger

func SetLogger(logger log_Logger)

Specify the *log.Logger object where log messages should be sent to.

func Validate

func Validate(manifest *Manifest) (err error)

Validate checks that the Manifest is valid. Note that to do that it has to load practically the whole manifest into memory and unmarshall all the entries.

func Write

func Write(options *WriteOptions, writer io.Writer) error

Types

type Content

type Content struct {
	Kind  string `json:"kind"`
	Slice string `json:"slice,omitempty"`
	Path  string `json:"path,omitempty"`
}

type Manifest

type Manifest struct {
	// contains filtered or unexported fields
}

func Read

func Read(reader io.Reader) (manifest *Manifest, err error)

Read loads a Manifest without performing any validation. The data is assumed to be both valid jsonwall and a valid Manifest (see Validate).

func (*Manifest) IterateContents

func (manifest *Manifest) IterateContents(slice string, onMatch func(*Content) error) (err error)

func (*Manifest) IteratePackages

func (manifest *Manifest) IteratePackages(onMatch func(*Package) error) (err error)

func (*Manifest) IteratePaths

func (manifest *Manifest) IteratePaths(pathPrefix string, onMatch func(*Path) error) (err error)

func (*Manifest) IterateSlices

func (manifest *Manifest) IterateSlices(pkgName string, onMatch func(*Slice) error) (err error)

type Package

type Package struct {
	Kind    string `json:"kind"`
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
	Digest  string `json:"sha256,omitempty"`
	Arch    string `json:"arch,omitempty"`
}

type Path

type Path struct {
	Kind        string   `json:"kind"`
	Path        string   `json:"path,omitempty"`
	Mode        string   `json:"mode,omitempty"`
	Slices      []string `json:"slices,omitempty"`
	SHA256      string   `json:"sha256,omitempty"`
	FinalSHA256 string   `json:"final_sha256,omitempty"`
	Size        uint64   `json:"size,omitempty"`
	Link        string   `json:"link,omitempty"`
}

type Report

type Report struct {
	// Root is the filesystem path where the all reported content is based.
	Root string
	// Entries holds all reported content, indexed by their path.
	Entries map[string]ReportEntry
}

Report holds the information about files and directories created when slicing packages.

func NewReport

func NewReport(root string) (*Report, error)

NewReport returns an empty report for content that will be based at the provided root path.

func (*Report) Add

func (r *Report) Add(slice *setup.Slice, fsEntry *fsutil.Entry) error

func (*Report) Mutate

func (r *Report) Mutate(fsEntry *fsutil.Entry) error

Mutate updates the FinalSHA256 and Size of an existing path entry.

type ReportEntry

type ReportEntry struct {
	Path        string
	Mode        fs.FileMode
	SHA256      string
	Size        int
	Slices      map[*setup.Slice]bool
	Link        string
	FinalSHA256 string
}

type Slice

type Slice struct {
	Kind string `json:"kind"`
	Name string `json:"name,omitempty"`
}

type WriteOptions

type WriteOptions struct {
	PackageInfo []*archive.PackageInfo
	Selection   []*setup.Slice
	Report      *Report
}

Jump to

Keyboard shortcuts

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