exported

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasStatusCode

func HasStatusCode(resp *http.Response, statusCodes ...int) bool

HasStatusCode returns true if the Response's status code is one of the specified values. Exported as runtime.HasStatusCode().

func Payload

func Payload(resp *http.Response, opts *PayloadOptions) ([]byte, error)

Payload reads and returns the response body or an error. On a successful read, the response body is cached. Subsequent reads will access the cached value. Exported as runtime.Payload() WITHOUT the opts parameter.

func PayloadDownloaded

func PayloadDownloaded(resp *http.Response) bool

PayloadDownloaded returns true if the response body has already been downloaded. This implies that the Payload() func above has been previously called. NOT exported but used by azcore.

Types

type PayloadOptions

type PayloadOptions struct {
	// BytesModifier receives the downloaded byte slice and returns an updated byte slice.
	// Use this to modify the downloaded bytes in a payload (e.g. removing a BOM).
	BytesModifier func([]byte) []byte
}

PayloadOptions contains the optional values for the Payload func. NOT exported but used by azcore.

Jump to

Keyboard shortcuts

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