fetcher

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFetcher

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

HTTPFetcher implements the discovery.Fetcher interface using standard HTTP.

func NewHTTPFetcher

func NewHTTPFetcher() *HTTPFetcher

NewHTTPFetcher creates a new fetcher with a default 5-second timeout.

func (*HTTPFetcher) Fetch

func (f *HTTPFetcher) Fetch(ctx context.Context, url string) ([]byte, error)

Fetch retrieves the content from the given URL.

func (*HTTPFetcher) FetchWithAuth

func (f *HTTPFetcher) FetchWithAuth(ctx context.Context, url string, authHeader string) ([]byte, error)

FetchWithAuth retrieves the content from the given URL with an optional Authorization header.

func (*HTTPFetcher) SetHeader

func (f *HTTPFetcher) SetHeader(key, value string)

SetHeader sets a default header for all fetch requests.

Jump to

Keyboard shortcuts

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