http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v1.1.0

func New(address string, opts ...Option) checker.Checker

New creates the HTTP checker

Types

type HTTP

type HTTP struct {
	*checker.LogAware
	// contains filtered or unexported fields
}

HTTP represents HTTP checker

func (*HTTP) Check

func (h *HTTP) Check(ctx context.Context) bool

Check checks HTTP connection

type Option

type Option func(s *HTTP)

Option configures an HTTP.

func WithExpectBody

func WithExpectBody(body string) Option

WithExpectBody configures response body expectation

func WithExpectHeader added in v1.1.0

func WithExpectHeader(header string) Option

WithExpectHeader configures response header expectation

func WithExpectStatusCode

func WithExpectStatusCode(code int) Option

WithExpectStatusCode configures response status code expectation

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout configures a time limit for requests made by the HTTP client

Jump to

Keyboard shortcuts

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