Documentation
¶
Index ¶
- Variables
- func ContractReasonStrings() []string
- func EdgeCompatibilityDetail(diagnostic *EdgeCompatibilityResult) string
- func Load(path string, data []byte) (*pipelinespec.Pipeline, error)
- func LoadFile(path string) (*pipelinespec.Pipeline, error)
- func SinkInputKindForStep(step pipelinespec.Step) model.TransformOutputKind
- func StepInputContract(step pipelinespec.Step) *payload.Contract
- func Validate(p *pipelinespec.Pipeline) error
- func ValidateDirectory(root string) (int, error)
- func ValidateStepInputCompatibility(p *pipelinespec.Pipeline) error
- type ContractReason
- func (i ContractReason) IsAContractReason() bool
- func (i ContractReason) MarshalJSON() ([]byte, error)
- func (i ContractReason) MarshalText() ([]byte, error)
- func (i ContractReason) String() string
- func (i *ContractReason) UnmarshalJSON(data []byte) error
- func (i *ContractReason) UnmarshalText(text []byte) error
- type EdgeCompatibilityResult
- func AggregateStepInputCompatibilityDiagnostics(p *pipelinespec.Pipeline) []EdgeCompatibilityResult
- func EvaluateEdgeCompatibility(edge EdgeLink, producer *payload.Contract, consumer *payload.Contract) EdgeCompatibilityResult
- func EvaluateEdgeDiagnosticsForSteps(fromStep pipelinespec.Step, toStep pipelinespec.Step) *EdgeCompatibilityResult
- type EdgeContext
- type EdgeLink
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingField = xerror.PipelineMissingField() ErrOrphanStep = xerror.OrphanStep() ErrContractMismatch = xerror.PipelineContractMismatch() ErrInvalidFieldPath = xerror.InvalidFieldPath() )
var ErrNoPipelineSpecsFound = xerror.NoPipelineSpecsFound()
Functions ¶
func ContractReasonStrings ¶
func ContractReasonStrings() []string
ContractReasonStrings returns a slice of all String values of the enum
func EdgeCompatibilityDetail ¶
func EdgeCompatibilityDetail(diagnostic *EdgeCompatibilityResult) string
EdgeCompatibilityDetail formats expected and actual contract values so validation diagnostics identify the failing field or facet.
func Load ¶
func Load(path string, data []byte) (*pipelinespec.Pipeline, error)
Load decodes and validates a pipeline spec from data.
func LoadFile ¶
func LoadFile(path string) (*pipelinespec.Pipeline, error)
LoadFile reads and validates a single pipeline spec file.
func SinkInputKindForStep ¶
func SinkInputKindForStep(step pipelinespec.Step) model.TransformOutputKind
func StepInputContract ¶
func StepInputContract(step pipelinespec.Step) *payload.Contract
StepInputContract returns the explicit consumer contract for a transform or sink step.
func Validate ¶
func Validate(p *pipelinespec.Pipeline) error
Validate performs structural validation for steps, graph inputs, connectivity, and connector-specific incremental source contracts.
func ValidateDirectory ¶
ValidateDirectory loads all supported pipeline spec files in a directory tree. It skips known schema files and returns an aggregated error if any spec is invalid.
func ValidateStepInputCompatibility ¶
func ValidateStepInputCompatibility(p *pipelinespec.Pipeline) error
ValidateStepInputCompatibility enforces explicit per-edge contracts and validates inferred edge contracts after the pipeline structure is valid.
Types ¶
type ContractReason ¶
type ContractReason int
ContractReason identifies why an edge contract comparison failed.
const ( ContractReasonUnknown ContractReason = iota // unknown ContractReasonRepresentationMismatch // contract_representation_mismatch ContractReasonRootShapeMismatch // contract_root_shape_mismatch ContractReasonMissingRequiredField // contract_missing_required_field ContractReasonTypeMismatch // contract_type_mismatch ContractReasonNullabilityMismatch // contract_nullability_mismatch ContractReasonInvalidDefinition // contract_invalid_definition ContractReasonMissingContract // missing_contract ContractReasonFieldValidationFailed // contract_field_validation_failed )
func ContractReasonString ¶
func ContractReasonString(s string) (ContractReason, error)
ContractReasonString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ContractReasonValues ¶
func ContractReasonValues() []ContractReason
ContractReasonValues returns all values of the enum
func (ContractReason) IsAContractReason ¶
func (i ContractReason) IsAContractReason() bool
IsAContractReason returns "true" if the value is listed in the enum definition. "false" otherwise
func (ContractReason) MarshalJSON ¶
func (i ContractReason) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for ContractReason
func (ContractReason) MarshalText ¶
func (i ContractReason) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for ContractReason
func (ContractReason) String ¶
func (i ContractReason) String() string
func (*ContractReason) UnmarshalJSON ¶
func (i *ContractReason) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for ContractReason
func (*ContractReason) UnmarshalText ¶
func (i *ContractReason) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for ContractReason
type EdgeCompatibilityResult ¶
type EdgeCompatibilityResult struct {
EdgeSlug string `json:"edge_slug"`
FromStepSlug slug.Slug `json:"from_step_slug"`
ToStepSlug slug.Slug `json:"to_step_slug"`
Compatible bool `json:"compatible"`
ReasonCode ContractReason `json:"reason_code,omitempty"`
Expected map[string]string `json:"expected,omitempty"`
Actual map[string]string `json:"actual,omitempty"`
}
EdgeCompatibilityResult captures the compatibility decision for one step-input edge.
func AggregateStepInputCompatibilityDiagnostics ¶
func AggregateStepInputCompatibilityDiagnostics( p *pipelinespec.Pipeline, ) []EdgeCompatibilityResult
AggregateStepInputCompatibilityDiagnostics returns edge-scoped diagnostics for compatibility failures that involve more than one edge or source-level state.
func EvaluateEdgeCompatibility ¶
func EvaluateEdgeCompatibility( edge EdgeLink, producer *payload.Contract, consumer *payload.Contract, ) EdgeCompatibilityResult
EvaluateEdgeCompatibility compares producer and consumer contracts for one edge. Missing consumer facets are treated as unconstrained in this slice.
func EvaluateEdgeDiagnosticsForSteps ¶
func EvaluateEdgeDiagnosticsForSteps( fromStep pipelinespec.Step, toStep pipelinespec.Step, ) *EdgeCompatibilityResult
evaluateEdgeDiagnosticsForSteps assesses contract-based compatibility for one step-to-step edge.
type EdgeContext ¶
type EdgeContext struct {
FromStep pipelinespec.Step
ToStep pipelinespec.Step
}
func StepEdgeContexts ¶
func StepEdgeContexts(p *pipelinespec.Pipeline) ([]EdgeContext, error)