cloudevents

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtRoot = root + ".ext"
)

Variables

This section is empty.

Functions

func HandleDiscardEventsIDValue

func HandleDiscardEventsIDValue() string

func HandlerWrapperModule

func HandlerWrapperModule() fx.Option

func HelperModule

func HelperModule(extraOptions fx.Option) fx.Option

Types

type Handler

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

func NewHandler

func NewHandler(h *HandlerWrapper) *Handler

func (*Handler) Handle

func (h *Handler) Handle(ctx context.Context, in v2.Event) (out *v2.Event, err error)

type HandlerWrapper

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

func NewDefaultHandlerWrapper

func NewDefaultHandlerWrapper(handler cloudevents.Handler, middlewares ...Middleware) *HandlerWrapper

func NewHandlerWrapper

func NewHandlerWrapper(handler cloudevents.Handler, options *HandlerWrapperOptions, middlewares ...Middleware) *HandlerWrapper

func (*HandlerWrapper) Process

func (h *HandlerWrapper) Process(parentCtx context.Context, inouts []*InOut) (err error)

type HandlerWrapperOptions

type HandlerWrapperOptions struct {
	IDsToDiscard []string
}

func DefaultHandlerWrapperOptions

func DefaultHandlerWrapperOptions() (*HandlerWrapperOptions, error)

type Helper

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

func NewHelper

func NewHelper(ctx context.Context, handler *HandlerWrapper) *Helper

func (*Helper) Start

func (h *Helper) Start()

type InOut

type InOut struct {
	In      *event.Event
	Out     *event.Event
	Err     error
	Context context.Context
}

type Middleware

type Middleware interface {
	BeforeAll(ctx context.Context, inout []*InOut) (context.Context, error)
	Before(ctx context.Context, in *v2.Event) (context.Context, error)
	After(ctx context.Context, in v2.Event, out *v2.Event, err error) (context.Context, error)
	AfterAll(ctx context.Context, inout []*InOut) (context.Context, error)
	Close(ctx context.Context) error
}

func NewUnimplementedMiddleware

func NewUnimplementedMiddleware() Middleware

type UnimplementedMiddleware

type UnimplementedMiddleware struct {
}

func (UnimplementedMiddleware) After

func (u UnimplementedMiddleware) After(ctx context.Context, in v2.Event, out *v2.Event, err error) (context.Context, error)

func (UnimplementedMiddleware) AfterAll

func (u UnimplementedMiddleware) AfterAll(ctx context.Context, inout []*InOut) (context.Context, error)

func (UnimplementedMiddleware) Before

func (UnimplementedMiddleware) BeforeAll

func (u UnimplementedMiddleware) BeforeAll(ctx context.Context, inout []*InOut) (context.Context, error)

func (UnimplementedMiddleware) Close

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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