http

package
v5.6.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name string `config:"name"`

	URLs         []string      `config:"urls" validate:"required"`
	ProxyURL     string        `config:"proxy_url"`
	Timeout      time.Duration `config:"timeout"`
	MaxRedirects int           `config:"max_redirects"`

	Mode monitors.IPSettings `config:",inline"`

	// authentication
	Username string `config:"username"`
	Password string `config:"password"`

	// configure tls (if not configured HTTPS will use system defaults)
	TLS *outputs.TLSConfig `config:"ssl"`

	// http(s) ping validation
	Check checkConfig `config:"check"`
}

type RespCheck

type RespCheck func(*http.Response) error

type SimpleTransport

type SimpleTransport struct {
	Dialer             transport.Dialer
	DisableCompression bool

	OnStartWrite func()
	OnStartRead  func()
}

SimpleTransport contains the dialer and read/write callbacks

func (*SimpleTransport) RoundTrip

func (t *SimpleTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip sets up goroutines to write the request and read the responses

Jump to

Keyboard shortcuts

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