apiaggregator

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Kind is the kind of APIAggregator.
	Kind = "APIAggregator"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAggregator

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

APIAggregator is a filter to aggregate several HTTP API responses.

func (*APIAggregator) Close

func (aa *APIAggregator) Close()

Close closes APIAggregator.

func (*APIAggregator) DefaultSpec

func (aa *APIAggregator) DefaultSpec() interface{}

DefaultSpec returns default spec of APIAggregator.

func (*APIAggregator) Description

func (aa *APIAggregator) Description() string

Description returns the description of APIAggregator.

func (*APIAggregator) Handle

func (aa *APIAggregator) Handle(ctx context.HTTPContext) (result string)

Handle limits HTTPContext.

func (*APIAggregator) Inherit

func (aa *APIAggregator) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)

Inherit inherits previous generation of APIAggregator.

func (*APIAggregator) Init

func (aa *APIAggregator) Init(filterSpec *httppipeline.FilterSpec)

Init initializes APIAggregator.

func (*APIAggregator) Kind

func (aa *APIAggregator) Kind() string

Kind returns the kind of APIAggregator.

func (*APIAggregator) Results

func (aa *APIAggregator) Results() []string

Results returns the results of APIAggregator.

func (*APIAggregator) Status

func (aa *APIAggregator) Status() interface{}

Status returns status.

type Pipeline added in v1.2.0

type Pipeline struct {
	// Name is the name of pipeline in EG
	Name string `yaml:"name" jsonschema:"required"`

	// Method is the HTTP method for requesting this pipeline.
	Method string `yaml:"method" jsonschema:"omitempty,format=httpmethod"`

	// Path is the HTTP request path adaptor for requesting this pipeline.
	Path *pathadaptor.Spec `yaml:"path,omitempty" jsonschema:"omitempty"`

	// Header is the HTTP header adaptor for requestring this pipeline.
	Header *httpheader.AdaptSpec `yaml:"header,omitempty" jsonschema:"omitempty"`

	// DisableBody discart this pipeline's response body if it set to true.
	DisableBody bool `yaml:"disableBody" jsonschema:"omitempty"`
	// contains filtered or unexported fields
}

Pipeline is the single API HTTP Pipeline in default namespace.

type Spec

type Spec struct {
	// MaxBodyBytes in [0, 10MB]
	MaxBodyBytes int64 `yaml:"maxBodyBytes" jsonschema:"omitempty,minimum=0,maximum=102400"`

	// PartialSucceed indicates wether Whether regards the result of the original request as successful
	// or not when a request to some of the API pipelines fails.
	PartialSucceed bool `yaml:"partialSucceed"`

	// Timeout is the request duration for each APIs.
	Timeout string `yaml:"timeout" jsonschema:"omitempty,format=duration"`

	// MergeResponse indicates whether to merge JSON response bodies or not.
	MergeResponse bool `yaml:"mergeResponse"`

	// User describes HTTP service target via an existing Pipeline.
	Pipelines []*Pipeline `yaml:"pipelines" jsonschema:"required"`
	// contains filtered or unexported fields
}

Spec is APIAggregator's spec.

Jump to

Keyboard shortcuts

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