globalfilter

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: 8 Imported by: 0

Documentation

Overview

Package globalfilter provides GlobalFilter.

Index

Constants

View Source
const (
	// Category is the category of GlobalFilter.
	Category = supervisor.CategoryBusinessController

	// Kind is the kind of GlobalFilter.
	Kind = "GlobalFilter"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fallthrough added in v2.7.2

type Fallthrough struct {
	BeforePipeline bool `json:"beforePipeline,omitempty"`
	Pipeline       bool `json:"pipeline,omitempty"`
}

Fallthrough describes the fallthrough behavior.

type GlobalFilter

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

GlobalFilter is a business controller. It provides handler before and after pipeline in HTTPServer.

func (*GlobalFilter) Category

func (gf *GlobalFilter) Category() supervisor.ObjectCategory

Category returns the object category of itself.

func (*GlobalFilter) Close

func (gf *GlobalFilter) Close()

Close closes GlobalFilter itself.

func (*GlobalFilter) DefaultSpec

func (gf *GlobalFilter) DefaultSpec() interface{}

DefaultSpec returns the default spec. It must return a pointer to point a struct.

func (*GlobalFilter) Handle

func (gf *GlobalFilter) Handle(ctx *context.Context, handler context.Handler)

Handle `beforePipeline` and `afterPipeline` before and after the handler is executed.

func (*GlobalFilter) Inherit

func (gf *GlobalFilter) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)

Inherit inherits previous generation of GlobalFilter.

func (*GlobalFilter) Init

func (gf *GlobalFilter) Init(superSpec *supervisor.Spec)

Init initializes GlobalFilter.

func (*GlobalFilter) Kind

func (gf *GlobalFilter) Kind() string

Kind returns the unique kind name to represent itself.

func (*GlobalFilter) Status

func (gf *GlobalFilter) Status() *supervisor.Status

Status returns its runtime status.

type Spec

type Spec struct {
	BeforePipeline *pipeline.Spec `json:"beforePipeline,omitempty"`
	AfterPipeline  *pipeline.Spec `json:"afterPipeline,omitempty"`
	Fallthrough    Fallthrough    `json:"fallthrough,omitempty"`
}

Spec describes the GlobalFilter.

func (*Spec) Validate

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

Validate validates Spec.

Jump to

Keyboard shortcuts

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