clients

package
v0.0.0-...-edcf33a Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTP

func NewHTTP(timeout time.Duration) *http.Client

NewHTTP creates a new HTTP client with the provided timeout

Types

type DebugHTTPClient

type DebugHTTPClient struct {
	*http.Client
}

DebugHTTPClient is an *http.Client that prints Headers and Body to log

func NewDebug

func NewDebug(timeout time.Duration) *DebugHTTPClient

NewDebug creates a new DebugHTTPClient

func (*DebugHTTPClient) Do

func (c *DebugHTTPClient) Do(req *http.Request) (*http.Response, error)

Do sends the http request and logs headers and body to DEBUG

type FakeHTTPClient

type FakeHTTPClient struct {
	DoFunc func(*http.Request) (*http.Response, error)
}

FakeHTTPClient is used for testing

func (*FakeHTTPClient) Do

func (c *FakeHTTPClient) Do(req *http.Request) (*http.Response, error)

Do an HTTP request for testing

type HTTPClient

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

HTTPClient is can make HTTP requests

Directories

Path Synopsis
Package tsclient provides a common client for sending metrics to the DO timeseries system.
Package tsclient provides a common client for sending metrics to the DO timeseries system.

Jump to

Keyboard shortcuts

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