pipeline

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterChannel

type AfterChannel struct {
	Handlers []AfterHandlerTempl
}

AfterChannel contains the functions to be called after the handler method is executed

func NewAfterChannel

func NewAfterChannel() *AfterChannel

NewAfterChannel ctor

func (*AfterChannel) Clear

func (p *AfterChannel) Clear()

Clear should not be used after pitaya is running

func (*AfterChannel) ExecuteAfterPipeline

func (p *AfterChannel) ExecuteAfterPipeline(ctx context.Context, res interface{}, err error) (interface{}, error)

ExecuteAfterPipeline calls registered handlers

func (*AfterChannel) PushBack

func (p *AfterChannel) PushBack(h AfterHandlerTempl)

PushBack should not be used after pitaya is running

func (*AfterChannel) PushFront

func (p *AfterChannel) PushFront(h AfterHandlerTempl)

PushFront should not be used after pitaya is running

type AfterHandlerTempl

type AfterHandlerTempl func(ctx context.Context, out interface{}, err error) (interface{}, error)

AfterHandlerTempl is a function for the after handler, receives both the handler response and the error returned

type Channel

type Channel struct {
	Handlers []HandlerTempl
}

Channel contains the functions to be called before the handler method is executed

func NewChannel

func NewChannel() *Channel

NewChannel ctor

func (*Channel) Clear

func (p *Channel) Clear()

Clear should not be used after pitaya is running

func (*Channel) ExecuteBeforePipeline

func (p *Channel) ExecuteBeforePipeline(ctx context.Context, data interface{}) (context.Context, interface{}, error)

ExecuteBeforePipeline calls registered handlers

func (*Channel) PushBack

func (p *Channel) PushBack(h HandlerTempl)

PushBack should not be used after pitaya is running

func (*Channel) PushFront

func (p *Channel) PushFront(h HandlerTempl)

PushFront should not be used after pitaya is running

type HandlerHooks

type HandlerHooks struct {
	Hooks
}

func NewHandlerHooks

func NewHandlerHooks() *HandlerHooks

NewHandlerHooks ctor

type HandlerTempl

type HandlerTempl func(ctx context.Context, in interface{}) (c context.Context, out interface{}, err error)

HandlerTempl is a function that has the same signature as a handler and will be called before or after handler methods

type Hooks

type Hooks struct {
	BeforeHandler *Channel
	AfterHandler  *AfterChannel
}

Hooks contains before and after channels

type RemoteHooks

type RemoteHooks struct {
	Hooks
}

func NewRemoteHooks

func NewRemoteHooks() *RemoteHooks

NewRemoteHooks ctor

Jump to

Keyboard shortcuts

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