filter

package
v0.33.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 34 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HeaderProxyAllowList = map[string]struct{}{
	strings.ToLower("Retry-After"): {},
}

HeaderProxyAllowList contains the headers that are proxied from the reply; other than the CloudEvents headers. Other headers are not proxied because of security concerns.

Functions

This section is empty.

Types

type Handler

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

Handler parses Cloud Events, determines if they pass a filter, and sends them to a subscriber.

func NewHandler

func NewHandler(logger *zap.Logger, triggerLister eventinglisters.TriggerLister, reporter StatsReporter, port int, wc func(ctx context.Context) context.Context) (*Handler, error)

NewHandler creates a new Handler and its associated MessageReceiver. The caller is responsible for Start()ing the returned Handler.

func (*Handler) ServeHTTP added in v0.22.0

func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

1. validate request 2. extract event from request 3. get trigger from its trigger reference extracted from the request URI 4. filter event 5. send event to trigger's subscriber 6. write the response

func (*Handler) Start

func (h *Handler) Start(ctx context.Context) error

Start begins to receive messages for the handler.

HTTP POST requests to the root path (/) are accepted.

This method will block until ctx is done.

type ReportArgs

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

type StatsReporter

type StatsReporter interface {
	ReportEventCount(args *ReportArgs, responseCode int) error
	ReportEventDispatchTime(args *ReportArgs, responseCode int, d time.Duration) error
	ReportEventProcessingTime(args *ReportArgs, d time.Duration) error
}

StatsReporter defines the interface for sending filter metrics.

func NewStatsReporter

func NewStatsReporter(container, uniqueName string) StatsReporter

NewStatsReporter creates a reporter that collects and reports filter metrics.

Jump to

Keyboard shortcuts

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