Documentation
¶
Index ¶
- Constants
- type GlobalFilter
- func (gf *GlobalFilter) Category() supervisor.ObjectCategory
- func (gf *GlobalFilter) Close()
- func (gf *GlobalFilter) CreateAndUpdateAfterPipelineForSpec(spec *Spec, previousGeneration *httppipeline.HTTPPipeline) error
- func (gf *GlobalFilter) CreateAndUpdateBeforePipelineForSpec(spec *Spec, previousGeneration *httppipeline.HTTPPipeline) error
- func (gf *GlobalFilter) CreateAndUpdatePipeline(spec *pipelineSpec, previousGeneration *httppipeline.HTTPPipeline) (*httppipeline.HTTPPipeline, error)
- func (gf *GlobalFilter) DefaultSpec() interface{}
- func (gf *GlobalFilter) Handle(ctx context.HTTPContext, httpHandle protocol.HTTPHandler)
- func (gf *GlobalFilter) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
- func (gf *GlobalFilter) Init(superSpec *supervisor.Spec)
- func (gf *GlobalFilter) Kind() string
- func (gf *GlobalFilter) Status() *supervisor.Status
- type Spec
Constants ¶
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 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) CreateAndUpdateAfterPipelineForSpec ¶
func (gf *GlobalFilter) CreateAndUpdateAfterPipelineForSpec(spec *Spec, previousGeneration *httppipeline.HTTPPipeline) error
CreateAndUpdateAfterPipelineForSpec creates afterPipeline if the spec is nil, otherwise it updates with the spec.
func (*GlobalFilter) CreateAndUpdateBeforePipelineForSpec ¶
func (gf *GlobalFilter) CreateAndUpdateBeforePipelineForSpec(spec *Spec, previousGeneration *httppipeline.HTTPPipeline) error
CreateAndUpdateBeforePipelineForSpec creates beforPipeline if the spec is nil, otherwise it updates by the spec.
func (*GlobalFilter) CreateAndUpdatePipeline ¶
func (gf *GlobalFilter) CreateAndUpdatePipeline(spec *pipelineSpec, previousGeneration *httppipeline.HTTPPipeline) (*httppipeline.HTTPPipeline, error)
CreateAndUpdatePipeline creates and updates GlobalFilter's pipelines.
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.HTTPContext, httpHandle protocol.HTTPHandler)
Handle `beforePipeline` and `afterPipeline` before and after the httpHandler 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 httppipeline.Spec `yaml:"beforePipeline" jsonschema:"omitempty"` AfterPipeline httppipeline.Spec `yaml:"afterPipeline" jsonschema:"omitempty"` }
Spec describes the GlobalFilter.