http

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	// IP or FQDN of the HTTP server
	Host string `json:"host" optiontype:"required"`
	// Path to request
	Path string `json:"path" default:"/"`
	// If HTTPS is to be used
	HTTPS bool `json:"https" default:"false"`
	// TCP port number the HTTP server is listening on
	Port uint16 `json:"port" default:"80"`
	// HTTP method to use
	Method string `json:"method" default:"GET"`
	// The response status code to match
	Code uint16 `json:"code" default:"200"`
	// Regex for the response body to match
	ContentRegex string `json:"contentRegex" default:".*"`
	// Name-value pairs of header fields to add/override
	Headers map[string]string `json:"headers"`
	// The request body
	Body string `json:"body"`
	// Whether the response code must match a defined value for the check to pass
	MatchCode bool `json:"matchCode"`
	// Whether the response body must match a defined regex for the check to pass
	MatchContent bool `json:"matchContent"`
	// Whether to follow http redirects
	Redirect bool `json:"redirect"`
	// Whether to verify the server's TLS certificate
	VerifyCert bool `json:"verifyCert"`
	// Shared configuration across all checks
	checks.SharedDefinition
}

func (Definition) Run

func (d Definition) Run(ctx context.Context, static checks.StaticConf) (result checks.Results)

func (Definition) Validate

func (d Definition) Validate() (passed bool, message string)

Validats the http definition is valid

Jump to

Keyboard shortcuts

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