builderr

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 5 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 builderr is the refusal vocabulary goav's root package and its compiler share: typed details, fixes, phases, the unsupported-build cause, and Refusal, the compiler's refusal value. The root package converts every Refusal into the public goav.BuildError before a caller sees it.

Index

Constants

View Source
const (
	PhaseBuild = "build"
	PhaseOpen  = "open"
	PhaseRun   = "run"
	PhaseClose = "close"
)

The lifecycle phases a refusal names.

View Source
const (
	CompilerPassFailedCode              errcode.Code = "compiler_pass_failed"
	GraphPlanInvalidCode                errcode.Code = "graph_plan_invalid"
	BranchDecodeDuplicateCode           errcode.Code = "branch_decode_duplicate"
	BranchDecodeDomainMismatchCode      errcode.Code = "branch_decode_domain_mismatch"
	BranchTransformMediaMismatchCode    errcode.Code = "branch_transform_media_mismatch"
	BranchOperationChainUnsupportedCode errcode.Code = "branch_operation_chain_unsupported"
	BranchBufferInvalidCode             errcode.Code = "branch_buffer_invalid"
	BranchBufferUnsupportedCode         errcode.Code = "branch_buffer_unsupported"
	DecodeConfigConflictCode            errcode.Code = "decode_config_conflict"

	OutputInvalidCode              errcode.Code = "output_invalid"
	OutputDuplicateCode            errcode.Code = "output_duplicate"
	OutputKindMixedCode            errcode.Code = "output_kind_mixed"
	OutputWriterMissingCode        errcode.Code = "output_writer_missing"
	OutputFormatMissingCode        errcode.Code = "output_format_missing"
	OutputFormatUnknownCode        errcode.Code = "output_format_unknown"
	OutputMuxerMissingCode         errcode.Code = "output_muxer_missing"
	OutputDestinationMissingCode   errcode.Code = "output_destination_missing"
	OutputSchemeUnsupportedCode    errcode.Code = "output_scheme_unsupported"
	DestinationInvalidCode         errcode.Code = "destination_invalid"
	DestinationDuplicateCode       errcode.Code = "destination_duplicate"
	DestinationFormatUnknownCode   errcode.Code = "destination_format_unknown"
	DestinationMuxerMissingCode    errcode.Code = "destination_muxer_missing"
	DestinationMuxIncompatibleCode errcode.Code = "destination_mux_incompatible"
	DestinationShapeMismatchCode   errcode.Code = "destination_shape_mismatch"

	TransformInvalidCode             errcode.Code = "transform_invalid"
	TransformMediaMismatchCode       errcode.Code = "transform_media_mismatch"
	TransformAdapterMissingCode      errcode.Code = "transform_adapter_missing"
	TransformAdapterIncompatibleCode errcode.Code = "transform_adapter_incompatible"
	TranscodeResizeInvalidCode       errcode.Code = "transcode_resize_invalid"
	OperationShapeMismatchCode       errcode.Code = "operation_shape_mismatch"
	ShapeRequirementUnmetCode        errcode.Code = "shape_requirement_unmet"
	ShapeConversionRefusedCode       errcode.Code = "shape_conversion_refused"
	ShapeAdapterMissingCode          errcode.Code = "shape_adapter_missing"
	ShapeAdapterAmbiguousCode        errcode.Code = "shape_adapter_ambiguous"
	DecodeAdapterMissingCode         errcode.Code = "decode_adapter_missing"
	DecodeAdapterUnavailableCode     errcode.Code = "decode_adapter_unavailable"
	DecodeAdapterIncompatibleCode    errcode.Code = "decode_adapter_incompatible"
	EncodeAdapterMissingCode         errcode.Code = "encode_adapter_missing"
	EncodeAdapterUnavailableCode     errcode.Code = "encode_adapter_unavailable"
	EncodeAdapterIncompatibleCode    errcode.Code = "encode_adapter_incompatible"
	EncodeMissingCode                errcode.Code = "encode_missing"
	EncodeDuplicateCode              errcode.Code = "encode_duplicate"
	EncodeParameterInvalidCode       errcode.Code = "encode_parameter_invalid"
	EncodeAutoUnresolvedCode         errcode.Code = "encode_auto_unresolved"
	EncodeStreamMismatchCode         errcode.Code = "encode_stream_mismatch"
	EncodeDestinationMissingCode     errcode.Code = "encode_destination_missing"

	InputInvalidCode               errcode.Code = "input_invalid"
	InputDuplicateCode             errcode.Code = "input_duplicate"
	InputUnknownCode               errcode.Code = "input_unknown"
	InputFormatUnknownCode         errcode.Code = "input_format_unknown"
	InputDemuxerMissingCode        errcode.Code = "input_demuxer_missing"
	InputSchemeUnsupportedCode     errcode.Code = "input_scheme_unsupported"
	SourceCallbackMissingCode      errcode.Code = "source_callback_missing"
	SourceShapeInvalidCode         errcode.Code = "source_shape_invalid"
	SourceShapeUnsupportedCode     errcode.Code = "source_shape_unsupported"
	SourceShapeMismatchCode        errcode.Code = "source_shape_mismatch"
	ExplicitGraphSourceMissingCode errcode.Code = "explicit_graph_source_missing"
	StreamMissingCode              errcode.Code = "stream_missing"
	StreamAmbiguousCode            errcode.Code = "stream_ambiguous"
	StreamSelectorInvalidCode      errcode.Code = "stream_selector_invalid"
	StreamCodecMissingCode         errcode.Code = "stream_codec_missing"
	StreamStepAfterEncodeCode      errcode.Code = "stream_step_after_encode"
	StreamInvalidCode              errcode.Code = "stream_invalid"
	StageMissingCode               errcode.Code = "stage_missing"

	RuntimeBranchInvalidCode              errcode.Code = "runtime_branch_invalid"
	RuntimeBranchAnchorMissingCode        errcode.Code = "runtime_branch_anchor_missing"
	RuntimeBranchTapMissingCode           errcode.Code = "runtime_branch_tap_missing"
	RuntimeBranchTapDuplicateCode         errcode.Code = "runtime_branch_tap_duplicate"
	RuntimeBranchNodeDuplicateCode        errcode.Code = "runtime_branch_node_duplicate"
	RuntimeBranchEncodeMissingCode        errcode.Code = "runtime_branch_encode_missing"
	RuntimeBranchEncodeDomainMismatchCode errcode.Code = "runtime_branch_encode_domain_mismatch"
	RuntimeBranchDecodeDomainMismatchCode errcode.Code = "runtime_branch_decode_domain_mismatch"
	RuntimeBranchDecodeCodecMissingCode   errcode.Code = "runtime_branch_decode_codec_missing"
	RuntimeBranchCopyDomainMismatchCode   errcode.Code = "runtime_branch_copy_domain_mismatch"
	RuntimeBranchMuxCodecMissingCode      errcode.Code = "runtime_branch_mux_codec_missing"
	RuntimeBranchTransformErrorCode       errcode.Code = "runtime_branch_transform_error"
	RuntimeBranchGraphErrorCode           errcode.Code = "runtime_branch_graph_error"
)

The internal refusal codes: the errcode leaves goav raises that the public errcode catalog does not name.

Variables

View Source
var ErrNilStage = errors.New("goav: nil stage")

ErrNilStage reports a nil stage handed to a builder or .Do(...).

View Source
var ErrUnsupportedBuild = errors.New("goav: unsupported builder graph")

ErrUnsupportedBuild is the cause behind every build-shape refusal: the declared recipe or graph cannot be lowered as written.

Functions

func EncodeHint

func EncodeHint(media av.MediaType) string

EncodeHint is the encoder phrase refusals suggest: the bundled recipe encoders for the stream's media, so a video refusal never offers an audio codec, and every encoder when the media is unknown.

func FixLines

func FixLines(fixes []Fix) []string

FixLines renders fixes as the suggestion lines Error prints.

func Lines

func Lines(details []Detail) []string

Lines renders details as the lines Error prints.

func Render

func Render(operation, node, reason string, details, suggestions []string) string

Render is the one refusal text shape: "goav: cannot <operation> for <node>: <reason>" followed by Details and Suggestions lines.

Types

type Detail

type Detail struct {
	Key   string
	Value any
}

Detail is one typed machine-readable fact attached to a refusal. Callers read details through BuildError.Detail and BuildError.DetailLines.

func DetailLines

func DetailLines(lines []string) []Detail

DetailLines converts dynamically built "key=value" (or plain) lines into typed details, splitting each at the first '='. Literal detail lists use KV and Note instead.

func Details

func Details(details ...Detail) []Detail

Details collects typed details, dropping empties.

func KV

func KV(key string, value any) Detail

KV builds one typed detail from an explicit key and value: the value keeps its real type and is read back through BuildError.Detail(key).

func Note

func Note(message string) Detail

Note builds one keyless detail: a machine-readable note with no key.

func (Detail) String

func (d Detail) String() string

type Fix

type Fix struct {
	Message string
}

Fix is one concrete way to repair a refusal.

func Fixes

func Fixes(lines []string) []Fix

Fixes builds the fixes of a refusal from their messages, dropping empties.

func (Fix) String

func (f Fix) String() string

type Refusal

type Refusal struct {
	Phase     string
	Family    errcode.Family
	Code      errcode.Code
	Operation string
	Node      string
	Reason    string
	Details   []Detail
	Fixes     []Fix
	Cause     error
}

Refusal is a refusal the compiler raises. It carries exactly what a goav.BuildError carries; the root package converts it at its public boundary, so no caller ever sees a Refusal.

func (*Refusal) Error

func (r *Refusal) Error() string

Error renders the refusal as goav.BuildError does.

func (*Refusal) Unwrap

func (r *Refusal) Unwrap() error

Unwrap exposes the cause to errors.Is.

Jump to

Keyboard shortcuts

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