blackboxhttp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlackboxHTTP

type BlackboxHTTP struct {
}

func (*BlackboxHTTP) Do

func (p *BlackboxHTTP) Do(cfg *Config, cli *http.Client, req *http.Request, ss *types.Samples) error

func (*BlackboxHTTP) ParseConfig

func (p *BlackboxHTTP) ParseConfig(baseDir string, bs []byte) (any, error)

func (*BlackboxHTTP) Scrape

func (p *BlackboxHTTP) Scrape(ctx context.Context, address string, c any, ss *types.Samples) error

type Config

type Config struct {
	BaseDir string `toml:"-"`
	Global  Global `toml:"global"`
}

type Global

type Global struct {
	Namespace     string        `toml:"namespace"`
	Timeout       time.Duration `toml:"timeout"`
	Method        string        `toml:"method"`
	Payload       string        `toml:"payload"`
	BasicAuthUser string        `toml:"basic_auth_user"`
	BasicAuthPass string        `toml:"basic_auth_pass"`
	Headers       []string      `toml:"headers"`

	ProxyURL string `toml:"proxy_url"`
	clienttls.ClientConfig

	ExpectedStatusCodes        []int          `toml:"expected_status_codes"`
	ExpectedBodyRegexp         string         `toml:"expected_body_regexp"`
	ExpectedBodyRegexpCompiled *regexp.Regexp `toml:"-"`
}

Jump to

Keyboard shortcuts

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