usagehttp

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package usagehttp bounds authenticated provider usage reads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Body       []byte
	StatusCode int
	ObservedAt time.Time
	RetryAt    time.Time
}

Response retains only the fields a provider reader consumes.

func Get

func Get(ctx context.Context, transport http.RoundTripper, endpoint, token string, headers http.Header) (Response, error)

Get makes one request without redirects, cookies, or inference.

func GetWithin

func GetWithin(ctx context.Context, transport http.RoundTripper, endpoint, token string, headers http.Header, maxBytes int64) (Response, error)

GetWithin reads endpoint with the bearer, refusing a body larger than maxBytes.

func (Response) Decode

func (r Response) Decode(value any) error

Decode rejects incomplete JSON without returning response bodies in errors.

Jump to

Keyboard shortcuts

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