Documentation
¶
Overview ¶
Package previewprocessor is the CLI resource layer for the OpenPipeline preview processor endpoint. It delegates HTTP calls to the SDK and shapes the response into display-ready PreviewResult entries with table tags.
File reading (the --file flag) is handled here rather than in the SDK, in line with the dtctl delegation contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler previews OpenPipeline processor definitions against sample records.
func NewHandler ¶
NewHandler creates a new preview processor handler.
func (*Handler) Preview ¶
func (h *Handler) Preview(filename, configID string) ([]PreviewResult, error)
Preview reads a processor definition body from the given file path ("-" for stdin), wraps it in the preview request envelope (adding configID when set), sends it to the preview endpoint, and returns the display-ready results.
The file is the processor body itself (e.g. {"type":"dql","dqlScript":..., "sampleData":...}) — the same shape a processor has inside a pipeline config — not the transport envelope. dtctl builds {"processor":<body>,"configId":...} around it, so callers never hand-write the wrapper.
type PreviewResult ¶
type PreviewResult struct {
Matched bool `json:"matched" yaml:"matched" table:"MATCHED"`
Record map[string]any `json:"record,omitempty" yaml:"record,omitempty" table:"RECORD"`
}
PreviewResult is the CLI read-model for a single preview result entry.