handlers

package
v1.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailSaveAddress

func FailSaveAddress(address string) (string, error)

FailSaveAddress replaces wildcard addresses with the outbound IP.

Types

type CheckHandler

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

CheckHandler is a http Handler that performs different checks.

func NewCheckHandler

func NewCheckHandler(c CheckHandlerConfiguration) *CheckHandler

NewCheckHandler initializes a new CheckHandler.

func (*CheckHandler) ServeHTTP

func (h *CheckHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CheckHandlerConfiguration

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

CheckHandlerConfiguration defines the configuration for the CheckHandler.

func NewCheckHandlerConfiguration

func NewCheckHandlerConfiguration() CheckHandlerConfiguration

NewCheckHandlerConfiguration initializes a new CheckHandlerConfiguration.

func (CheckHandlerConfiguration) WithCheck

func (c CheckHandlerConfiguration) WithCheck(name string, check checker) CheckHandlerConfiguration

WithCheck sets a check for the CheckHandlerConfiguration.

func (CheckHandlerConfiguration) WithLimit

WithLimit limits the number of active goroutines for the checks to at most n

func (CheckHandlerConfiguration) WithLogger

WithLogger sets the logger for the CheckHandlerConfiguration.

func (CheckHandlerConfiguration) WithStatusFailed

func (c CheckHandlerConfiguration) WithStatusFailed(status int) CheckHandlerConfiguration

WithStatusFailed sets the status code for the failed checks.

func (CheckHandlerConfiguration) WithStatusSuccess

func (c CheckHandlerConfiguration) WithStatusSuccess(status int) CheckHandlerConfiguration

WithStatusSuccess sets the status code for the successful checks.

Jump to

Keyboard shortcuts

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