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: 5 Imported by: 1 module, 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 a thin SDK client for the OpenPipeline preview processor endpoint, which executes a processor definition against sample records and returns the matched/modified results.

The request body is a oneOf union envelope (processor definition + sample records) that the SDK accepts and forwards verbatim as a json.RawMessage without interpreting or validating its structure.

Error codes 408 (request timeout) and 429 (too many concurrent requests) are caught and surfaced with clear, distinct messages.

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 calls the preview processor endpoint.

func NewHandler

func NewHandler(c *httpclient.Client) *Handler

NewHandler creates a new preview processor handler.

func (*Handler) Preview

func (h *Handler) Preview(ctx context.Context, envelope json.RawMessage) (*PreviewProcessorResult, error)

Preview sends a processor preview request and returns the parsed results. The envelope parameter is the raw JSON request body (a oneOf union of processor definition + sample records) forwarded verbatim to the API.

type PreviewProcessorResult

type PreviewProcessorResult struct {
	Results []PreviewProcessorResultEntry `json:"results"`
}

PreviewProcessorResult is the full response from the preview endpoint.

type PreviewProcessorResultEntry

type PreviewProcessorResultEntry struct {
	Matched bool           `json:"matched"`
	Record  map[string]any `json:"record,omitempty"`
}

PreviewProcessorResultEntry is a single result entry from the preview endpoint.

Jump to

Keyboard shortcuts

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