sourcelayout

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: GPL-2.0 Imports: 8 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 = errors.New("source layout: source not found")

ErrSourceNotFound identifies a requested preparation source that does not exist without exposing its local path through public failures. Test it with errors.Is.

Functions

This section is empty.

Types

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 a recognized disc root.
	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 ContentRoot.
	Kind Kind
	// DiscType is BDMV, DVD, or HDDVD for recognized disc layouts; otherwise empty.
	DiscType string
	// ContentRoot is the local file or directory used to collect source facts.
	ContentRoot string
	// BDMVRoot is the selected or discovered BDMV directory; otherwise empty.
	BDMVRoot string
	// DVDRoot is the selected or discovered VIDEO_TS or HVDVD_TS directory; otherwise empty.
	DVDRoot string
}

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 derives any disc resource root without changing the source's canonical identity. Disc markers are matched case-insensitively at the source root or among its immediate children; deeper descendants are not scanned.

Jump to

Keyboard shortcuts

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