Help us shape the future of Go! Take the 2026 Go Developer Survey

pipeline

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pipeline provides the `@pipeline NAME ... @end` directive. The block is stored in meta["pipelines"] and compiled into a sub-action mounted on the resolver by the Materialize step, so later pipelines can reference it by name.

Typical use:

@pipeline safe_fetch
  fetch -> validate
@end

{ url: "https://x" } -> safe_fetch

Index

Constants

View Source
const ID = "pipeline"

Variables

View Source
var Directive = compiler.Directive{
	Name:    "pipeline",
	Example: "@pipeline pack:route=\"POST /pack\"\n  src -> dst\n@end",
	Handler: handleDirective,
}

Directive parses `@pipeline NAME ... @end` and stores the block body in meta["pipelines"][NAME]. Inline or indented header modifiers — `:key` or `:key=value`, with optional quoted values — are collected into meta["pipeline_modifiers"][NAME] and applied to the compiled sub-pipeline during materialization.

Each declared pipeline is mounted on the resolver as `pipeline.<name>` (the prefix is added only when the name has no dot), so a pipeline may reference another by its canonical name.

`@pipeline name` with no modifiers is valid and behaves exactly as it did before modifiers were supported.

View Source
var EndDirective = compiler.Directive{
	Name:    "end",
	Example: "@pipeline p\n  ...\n@end",
	Handler: handleEnd,
}

EndDirective rejects a stray `@end`. It only fires when `@end` appears outside a `@pipeline` block, because the pipeline handler consumes its own terminator while scanning the body and never forwards it to the directive table. Outside a pipeline the fallback path is the macro primary, which reports `unknown macro @end` — a diagnostic that hides the actual problem. This handler replaces it with a message that names the missing opening directive.

Registered in Bundle().Directives so every top-level `@end` in any fixture is a registered directive; the native fixture contract test enforces that invariant across every embedded .nflow file.

Functions

func Bundle

func Bundle(_ map[string]string) compiler.Bundle

Types

type AppliedModifier added in v0.14.0

type AppliedModifier struct {
	Raw    string
	Source compiler.ModifierSource
}

AppliedModifier is a modifier together with the origin that produced it. Pipeline directive handlers build these so `nflow explain` can attribute every effective modifier to a pipeline or profile.

Jump to

Keyboard shortcuts

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