client

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Set the User-Agent string to be used for underlying requests to fetch feeds and content.
	UserAgent = config.AppName + "/" + config.Version + " (+https://foragd.app/policies/bot)"
	// DefaultHTTPRequestTimeout is the maximum time allowed for a background HTTP request to execute.
	DefaultHTTPRequestTimeout = 45 * time.Second
	// DefaultRequestRetries is the default number of retries for API requests.
	DefaultRequestRetries = 3
)
View Source
var LoadHTTPClient = sync.OnceValue(func() *resty.Client {
	client = resty.New().
		SetHeader("User-Agent", UserAgent).
		SetHeader("Accept", "*/*").
		SetHeader("Accept-Encoding", "gzip, deflate")
	return client
})

Functions

This section is empty.

Types

type HeadReader

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

limitedReader wraps a reader and stops after the </head> tag or a byte limit. This avoids downloading the entire page body.

func NewHeadReader

func NewHeadReader(r io.Reader, maxBytes int) *HeadReader

func (*HeadReader) Read

func (h *HeadReader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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