previewprocessor

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 7 Imported by: ? 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 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

func NewHandler(c *client.Client) *Handler

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.

func (*Handler) WithVFS

func (h *Handler) WithVFS(env vfs.Env) *Handler

WithVFS sets the filesystem and stdin Preview reads the definition from. The zero Env keeps the process's.

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.

Jump to

Keyboard shortcuts

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