pipeline

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package pipeline provides the pipeline of Easegress.

Index

Constants

View Source
const (
	// Category is the category of Pipeline.
	Category = supervisor.CategoryPipeline

	// Kind is the kind of Pipeline.
	Kind = "Pipeline"

	// BuiltInFilterEnd is the name of the build-in end filter.
	BuiltInFilterEnd = "END"
)

Variables

This section is empty.

Functions

func MockGetFilter

func MockGetFilter(p *Pipeline, name string) filters.Filter

MockGetFilter is used to get filter from pipeline for testing.

Types

type FilterStat

type FilterStat struct {
	Name     string
	Kind     string
	Result   string
	Duration time.Duration
}

FilterStat records the statistics of a filter.

type FlowNode

type FlowNode struct {
	FilterName  string            `json:"filter" jsonschema:"required,format=urlname"`
	FilterAlias string            `json:"alias,omitempty"`
	Namespace   string            `json:"namespace,omitempty"`
	JumpIf      map[string]string `json:"jumpIf,omitempty"`
	// contains filtered or unexported fields
}

FlowNode describes one node of the pipeline flow.

type HandleWithBeforeAfterOption added in v2.7.2

type HandleWithBeforeAfterOption struct {
	FallthroughBefore   bool
	FallthroughPipeline bool
}

HandleWithBeforeAfterOption is the option of HandleWithBeforeAfter. FallthroughBefore: if true, the pipeline will be executed even if the before pipeline ends. FallthroughPipeline: if true, the after pipeline will be executed even if the pipeline ends.

type Pipeline

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

Pipeline is Object Pipeline.

func (*Pipeline) Category

func (p *Pipeline) Category() supervisor.ObjectCategory

Category returns the category of Pipeline.

func (*Pipeline) Close

func (p *Pipeline) Close()

Close closes Pipeline.

func (*Pipeline) DefaultSpec

func (p *Pipeline) DefaultSpec() interface{}

DefaultSpec returns the default spec of Pipeline.

func (*Pipeline) Handle

func (p *Pipeline) Handle(ctx *context.Context) string

Handle is the handler to deal with the request.

func (*Pipeline) HandleWithBeforeAfter

func (p *Pipeline) HandleWithBeforeAfter(ctx *context.Context, before, after *Pipeline, option HandleWithBeforeAfterOption) string

HandleWithBeforeAfter handles the request, with additional flow defined by the before/after pipeline.

func (*Pipeline) Inherit

func (p *Pipeline) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object, muxMapper context.MuxMapper)

Inherit inherits previous generation of Pipeline.

func (*Pipeline) Init

func (p *Pipeline) Init(superSpec *supervisor.Spec, muxMapper context.MuxMapper)

Init initializes Pipeline.

func (*Pipeline) Kind

func (p *Pipeline) Kind() string

Kind returns the kind of Pipeline.

func (*Pipeline) Status

func (p *Pipeline) Status() *supervisor.Status

Status returns Status generated by Runtime.

type Spec

type Spec struct {
	Flow       []FlowNode               `json:"flow,omitempty"`
	Filters    []map[string]interface{} `json:"filters" jsonschema:"required"`
	Resilience []map[string]interface{} `json:"resilience,omitempty"`
	Data       map[string]interface{}   `json:"data,omitempty"`
}

Spec describes the Pipeline.

func (*Spec) Validate

func (s *Spec) Validate() (err error)

Validate validates Spec.

func (*Spec) ValidateJumpIf

func (s *Spec) ValidateJumpIf(specs map[string]filters.Spec)

ValidateJumpIf validates whether the target of JumpIfs are valid or not.

type Status

type Status struct {
	Health  string                 `json:"health"`
	Filters map[string]interface{} `json:"filters"`
}

Status is the status of Pipeline.

func (*Status) ToMetrics

func (s *Status) ToMetrics(service string) []*easemonitor.Metrics

ToMetrics implements easemonitor.Metricer.

Jump to

Keyboard shortcuts

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