Documentation
¶
Overview ¶
Package transport is the small integration boundary between Flow and concrete transport libraries.
A transport library contributes an action.Library through Register and may expose three kinds of behavior:
- runtime actions and streams, returned by its factory;
- DSL binding resolvers, represented by actions routed with OnDSL;
- listener entry points, represented by actions routed with OnTrigger.
The compiler resolves DSL bindings through ResolveModifier. A runner can locate a listener through FindTrigger. Transport-specific connections, subscriptions, shutdown, and retries remain inside the concrete transport action; this package does not own goroutines or network clients.
The cold path is intentionally dynamic: @require options are decoded from string values and action bindings are type-erased. The execution path after resolution is the typed Kernel action or stream selected by the transport.
The contract is deliberately limited to:
- Register, Load, and KnownPrefixes for libraries;
- Decode for typed @require configuration;
- OnDSL and OnTrigger for binding discovery;
- ResolveModifier, FindTrigger, RequireTrigger, and AsLibrary for assembly.
No concrete protocol belongs in this package. HTTP, NATS, CLI, cron, and other transports are separate modules that depend on this boundary.
Index ¶
- func AsLibrary(v any) action.Library
- func Decode[T any](ctx context.Context, raw map[string]string) (T, error)
- func FindTrigger(target any, protocol string) (action.AnyAction, bool)
- func KnownPrefixes() []string
- func Load(ctx context.Context, prefix string, raw map[string]string) (action.Library, error)
- func OnDSL(kind string) action.Binding
- func OnTrigger(protocol string) action.Binding
- func Register[T any](prefix string, factory Factory[T])
- func RequireTrigger(target any, protocol string) (action.AnyAction, error)
- func ResolveModifier(ctx context.Context, reg *action.Registry, binding *dslparse.TransportBinding) (action.Binding, bool, error)
- type DSLBinding
- type Factory
- type Modifier
- type RuntimeAction
- type TriggerBinding
- type Workload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsLibrary ¶ added in v0.9.0
AsLibrary normalizuje dowolny workload (Action, StreamAction, Library, slice) do action.Library.
func Decode ¶
Decode maps a raw string map into a typed options struct.
flow:"key" key name in the @require block default:"..." value used when the key is absent validate:"..." ecosystem validator tag (required, url, min, …)
Unknown keys are rejected. Values that fail `validate` are returned as xerr.Validation with structured details.
func FindTrigger ¶ added in v0.9.0
FindTrigger wyszukuje akcję z bindingiem OnTrigger(protocol) w dowolnym rejestrze lub liście akcji.
func KnownPrefixes ¶
func KnownPrefixes() []string
KnownPrefixes returns sorted list of all registered transport prefixes
func RequireTrigger ¶ added in v0.9.0
RequireTrigger zwraca akcję triggera lub błąd.
func ResolveModifier ¶ added in v0.9.0
func ResolveModifier(ctx context.Context, reg *action.Registry, binding *dslparse.TransportBinding) (action.Binding, bool, error)
ResolveModifier finds the registered resolver for a parsed transport binding (for example :route= or :nats=) and passes the complete binding through so adapters retain protocol-specific fields.
Types ¶
type DSLBinding ¶ added in v0.9.0
type DSLBinding struct{ Kind string }
DSLBinding oznacza akcję odpowiedzialną za rezolucję konkretnego modyfikatora DSL.
type RuntimeAction ¶ added in v0.9.0
RuntimeAction to sygnatura akcji nasłuchującej w transporcie.
type TriggerBinding ¶ added in v0.9.0
type TriggerBinding struct{ Protocol string }
TriggerBinding oznacza akcję będącą punktem wejścia dla danego protokołu.