httpclient

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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