preflight

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CapSourceList = "source.list"
	CapSourceHead = "source.head"

	CapTargetWrite  = "target.write"
	CapTargetDelete = "target.delete"
)

Capability names are stable strings used in JSONL output.

View Source
const (
	CapSourceRead = "source.read"
	CapTargetHead = "target.head"
)

Variables

This section is empty.

Functions

func Crawl

func Crawl(ctx context.Context, prov provider.Provider, prefixes []string, spec Spec) (*output.PreflightRecord, error)

Crawl runs a minimal read-safe preflight for crawl jobs.

For v0.1.x, this validates that listing is permitted under at least one derived prefix.

func Transfer

func Transfer(ctx context.Context, src provider.Provider, dst provider.Provider, prefixes []string, spec Spec, opts TransferOptions) (*output.PreflightRecord, error)

Transfer performs staged preflight checks for transfer operations.

Ordering (fail-fast): target write probe (when enabled) → source list → source read → target head.

func WriteProbe

func WriteProbe(ctx context.Context, prov provider.Provider, spec Spec) (*output.PreflightRecord, error)

WriteProbe validates that the provider appears to support writing to the configured probe prefix.

This is provider-specific and intentionally minimal-side-effect.

Types

type IfAbsentProbeStatus

type IfAbsentProbeStatus string
const (
	IfAbsentProbeHonored      IfAbsentProbeStatus = "honored"
	IfAbsentProbeNotHonored   IfAbsentProbeStatus = "not_honored"
	IfAbsentProbeInconclusive IfAbsentProbeStatus = "inconclusive"
)

type IfAbsentSemanticsResult

type IfAbsentSemanticsResult struct {
	Status   IfAbsentProbeStatus
	ProbeKey string
	Err      error
}

func ProbeIfAbsentSemantics

func ProbeIfAbsentSemantics(ctx context.Context, prov provider.Provider, spec Spec) (result IfAbsentSemanticsResult)

func (IfAbsentSemanticsResult) Honored

func (r IfAbsentSemanticsResult) Honored() *bool

type Mode

type Mode string

Mode defines how aggressive preflight checks are.

const (
	ModePlanOnly   Mode = "plan-only"
	ModeReadSafe   Mode = "read-safe"
	ModeWriteProbe Mode = "write-probe"
)

type ProbeStrategy

type ProbeStrategy string

ProbeStrategy selects a provider-specific write probe strategy.

const (
	ProbeMultipartAbort ProbeStrategy = "multipart-abort"
	ProbePutDelete      ProbeStrategy = "put-delete"
)

type Spec

type Spec struct {
	Mode          Mode
	ProbeStrategy ProbeStrategy
	ProbePrefix   string
}

Spec controls how preflight checks are executed.

type TransferOptions

type TransferOptions struct {
	RequireSourceRead       bool
	RequireTargetHead       bool
	RequireTargetWriteProbe bool
}

Jump to

Keyboard shortcuts

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