http

package
v0.5.44 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP interface {
	HealthCheckHTTP(uri, method string, headers map[string][]string, body string, codes []int, timeout time.Duration) error

	// HealthCheckTCP attempts to connect to a raw socket at the given address
	// if a connection is established the health check is marked as a success
	// if failed the check will retry until the timeout occurs
	HealthCheckTCP(uri string, timeout time.Duration) error
	// Do executes a HTTP request and returns the response
	Do(r *http.Request) (*http.Response, error)
}

func NewHTTP

func NewHTTP(backoff time.Duration, l logger.Logger) HTTP

type HTTPImpl

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

func (*HTTPImpl) Do

func (h *HTTPImpl) Do(r *http.Request) (*http.Response, error)

Do executes a HTTP request and returns the response

func (*HTTPImpl) HealthCheckHTTP

func (h *HTTPImpl) HealthCheckHTTP(address, method string, headers map[string][]string, body string, codes []int, timeout time.Duration) error

HealthCheckHTTP checks a http or HTTPS endpoint for a status 200

func (*HTTPImpl) HealthCheckTCP

func (h *HTTPImpl) HealthCheckTCP(address string, timeout time.Duration) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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