sink

package
v3.30.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package sink provides an interface for processing HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthStatusRegistry

HealthStatusRegistry is a registry for webhook health status.

type Sink

type Sink interface {
	Process(*http.Request) error
}

Sink processes HTTP requests.

func NewHTTPClientSink

func NewHTTPClientSink(client *http.Client) Sink

NewHTTPClientSink returns a new HTTP client sink.

func NewHealthCheckSink

func NewHealthCheckSink(
	sink Sink, registry HealthStatusRegistry, unhealthyAttemptsThreshold int, unhealthyRetryInterval time.Duration,
) Sink

NewHealthCheckSink creates a Sink that records the health status of the webhooks and stops them from executing if too many fail in a specified interval of time.

func NewPooledSink

func NewPooledSink(ctx context.Context, c workerpool.Component, sink Sink, workers int, queueSize int) Sink

NewPooledSink creates a Sink that queues requests and processes them in parallel workers.

Directories

Path Synopsis
Package mock provides a mock sink for testing.
Package mock provides a mock sink for testing.

Jump to

Keyboard shortcuts

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