Documentation ¶
Index ¶
Constants ¶
const (
// NoResponse signals the step that send event to trigger's subscriber hasn't started
NoResponse = -1
)
Variables ¶
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 ¶
func NewServerManager ¶ added in v0.38.0
Types ¶
type ErrHandler ¶ added in v0.36.0
type ErrHandler struct { ResponseCode int ResponseBody []byte // contains filtered or unexported fields }
ErrHandler handle the different errors of filter dispatch process
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, triggerInformer v1.TriggerInformer, reporter StatsReporter, wc func(ctx context.Context) context.Context) (*Handler, error)
NewHandler creates a new Handler and its associated MessageReceiver.
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
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.