Documentation
¶
Index ¶
- func DeserializeStateWithIssues(input []byte) (State, []ValidationIssue, error)
- func InlineSQLFrom(operationInline map[string]any) string
- func LayoutGraph(spec *PipelineSpec) map[string]Position
- func PipelineFormatFromPath(path string) (model.PipelineFormat, error)
- func ResolvePipelineExportFormat(context Context) model.PipelineFormat
- func ResolveSinkBackend(operationType string) model.SinkBackend
- func SerializePipelineSpec(input State, format model.PipelineFormat) ([]byte, error)
- func SerializeStateCanonical(input State) ([]byte, error)
- func SerializeStateComparable(input State) ([]byte, error)
- func ToDraftPipeline(state State) (*pipelinespec.Pipeline, error)
- func ToPipeline(state State) (*pipelinespec.Pipeline, error)
- func TransformInputsForSources(existing map[string]pipelinespec.StepInput, sources []slug.Slug) (map[string]pipelinespec.StepInput, error)
- func ValidatePipelineSpec(format model.PipelineFormat, input []byte) error
- func ValidateState(input State) error
- type Binding
- type Context
- type Edge
- type Graph
- type GraphNode
- type PipelineSpec
- type Position
- type State
- type ValidationIssue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeStateWithIssues ¶
func DeserializeStateWithIssues( input []byte, ) (State, []ValidationIssue, error)
func InlineSQLFrom ¶
func LayoutGraph ¶
func LayoutGraph(spec *PipelineSpec) map[string]Position
LayoutGraph computes deterministic positions for all nodes in the builder graph.
Algorithm: 1. Assign each step to a fixed column by kind (query/transform/sink) 2. Within each column, preserve pipeline spec order (pipeline.steps array) 3. Assign Y by position within the kind bucket using fixed row spacing
func PipelineFormatFromPath ¶
func PipelineFormatFromPath(path string) (model.PipelineFormat, error)
func ResolvePipelineExportFormat ¶
func ResolvePipelineExportFormat(context Context) model.PipelineFormat
func ResolveSinkBackend ¶
func ResolveSinkBackend(operationType string) model.SinkBackend
ResolveSinkBackend returns the catalog-defined sink backend for a builder operation type.
func SerializePipelineSpec ¶
func SerializePipelineSpec(input State, format model.PipelineFormat) ([]byte, error)
func SerializeStateCanonical ¶
SerializeStateCanonical emits a stable JSON representation for diffs/reviews. We canonicalize and validate first so all writers produce the same output shape.
func ToDraftPipeline ¶
func ToDraftPipeline(state State) (*pipelinespec.Pipeline, error)
ToDraftPipeline reconstructs a draft Pipeline spec from builder graph state.
func ToPipeline ¶
func ToPipeline(state State) (*pipelinespec.Pipeline, error)
ToPipeline reconstructs a Pipeline spec from builder graph state. The authored pipeline step order is preserved while graph bindings update dependencies.
func TransformInputsForSources ¶
func TransformInputsForSources( existing map[string]pipelinespec.StepInput, sources []slug.Slug, ) (map[string]pipelinespec.StepInput, error)
func ValidatePipelineSpec ¶
func ValidatePipelineSpec(format model.PipelineFormat, input []byte) error
func ValidateState ¶
ValidateState enforces structural integrity before save/export. We fail fast on invalid slugs or broken references to prevent corrupt graph state.
Types ¶
type Context ¶
type Context struct {
ExpectedVersionID *string `json:"expected_spec_hash,omitempty"`
CurrentVersionID *string `json:"current_version_spec_hash,omitempty"`
DraftBasedOnVersionID *string `json:"draft_based_on_spec_hash,omitempty"`
SourceFormat *model.PipelineFormat `json:"source_format,omitempty"`
ExportFormat *model.PipelineFormat `json:"export_format,omitempty"`
Deterministic bool `json:"deterministic"`
TimeoutSecs *int `json:"timeout_seconds,omitempty"`
RecordMeta bool `json:"record_run_metadata"`
TargetOrgSlug string `json:"target_org_slug,omitempty"`
TargetProjectSlug string `json:"target_project_slug,omitempty"`
TargetEnvironmentSlug string `json:"target_environment_slug,omitempty"`
}
type PipelineSpec ¶
type PipelineSpec struct {
Metadata pipelinespec.Metadata `json:"metadata" validate:"required"`
Steps []pipelinespec.Step `json:"steps" validate:"dive"`
}
type State ¶
type State struct {
PipelineSpec PipelineSpec `json:"pipeline_spec" validate:"required"`
Graph Graph `json:"graph" validate:"required"`
Context Context `json:"context,omitempty"`
}
func CanonicalizeState ¶
CanonicalizeState normalizes values and sorts unordered graph collections. Pipeline step and graph node order are authored source state and must remain stable across a visual round trip.
func DeserializeState ¶
DeserializeState loads state from JSON and normalizes it immediately. Canonicalization on read keeps round-trips deterministic across UI/code boundaries.
func FromPipeline ¶
func FromPipeline(pipeline *pipelinespec.Pipeline) (State, error)
FromPipeline maps a validated pipeline spec into builder graph state. This establishes the visual load path for supported step kinds in a deterministic form.
type ValidationIssue ¶
func ValidateStateIssues ¶
func ValidateStateIssues(input State) []ValidationIssue