sinkbinding

package
v0.3.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 4 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 sinkbinding defines the pipeline sink execution marker and reserved parameter names injected by the sink runtime.

Input is the only user-facing binding name that saved sink operations should reference. The __braidplane_* names are internal runtime metadata used to preserve backend-native behavior behind that single public binding and are rejected from user-supplied sink config.

Index

Constants

View Source
const (
	// Input is the public reserved sink payload binding exposed to saved sink operations.
	Input = "input"

	// InternalInputRows carries runtime row payloads for SQL connectors that can
	// materialize a native input relation.
	InternalInputRows = "__braidplane_input_rows"
	// InternalInputColumns carries the ordered column list paired with
	// InternalInputRows.
	InternalInputColumns = "__braidplane_input_columns"
	// InternalInputRepresentation carries the runtime payload representation for
	// connectors that need representation-sensitive handling behind the single
	// public Input binding.
	InternalInputRepresentation = "__braidplane_input_representation"
	// InternalInputFileMetadata carries safe metadata for native file payloads.
	InternalInputFileMetadata = "__braidplane_input_file"
	// InternalInputFileFilename carries the file payload filename for template substitution.
	InternalInputFileFilename = "__braidplane_input_file.filename"
	// InternalInputFileMIMEType carries the file payload media type for template substitution.
	InternalInputFileMIMEType = "__braidplane_input_file.mime_type"
	// InternalInputFileSizeBytes carries the file payload size for template substitution.
	InternalInputFileSizeBytes = "__braidplane_input_file.size_bytes"
	// InternalInputFileDigestAlgorithm carries the file payload digest algorithm.
	InternalInputFileDigestAlgorithm = "__braidplane_input_file.digest_algorithm"
	// InternalInputFileDigest carries the file payload digest value for template substitution.
	InternalInputFileDigest = "__braidplane_input_file.digest"
	// InternalIdempotencyKey carries the stable runtime sink idempotency key.
	InternalIdempotencyKey = "__braidplane_sink_idempotency_key"
	// InternalIdempotencyClass carries the declared sink idempotency class.
	InternalIdempotencyClass = "__braidplane_sink_idempotency_class"
	// InternalEffectStartedAt retains the original durable claim time across recovery.
	InternalEffectStartedAt = "__braidplane_sink_effect_started_at"
	// InternalReplayIdentity carries the original effect namespace for operator
	// replays that must target the same deterministic external object.
	InternalReplayIdentity = "__braidplane_sink_replay_identity"
)
View Source
const RecordIDParam = "runtime.sink.record_id"

Variables

This section is empty.

Functions

func IsSinkExecution

func IsSinkExecution(ctx context.Context) bool

IsSinkExecution reports whether the operation was marked as a sink execution.

func ReservedNames

func ReservedNames() []string

ReservedNames lists the parameter names owned by the sink runtime.

func ValidRecordField

func ValidRecordField(name string) bool

ValidRecordField reports whether a name identifies a single literal field.

func ValidRecordUpdateOperation

func ValidRecordUpdateOperation(operation map[string]any) bool

ValidRecordUpdateOperation restricts dispatch to one bound path segment and an explicitly projected JSON body.

func WithHTTPRecordUpdate

func WithHTTPRecordUpdate(ctx context.Context, recordID string, properties map[string]string, reconcile bool, readback RecordReadback) context.Context

WithHTTPRecordUpdate binds one record mutation or readback to a sink dispatch.

func WithSinkExecution

func WithSinkExecution(ctx context.Context) context.Context

WithSinkExecution marks an operation as a pipeline sink execution.

Types

type HTTPRecordUpdate

type HTTPRecordUpdate struct {
	RecordID   string            `json:"record_id"`
	Properties map[string]string `json:"properties"`
	Reconcile  bool              `json:"reconcile,omitempty"`
	Readback   RecordReadback    `json:"readback"`
}

HTTPRecordUpdate carries the bounded sink's desired state across the encrypted executor boundary.

func HTTPRecordUpdateFrom

func HTTPRecordUpdateFrom(ctx context.Context) *HTTPRecordUpdate

HTTPRecordUpdateFrom returns nil for ordinary single-request sinks.

type RecordReadback

type RecordReadback struct {
	IdentityField   string `json:"identity_field"`
	FieldsObject    string `json:"fields_object,omitempty"`
	SelectParameter string `json:"select_parameter,omitempty"`
}

RecordReadback describes a JSON response containing the record identity and mapped field values.

func (RecordReadback) Valid

func (r RecordReadback) Valid() bool

Valid reports whether a response can carry the configured identity and fields.

Jump to

Keyboard shortcuts

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