httpclient

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpclient provides HTTP client functionality for API operations

Index

Constants

View Source
const (
	// DefaultTimeout is the default timeout for HTTP requests
	DefaultTimeout = 10 * time.Second

	// MaxResponseSize is the maximum allowed response size (100MB)
	MaxResponseSize = 100 * 1024 * 1024

	// UserAgent is the user agent string for HTTP requests
	UserAgent = "toolhive-operator/1.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Get performs an HTTP GET request and returns the response body
	Get(ctx context.Context, url string) ([]byte, error)
}

Client is an interface for HTTP operations

func NewDefaultClient

func NewDefaultClient(timeout time.Duration) Client

NewDefaultClient creates a new default HTTP client with the specified timeout If timeout is 0, uses DefaultTimeout

type DefaultClient

type DefaultClient struct {
	// contains filtered or unexported fields
}

DefaultClient is the default HTTP client implementation

func (*DefaultClient) Get

func (c *DefaultClient) Get(ctx context.Context, url string) ([]byte, error)

Get performs an HTTP GET request

Jump to

Keyboard shortcuts

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