package runtime
import "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
Index ¶
- func DecodeByteArray(s string, v *[]byte, format Base64Encoding) error
- func Drain(resp *http.Response)
- func EncodeByteArray(v []byte, format Base64Encoding) string
- func HasStatusCode(resp *http.Response, statusCodes ...int) bool
- func JoinPaths(root string, paths ...string) string
- func MarshalAsByteArray(req *policy.Request, v []byte, format Base64Encoding) error
- func MarshalAsJSON(req *policy.Request, v interface{}) error
- func MarshalAsXML(req *policy.Request, v interface{}) error
- func NewLogPolicy(o *policy.LogOptions) policy.Policy
- func NewPipeline(transport pipeline.Transporter, policies ...pipeline.Policy) pipeline.Pipeline
- func NewPoller(pollerID string, resp *http.Response, pl pipeline.Pipeline, eu func(*http.Response) error) (*pollers.Poller, error)
- func NewPollerFromResumeToken(pollerID string, token string, pl pipeline.Pipeline, eu func(*http.Response) error) (*pollers.Poller, error)
- func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*pipeline.Request, error)
- func NewResponseError(inner error, resp *http.Response) error
- func NewRetryPolicy(o *policy.RetryOptions) policy.Policy
- func NewTelemetryPolicy(mod, ver string, o *policy.TelemetryOptions) policy.Policy
- func Payload(resp *http.Response) ([]byte, error)
- func SetMultipartFormData(req *policy.Request, formData map[string]interface{}) error
- func UnmarshalAsByteArray(resp *http.Response, v *[]byte, format Base64Encoding) error
- func UnmarshalAsJSON(resp *http.Response, v interface{}) error
- func UnmarshalAsXML(resp *http.Response, v interface{}) error
- type AuthenticationOptions
- type Base64Encoding
- type Pipeline
Functions ¶
func DecodeByteArray ¶
func DecodeByteArray(s string, v *[]byte, format Base64Encoding) error
DecodeByteArray will base-64 decode the provided string into v.
func Drain ¶
Drain reads the response body to completion then closes it. The bytes read are discarded.
func EncodeByteArray ¶
func EncodeByteArray(v []byte, format Base64Encoding) string
EncodeByteArray will base-64 encode the byte slice v.
func HasStatusCode ¶
HasStatusCode returns true if the Response's status code is one of the specified values.
func JoinPaths ¶
JoinPaths concatenates multiple URL path segments into one path, inserting path separation characters as required. JoinPaths will preserve query parameters in the root path
func MarshalAsByteArray ¶
func MarshalAsByteArray(req *policy.Request, v []byte, format Base64Encoding) error
MarshalAsByteArray will base-64 encode the byte slice v, then calls SetBody. The encoded value is treated as a JSON string.
func MarshalAsJSON ¶
MarshalAsJSON calls json.Marshal() to get the JSON encoding of v then calls SetBody.
func MarshalAsXML ¶
MarshalAsXML calls xml.Marshal() to get the XML encoding of v then calls SetBody.
func NewLogPolicy ¶
func NewLogPolicy(o *policy.LogOptions) policy.Policy
NewLogPolicy creates a RequestLogPolicy object configured using the specified options. Pass nil to accept the default values; this is the same as passing a zero-value options.
func NewPipeline ¶
NewPipeline creates a new Pipeline object from the specified Transport and Policies. If no transport is provided then the default *http.Client transport will be used.
func NewPoller ¶
func NewPoller(pollerID string, resp *http.Response, pl pipeline.Pipeline, eu func(*http.Response) error) (*pollers.Poller, error)
NewPoller creates a Poller based on the provided initial response. pollerID - a unique identifier for an LRO, it's usually the client.Method string.
func NewPollerFromResumeToken ¶
func NewPollerFromResumeToken(pollerID string, token string, pl pipeline.Pipeline, eu func(*http.Response) error) (*pollers.Poller, error)
NewPollerFromResumeToken creates a Poller from a resume token string. pollerID - a unique identifier for an LRO, it's usually the client.Method string.
func NewRequest ¶
NewRequest creates a new policy.Request with the specified input.
func NewResponseError ¶
NewResponseError wraps the specified error with an error that provides access to an HTTP response. If an HTTP request returns a non-successful status code, wrap the response and the associated error in this error type so that callers can access the underlying *http.Response as required. DO NOT wrap failed HTTP requests that returned an error and no response with this type.
func NewRetryPolicy ¶
func NewRetryPolicy(o *policy.RetryOptions) policy.Policy
NewRetryPolicy creates a policy object configured using the specified options. Pass nil to accept the default values; this is the same as passing a zero-value options.
func NewTelemetryPolicy ¶
func NewTelemetryPolicy(mod, ver string, o *policy.TelemetryOptions) policy.Policy
NewTelemetryPolicy creates a telemetry policy object that adds telemetry information to outgoing HTTP requests. The format is [<application_id> ]azsdk-go-<mod>/<ver> <platform_info>. Pass nil to accept the default values; this is the same as passing a zero-value options.
func Payload ¶
Payload reads and returns the response body or an error. On a successful read, the response body is cached.
func SetMultipartFormData ¶
SetMultipartFormData writes the specified keys/values as multi-part form fields with the specified value. File content must be specified as a ReadSeekCloser. All other values are treated as string values.
func UnmarshalAsByteArray ¶
func UnmarshalAsByteArray(resp *http.Response, v *[]byte, format Base64Encoding) error
UnmarshalAsByteArray will base-64 decode the received payload and place the result into the value pointed to by v.
func UnmarshalAsJSON ¶
UnmarshalAsJSON calls json.Unmarshal() to unmarshal the received payload into the value pointed to by v.
func UnmarshalAsXML ¶
UnmarshalAsXML calls xml.Unmarshal() to unmarshal the received payload into the value pointed to by v.
Types ¶
type AuthenticationOptions ¶
type AuthenticationOptions struct { // TokenRequest is a TokenRequestOptions that includes a scopes field which contains // the list of OAuth2 authentication scopes used when requesting a token. // This field is ignored for other forms of authentication (e.g. shared key). TokenRequest policy.TokenRequestOptions // AuxiliaryTenants contains a list of additional tenant IDs to be used to authenticate // in cross-tenant applications. AuxiliaryTenants []string }
AuthenticationOptions contains various options used to create a credential policy.
type Base64Encoding ¶
type Base64Encoding int
Base64Encoding is usesd to specify which base-64 encoder/decoder to use when encoding/decoding a slice of bytes to/from a string.
const ( // Base64StdFormat uses base64.StdEncoding for encoding and decoding payloads. Base64StdFormat Base64Encoding = 0 // Base64URLFormat uses base64.RawURLEncoding for encoding and decoding payloads. Base64URLFormat Base64Encoding = 1 )
type Pipeline ¶
Pipeline represents a primitive for sending HTTP requests and receiving responses. Its behavior can be extended by specifying policies during construction.
Source Files ¶
errors.go policy_body_download.go policy_http_header.go policy_logging.go policy_retry.go policy_telemetry.go poller.go request.go response.go transport_default_http_client.go
- Version
- v0.19.0
- Published
- Aug 26, 2021
- Platform
- js/wasm
- Imports
- 29 packages
- Last checked
- 15 hours ago –
Tools for package owners.