httpclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitClient

func InitClient(domain, dir, filename string) error

InitClient initializes the HTTP client with a new CookieJar for managing cookies. It also loads cookies from the specified file and sets them for the given domain. Returns an error if the CookieJar creation or setting cookies fails.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is an interface that defines a single method, Do, for executing an HTTP request and returning the response or an error. It allows for easy mocking or swapping of different HTTP client implementations.

var Client HTTPClient

Client is a variable of type HTTPClient, representing the HTTP client that will be used to send HTTP requests. It can be set to any implementation of the HTTPClient interface.

Jump to

Keyboard shortcuts

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