transport

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ProtocolVersion defines the transport contract version shared across hub, connector, and SDK.
	ProtocolVersion = "1.0.0"
	// ProtocolMetadataKey is the gRPC metadata key used to advertise the protocol version.
	ProtocolMetadataKey = "bubu-transport-protocol"
	// StartupCapabilitiesMetadataKey declares whether an initial
	// connector.capabilities snapshot is expected during startup. It is carried
	// on connector.ready and mirrored into the connector -> hub stream metadata
	// for passive hub-side observation.
	StartupCapabilitiesMetadataKey = "startup.capabilities"
	// StartupCapabilitiesRequired means the connector will send an initial
	// connector.capabilities update as part of startup.
	StartupCapabilitiesRequired = "required"
	// StartupCapabilitiesNone means the connector has no initial capability
	// snapshot to send during startup.
	StartupCapabilitiesNone = "none"
)

Variables

This section is empty.

Functions

func AppendBindingEnvOverrides

func AppendBindingEnvOverrides(envVars []corev1.EnvVar, info *transportpb.BindingInfo) []corev1.EnvVar

AppendBindingEnvOverrides injects provider-specific env overrides encoded in the binding payload, validating env var names to prevent invalid workloads.

func AppendTransportHeartbeatEnv

func AppendTransportHeartbeatEnv(envVars []corev1.EnvVar, interval time.Duration) []corev1.EnvVar

AppendTransportHeartbeatEnv surfaces the heartbeat interval so runtimes can tune their own watchdogs without parsing controller config.

func AppendTransportMetadataEnv

func AppendTransportMetadataEnv(envVars []corev1.EnvVar, info *transportpb.BindingInfo) []corev1.EnvVar

AppendTransportMetadataEnv adds convenience env vars derived from BindingInfo so runtimes can avoid re-parsing the transport envelope.

func BindingEnvOverrides

func BindingEnvOverrides(info *transportpb.BindingInfo) map[string]string

BindingEnvOverrides returns the sanitized env override map encoded inside a BindingInfo payload so non-controller workflows (connectors, SDKs) can apply the shared parsing logic without duplicating it.

func DecodeBindingInfo

func DecodeBindingInfo(value string) (*transportpb.BindingInfo, error)

DecodeBindingInfo extracts the BindingInfo proto from a serialized binding envelope.

func EncodeBindingEnvelope

func EncodeBindingEnvelope(ref BindingReference, info *transportpb.BindingInfo) (string, error)

EncodeBindingEnvelope serializes binding metadata into the shared JSON payload consumed by controllers, connectors, and SDK helpers.

func NormalizeStartupCapabilitiesMode added in v0.1.1

func NormalizeStartupCapabilitiesMode(mode string) (string, error)

NormalizeStartupCapabilitiesMode validates the startup capability declaration and returns the normalized mode.

func SanitizeBindingAnnotationValue

func SanitizeBindingAnnotationValue(value string) string

SanitizeBindingAnnotationValue converts the serialized binding envelope into the canonical "namespace/name" annotation value (or just name when namespace is empty). Returns "" on failure.

func SetOrReplaceEnvVar

func SetOrReplaceEnvVar(envVars []corev1.EnvVar, env corev1.EnvVar) []corev1.EnvVar

SetOrReplaceEnvVar replaces the env var with the same name if it exists or appends it otherwise, returning the updated slice.

func ValidateProtocolVersion

func ValidateProtocolVersion(version string) error

ValidateProtocolVersion checks that the provided version matches this runtime exactly.

Types

type BindingPayload

type BindingPayload struct {
	Reference BindingReference
	Info      *transportpb.BindingInfo
	Raw       string
}

BindingPayload represents the parsed contents of a serialized binding env value.

func ParseBindingPayload

func ParseBindingPayload(value string) (BindingPayload, error)

ParseBindingPayload returns the parsed binding reference, binding info, and raw payload.

type BindingReference

type BindingReference struct {
	Name      string
	Namespace string
}

BindingReference identifies a TransportBinding (namespace/name).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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