curl

package
v1.0.172 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sensor

type Sensor struct {
	sensors.UnimplementedSensor
	// Client is used to make HTTP connections
	Client *http.Client
	// HttpMethod defines request type being send to remote http(s) endpoint via HTTP protocol
	HttpMethod string `yaml:"http_method" validate:"oneof=GET HEAD POST PUT PATCH DELETE CONNECT OPTIONS TRACE"`
	// Endpoint defines URL where sensor sends request to recieve data
	Endpoint string `yaml:"endpoint" validate:"http_url"`
	// Headers are HTTP request headers being send with any HTTP request
	Headers map[string]string `yaml:"headers"`
	// Body is send with any HTTP request as payload
	Body string `yaml:"body"`
	// JsonPath is used to extract elements from json response of remote endpoint or shell command output using https://jsonpath.com/ syntax
	JsonPath string `yaml:"json_path"`
	// ExpectedStatusCode
	ExpectedStatusCode int `yaml:"expected_status_code"`
}

func (*Sensor) Close

func (s *Sensor) Close(ctx context.Context) error

func (*Sensor) Init

func (s *Sensor) Init(ctx context.Context) error

func (*Sensor) Ping

func (s *Sensor) Ping(ctx context.Context) error

func (*Sensor) Update

func (s *Sensor) Update(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

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