requester

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 4 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() *http.Response
}

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() *http.Response

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