outputnames

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package outputnames separates source identity from destination spelling.

Index

Constants

View Source
const (
	MaxPortableNameBytes = 255
	MaximumAttempts      = 16
)
View Source
const MaximumMappings = 65_536

Variables

View Source
var ErrInvalidMapping = errors.New("output name mapping is invalid")

Functions

func Candidate

func Candidate(operationID []byte, logicalPath string, attempt uint32) (string, error)

Candidate keeps a safe extension so a repaired document still opens normally. The operation and complete logical path distinguish equal-looking source names.

func PortableName

func PortableName(name string) bool

PortableName governs generated names only. Original names are tried through the destination's own namespace, including on filesystems with fewer restrictions.

Types

type GuardedNamespace

type GuardedNamespace struct {
	Acquire func() (outputcap.PublicOperationGuard, error)
}

GuardedNamespace probes names through retained directory capabilities. The executor still performs its own identity check when it creates the final.

func (GuardedNamespace) InspectName

func (namespace GuardedNamespace) InspectName(parentPath, component string) (kind outputcap.EntryKind, resultErr error)

type Mapper

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

func New

func New(operation []byte, root Root, store Store, namespace Namespace, trace func(Trace)) (*Mapper, error)

func (*Mapper) Bind

func (mapper *Mapper) Bind(logical string) (string, error)

func (*Mapper) Mappings

func (mapper *Mapper) Mappings() []Mapping

func (*Mapper) Resolve

func (mapper *Mapper) Resolve(logical string) (string, error)

Resolve is read-only: recovery never reinterprets a frozen destination after moving to a filesystem that happens to accept more source spellings.

type Mapping

type Mapping struct {
	LogicalPath       string `json:"logicalPath"`
	PhysicalComponent string `json:"physicalComponent"`
	Attempt           uint32 `json:"attempt"`
}

type Namespace

type Namespace interface {
	InspectName(parentPath, component string) (outputcap.EntryKind, error)
}

type Resolver

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

Resolver reconstructs frozen names without owning mutation capabilities.

func NewResolver

func NewResolver(operation []byte, root Root, records []Mapping) (*Resolver, error)

func (*Resolver) Mappings

func (resolver *Resolver) Mappings() []Mapping

func (*Resolver) Resolve

func (resolver *Resolver) Resolve(logical string) (string, error)

type Root

type Root struct {
	ReservedName  string
	RequestedName string
	PhysicalName  string
	Kind          receivecontract.ContainerEntryKind
}

type Store

type Store interface {
	Load() ([]Mapping, error)
	Put(Mapping) error
}

type Trace

type Trace struct {
	LogicalPath  string
	PhysicalPath string
	Attempt      uint32
	Reused       bool
}

Jump to

Keyboard shortcuts

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