sourcelayout

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sourcelayout resolves one requested preparation source into the local resource roots used while collecting release facts.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSourceNotFound identifies a requested source that does not exist.
	ErrSourceNotFound = errors.New("source layout: source not found")
	// ErrDirectorySymlink identifies a selected or nested directory symlink.
	ErrDirectorySymlink = errors.New("source layout: directory symlinks are not supported")
	// ErrMixedDiscCollection identifies a collection containing different disc formats.
	ErrMixedDiscCollection = errors.New("source layout: mixed disc collections are not supported")
	// ErrUnsupportedHDDVDCollection identifies nested or multiple HD DVD roots.
	ErrUnsupportedHDDVDCollection = errors.New("source layout: HD DVD collections are not supported")
	// ErrConflictingDiscLayout identifies ambiguous or colliding disc marker identities.
	ErrConflictingDiscLayout = errors.New("source layout: conflicting disc layout")
)

Functions

This section is empty.

Types

type DiscResource added in v0.3.2

type DiscResource struct {
	ID   string
	Name string
	Type string
	Root string
}

DiscResource is one preparation-private disc root within a selected source.

type Kind

type Kind string

Kind identifies how the requested source relates to its content root.

const (
	// KindFile identifies a source that is one regular file.
	KindFile Kind = "file"
	// KindDirectory identifies a non-disc directory source.
	KindDirectory Kind = "directory"
	// KindDiscParent identifies a directory containing one or more recognized disc roots.
	KindDiscParent Kind = "disc_parent"
	// KindDiscRoot identifies a recognized disc root selected directly.
	KindDiscRoot Kind = "disc_root"
)

type Layout

type Layout struct {
	// SourcePath is the absolute, cleaned path originally selected by the caller.
	SourcePath string
	// Kind describes how SourcePath relates to its discovered resources.
	Kind Kind
	// DiscType is BDMV, DVD, or HDDVD for a homogeneous recognized disc layout.
	DiscType string
	// Discs contains every recognized disc root in deterministic display order.
	Discs []DiscResource
}

Layout preserves requested-source identity while exposing derived local resource roots only to preparation internals.

func Resolve

func Resolve(ctx context.Context, sourcePath string) (Layout, error)

Resolve normalizes and validates sourcePath and discovers every disc root without dereferencing directory symlinks or changing source identity.

Jump to

Keyboard shortcuts

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