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.