pipe

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 5 Imported by: ? modules, 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 pipe provides protocol processing pipelines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine executes pipelines.

func NewEngine

func NewEngine(lib *protocol.Library) *Engine

NewEngine creates a new pipeline engine.

func (*Engine) Execute

func (e *Engine) Execute(p *Pipeline, input []byte) ([]Result, error)

Execute runs a pipeline on the given input data.

type Pipeline

type Pipeline struct {
	Name   string  `json:"name"`
	Stages []Stage `json:"stages"`
}

Pipeline is a sequence of processing stages.

func ParsePipeline

func ParsePipeline(data string) (*Pipeline, error)

ParsePipeline parses a pipeline definition from JSON.

func ParsePipelineShort

func ParsePipelineShort(notation string) (*Pipeline, error)

ParsePipelineShort parses a short pipeline notation like "decode:IPv4|filter:version=4|encode:IPv4".

type Result

type Result struct {
	Stage   string `json:"stage"`
	Type    string `json:"type"`
	Data    any    `json:"data"`
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

Result holds the output of a pipeline execution.

type Stage

type Stage struct {
	Type     string            `json:"type"` // "decode", "filter", "transform", "encode"
	Protocol string            `json:"protocol,omitempty"`
	Config   map[string]string `json:"config,omitempty"`
}

Stage represents a pipeline processing stage.

Jump to

Keyboard shortcuts

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