requester

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRequester

type HTTPRequester interface {
	SendRequest(m *config.MetricsConfig, timeout time.Duration) (*http.Response, error)
}

HTTPRequester is an interface for sending HTTP requests, useful for mocking in tests

type Requester

type Requester struct {
	Endpoint string
	Method   string
	Body     []byte
	Headers  map[string]string
}

Requester is the struct that contains the request information.

func NewRequester

func NewRequester(endpoint, method string, body []byte, headers map[string]string) *Requester

NewRequester creates a new Requester struct.

func (*Requester) SendRequest

func (r *Requester) SendRequest(m *config.MetricsConfig, timeout time.Duration) (*http.Response, error)

SendRequest sends the request to the given endpoint.

Jump to

Keyboard shortcuts

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