Package: client

import "../ibm-cos-sdk-go/aws/client"

Sub-Packages

metadata

Constants

const DefaultRetryerMaxNumRetries = readonly

DefaultRetryerMaxNumRetries sets maximum number of retries

Value:

3
const DefaultRetryerMinRetryDelay = readonly

DefaultRetryerMinRetryDelay sets minimum retry delay

Value:

30 * time.Millisecond
const DefaultRetryerMinThrottleDelay = readonly

DefaultRetryerMinThrottleDelay sets minimum delay when throttled

Value:

500 * time.Millisecond
const DefaultRetryerMaxRetryDelay = readonly

DefaultRetryerMaxRetryDelay sets maximum retry delay

Value:

300 * time.Second
const DefaultRetryerMaxThrottleDelay = readonly

DefaultRetryerMaxThrottleDelay sets maximum delay when throttled

Value:

300 * time.Second

Variables

var LogHTTPRequestHandler = writable

LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent to a service. Will include the HTTP request body if the LogLevel of the request matches LogDebugWithHTTPBody.

Value:

request.NamedHandler{ Name: "awssdk.client.LogRequest", Fn: logRequest, }
var LogHTTPRequestHeaderHandler = writable

LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent to a service. Will only log the HTTP request's headers. The request payload will not be read.

Value:

request.NamedHandler{ Name: "awssdk.client.LogRequestHeader", Fn: logRequestHeader, }
var LogHTTPResponseHandler = writable

LogHTTPResponseHandler is a SDK request handler to log the HTTP response received from a service. Will include the HTTP response body if the LogLevel of the request matches LogDebugWithHTTPBody.

Value:

request.NamedHandler{ Name: "awssdk.client.LogResponse", Fn: logResponse, }
var LogHTTPResponseHeaderHandler = writable

LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP response received from a service. Will only log the HTTP response's headers. The response payload will not be read.

Value:

request.NamedHandler{ Name: "awssdk.client.LogResponseHeader", Fn: logResponseHeader, }

Type Summary collapse

Interface Summary collapse

Function Summary collapse

Function Details

func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client

New will return a pointer to a new initialized service client.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// File 'aws/client/client.go', line 51

func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client { svc := &Client{ Config: cfg, ClientInfo: info, Handlers: handlers.Copy(), } switch retryer, ok := cfg.Retryer.(request.Retryer); { case ok: svc.Retryer = retryer case cfg.Retryer != nil && cfg.Logger != nil: s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer) cfg.Logger.Log(s) fallthrough default: maxRetries := aws.IntValue(cfg.MaxRetries) if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { maxRetries = DefaultRetryerMaxNumRetries } svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} } svc.AddDebugHandlers() for _, option := range options { option(svc) } return svc }