package exported

import "github.com/Azure/azure-sdk-for-go/sdk/internal/exported"

Index

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.

Source Files

exported.go

Version
v1.6.0
Published
Apr 16, 2024
Platform
js/wasm
Imports
3 packages
Last checked
54 minutes ago

Tools for package owners.