simple

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = errors.New("not found")
	ErrEmptyPath = errors.New("empty path")
)

Error used when lookup path does not match

Functions

This section is empty.

Types

type Entry

type Entry interface {
	// Reference returns the address of the file in the entry.
	Reference() string
	// Metadata returns the metadata for this entry.
	Metadata() map[string]string
}

Entry is a representation of a single manifest entry.

type Manifest

type Manifest interface {
	// Add adds a manifest entry to the specified path.
	Add(string, string, map[string]string) error
	// Remove removes a manifest entry on the specified path.
	Remove(string) error
	// Lookup returns a manifest node entry if one is found in the specified path.
	Lookup(string) (Entry, error)
	// HasPrefix tests whether the specified prefix path exists.
	HasPrefix(string) bool
	// Length returns an implementation-specific count of elements in the manifest.
	// For Manifest, this means the number of all the existing entries.
	Length() int

	// WalkEntry walks all entries, calling walkFn for each entry in the map.
	// All errors that arise visiting entires are filtered by walkFn.
	WalkEntry(string, WalkEntryFunc) error

	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
}

Manifest is a representation of a manifest.

func NewManifest

func NewManifest() Manifest

NewManifest creates a new Manifest struct and returns a pointer to it.

type WalkEntryFunc

type WalkEntryFunc func(path string, entry Entry, err error) error

WalkEntryFunc is the type of the function called for each entry visited by WalkEntry.

Jump to

Keyboard shortcuts

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