Struct: request.Request
Overview
nextPageTokens returns the tokens to use when asking for the next page of data.
Implemented Interfaces
s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom
Structure Field Summary collapse
- AttemptTime time.Time
- Body io.ReadSeeker
- ClientInfo metadata.ClientInfo
- Config aws.Config
- Data interface{}
- DisableFollowRedirects bool
- Error error
-
ExpireTime time.Duration
A value greater than 0 instructs the request to be signed as Presigned URL You should not set this field directly.
- HTTPRequest *http.Request
- HTTPResponse *http.Response
- Handlers Handlers
- LastSignedAt time.Time
- NotHoist bool
- Operation *Operation
- Params interface{}
- RequestID string
- RetryCount int
- RetryDelay time.Duration
-
RetryErrorCodes []string
Additional API error codes that should be retried.
- Retryable *bool
- SignedHeaderVals http.Header
-
ThrottleErrorCodes []string
Additional API error codes that should be retried with throttle backoff delay.
- Time time.Time
Method Summary collapse
-
func (r *Request) ApplyOptions(opts ...Option)
ApplyOptions will apply each option to the request calling them in the order the were provided.
-
func (r *Request) Build() error
Build will build the request's object so it can be signed and sent to the service.
-
func (r *Request) Context() aws.Context
Context will always returns a non-nil context.
-
func (r *Request) DataFilled() bool
DataFilled returns true if the request's data for response deserialization target has been set and is a valid.
-
func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error
EachPage iterates over each page of a paginated request object.
-
func (r *Request) GetBody() io.ReadSeeker
GetBody will return an io.ReadSeeker of the Request's underlying input body with a concurrency safe wrapper.
-
func (r *Request) HasNextPage() bool
HasNextPage returns true if this request has more pages of data available.
-
func (r *Request) IsErrorExpired() bool
IsErrorExpired returns whether the error code is a credential expiry error.
- func (r *Request) IsErrorRetryable() bool
-
func (r *Request) IsErrorThrottle() bool
IsErrorThrottle returns whether the error is to be throttled based on its code.
-
func (r *Request) IsPresigned() bool
IsPresigned returns true if the request represents a presigned API url.
-
func (r *Request) NextPage() *Request
NextPage returns a new Request that can be executed to return the next page of result data.
-
func (r *Request) ParamsFilled() bool
ParamsFilled returns if the request's parameters have been populated and the parameters are valid.
-
func (r *Request) Presign(expire time.Duration) (string, error)
Presign returns the request's signed URL.
-
func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error)
PresignRequest behaves just like presign, with the addition of returning a set of headers that were signed.
- func (r *Request) ResetBody()
-
func (r *Request) Send() error
Send will send the request, returning error if errors are encountered.
-
func (r *Request) SetBufferBody(buf []byte)
SetBufferBody will set the request's body bytes that will be sent to the service API.
-
func (r *Request) SetContext(ctx aws.Context)
SetContext adds a Context to the current request that can be used to cancel a in-flight request.
-
func (r *Request) SetReaderBody(reader io.ReadSeeker)
SetReaderBody will set the request's body reader.
-
func (r *Request) SetStreamingBody(reader io.ReadCloser)
SetStreamingBody set the reader to be used for the request that will stream bytes to the server.
-
func (r *Request) SetStringBody(s string)
SetStringBody sets the body of the request to be backed by a string.
-
func (r *Request) Sign() error
Sign will sign the request, returning error if errors are encountered.
-
func (r *Request) WillRetry() bool
WillRetry returns if the request's can be retried.
Structure Field Details
AttemptTime time.Time
Body io.ReadSeeker
ClientInfo metadata.ClientInfo
Config aws.Config
Data interface{}
DisableFollowRedirects bool
Error error
ExpireTime time.Duration
A value greater than 0 instructs the request to be signed as Presigned URL You should not set this field directly. Instead use Request's Presign or PresignRequest methods.
HTTPRequest *http.Request
HTTPResponse *http.Response
Handlers Handlers
LastSignedAt time.Time
NotHoist bool
Operation *Operation
Params interface{}
RequestID string
RetryCount int
RetryDelay time.Duration
RetryErrorCodes []string
Additional API error codes that should be retried. IsErrorRetryable will consider these codes in addition to its built in cases.
Retryable *bool
SignedHeaderVals http.Header
ThrottleErrorCodes []string
Additional API error codes that should be retried with throttle backoff delay. IsErrorThrottle will consider these codes in addition to its built in cases.
Time time.Time
Method Details
func (r *Request) ApplyOptions(opts ...Option)
ApplyOptions will apply each option to the request calling them in the order the were provided.
223 224 225 226 227 |
// File 'aws/request/request.go', line 223
|
func (r *Request) Build() error
Build will build the request's object so it can be signed and sent to the service. Build will also validate all the request's parameters. Any additional build Handlers set on this request will be run in the order they were set.
The request will only be built once. Multiple calls to build will have no effect.
If any Validate or Build errors occur the build will stop and the error which occurred will be returned.
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
// File 'aws/request/request.go', line 413
|
func (r *Request) Context() aws.Context
Context will always returns a non-nil context. If Request does not have a context aws.BackgroundContext will be returned.
231 232 233 234 235 236 |
// File 'aws/request/request.go', line 231
|
func (r *Request) DataFilled() bool
DataFilled returns true if the request's data for response deserialization target has been set and is a valid. False is returned if data is not set, or is invalid.
283 284 285 |
// File 'aws/request/request.go', line 283
|
func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error
EachPage iterates over each page of a paginated request object. The fn parameter should be a function with the following sample signature:
func(page *T, lastPage bool) bool {
return true // return false to stop iterating
}
Where âTâ is the structure type matching the output structure of the given operation. For example, a request object generated by DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput as the structure âTâ. The lastPage value represents whether the page is the last page of data or not. The return value of this function should return true to keep iterating or false to stop.
Deprecated Use Pagination type for configurable pagination of API operations
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
// File 'aws/request/request_pagination.go', line 251
|
func (r *Request) GetBody() io.ReadSeeker
GetBody will return an io.ReadSeeker of the Request's underlying input body with a concurrency safe wrapper.
509 510 511 |
// File 'aws/request/request.go', line 509
|
func (r *Request) HasNextPage() bool
HasNextPage returns true if this request has more pages of data available.
Deprecated Use Pagination type for configurable pagination of API operations
208 209 210 211 212 213 |
// File 'aws/request/request_pagination.go', line 208
|
func (r *Request) IsErrorExpired() bool
IsErrorExpired returns whether the error code is a credential expiry error. Returns false if the request has no Error set.
Alias for the utility function IsErrorExpiredCreds
306 307 308 |
// File 'aws/request/retryer.go', line 306
|
func (r *Request) IsErrorRetryable() bool
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
// File 'aws/request/retryer.go', line 249
|
func (r *Request) IsErrorThrottle() bool
IsErrorThrottle returns whether the error is to be throttled based on its code. Returns false if the request has no Error set.
Alias for the utility function IsErrorThrottle
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
// File 'aws/request/retryer.go', line 271
|
func (r *Request) IsPresigned() bool
IsPresigned returns true if the request represents a presigned API url.
362 363 364 |
// File 'aws/request/request.go', line 362
|
func (r *Request) NextPage() *Request
NextPage returns a new Request that can be executed to return the next page of result data. Call .Send() on this request to execute it.
Deprecated Use Pagination type for configurable pagination of API operations
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
// File 'aws/request/request_pagination.go', line 219
|
func (r *Request) ParamsFilled() bool
ParamsFilled returns if the request's parameters have been populated and the parameters are valid. False is returned if no parameters are provided or invalid.
276 277 278 |
// File 'aws/request/request.go', line 276
|
func (r *Request) Presign(expire time.Duration) (string, error)
Presign returns the request's signed URL. Error will be returned if the signing fails. The expire parameter is only used for presigned Amazon S3 API requests. All other AWS services will use a fixed expiration time of 15 minutes.
It is invalid to create a presigned URL with a expire duration 0 or less. An error is returned if expire duration is 0 or less.
330 331 332 333 334 335 336 337 338 339 340 |
// File 'aws/request/request.go', line 330
|
func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error)
PresignRequest behaves just like presign, with the addition of returning a set of headers that were signed. The expire parameter is only used for presigned Amazon S3 API requests. All other AWS services will use a fixed expiration time of 15 minutes.
It is invalid to create a presigned URL with a expire duration 0 or less. An error is returned if expire duration is 0 or less.
Returns the URL string for the API operation with signature in the query string, and the HTTP headers that were included in the signature. These headers must be included in any HTTP request made with the presigned URL.
To prevent hoisting any headers to the query string set NotHoist to true on this Request value prior to calling PresignRequest.
356 357 358 359 |
// File 'aws/request/request.go', line 356
|
func (r *Request) ResetBody()
26 27 28 29 30 31 32 33 34 35 36 |
// File 'aws/request/request_1_8.go', line 26
|
func (r *Request) Send() error
Send will send the request, returning error if errors are encountered.
Send will sign the request prior to sending. All Send Handlers will be executed in the order they were set.
Canceling a request is non-deterministic. If a request has been canceled, then the transport will choose, randomly, one of the state channels during reads or getting the connection.
readLoop() and getConn(req *Request, cm connectMethod) github.com/golang/go/blob/master/src/net/http/transport.go
Send will not close the request.Request's body.
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 |
// File 'aws/request/request.go', line 526
|
func (r *Request) SetBufferBody(buf []byte)
SetBufferBody will set the request's body bytes that will be sent to the service API.
289 290 291 |
// File 'aws/request/request.go', line 289
|
func (r *Request) SetContext(ctx aws.Context)
SetContext adds a Context to the current request that can be used to cancel a in-flight request. The Context value must not be nil, or this method will panic.
Unlike http.Request.WithContext, SetContext does not return a copy of the Request. It is not safe to use use a single Request value for multiple requests. A new Request should be created for each API operation request.
Go 1.6 and below: The http.Request's Cancel field will be set to the Done() value of the context. This will overwrite the Cancel field's value.
Go 1.7 and above: The http.Request.WithContext will be used to set the context on the underlying http.Request. This will create a shallow copy of the http.Request. The SDK may create sub contexts in the future for nested requests such as retries.
254 255 256 257 258 259 |
// File 'aws/request/request.go', line 254
|
func (r *Request) SetReaderBody(reader io.ReadSeeker)
SetReaderBody will set the request's body reader.
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
// File 'aws/request/request.go', line 299
|
func (r *Request) SetStreamingBody(reader io.ReadCloser)
SetStreamingBody set the reader to be used for the request that will stream bytes to the server. Request's Body must not be set to any reader.
318 319 320 321 |
// File 'aws/request/request.go', line 318
|
func (r *Request) SetStringBody(s string)
SetStringBody sets the body of the request to be backed by a string.
294 295 296 |
// File 'aws/request/request.go', line 294
|
func (r *Request) Sign() error
Sign will sign the request, returning error if errors are encountered.
Sign will build the request prior to signing. All Sign Handlers will be executed in the order they were set.
435 436 437 438 439 440 441 442 443 444 445 446 |
// File 'aws/request/request.go', line 435
|
func (r *Request) WillRetry() bool
WillRetry returns if the request's can be retried.
262 263 264 265 266 267 |
// File 'aws/request/request.go', line 262
|