aws-sdk-go: github.com/aws/aws-sdk-go/aws/client Index | Files | Directories

package client

import "github.com/aws/aws-sdk-go/aws/client"

Index

Package Files

client.go default_retryer.go logger.go no_op_retryer.go

Constants

const (
    // DefaultRetryerMaxNumRetries sets maximum number of retries
    DefaultRetryerMaxNumRetries = 3

    // DefaultRetryerMinRetryDelay sets minimum retry delay
    DefaultRetryerMinRetryDelay = 30 * time.Millisecond

    // DefaultRetryerMinThrottleDelay sets minimum delay when throttled
    DefaultRetryerMinThrottleDelay = 500 * time.Millisecond

    // DefaultRetryerMaxRetryDelay sets maximum retry delay
    DefaultRetryerMaxRetryDelay = 300 * time.Second

    // DefaultRetryerMaxThrottleDelay sets maximum delay when throttled
    DefaultRetryerMaxThrottleDelay = 300 * time.Second
)

Variables

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

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.

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

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.

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

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.

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

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.

type Client Uses

type Client struct {
    request.Retryer
    metadata.ClientInfo

    Config   aws.Config
    Handlers request.Handlers
}

A Client implements the base client request and response handling used by all service clients.

func New Uses

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.

func (*Client) AddDebugHandlers Uses

func (c *Client) AddDebugHandlers()

AddDebugHandlers injects debug logging handlers into the service to log request debug information.

func (*Client) NewRequest Uses

func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request

NewRequest returns a new Request pointer for the service API operation and parameters.

type Config Uses

type Config struct {
    Config        *aws.Config
    Handlers      request.Handlers
    PartitionID   string
    Endpoint      string
    SigningRegion string
    SigningName   string

    // States that the signing name did not come from a modeled source but
    // was derived based on other data. Used by service client constructors
    // to determine if the signin name can be overridden based on metadata the
    // service has.
    SigningNameDerived bool
}

A Config provides configuration to a service client instance.

type ConfigNoResolveEndpointProvider Uses

type ConfigNoResolveEndpointProvider interface {
    ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) Config
}

ConfigNoResolveEndpointProvider same as ConfigProvider except it will not resolve the endpoint automatically. The service client's endpoint must be provided via the aws.Config.Endpoint field.

type ConfigProvider Uses

type ConfigProvider interface {
    ClientConfig(serviceName string, cfgs ...*aws.Config) Config
}

ConfigProvider provides a generic way for a service client to receive the ClientConfig without circular dependencies.

type DefaultRetryer Uses

type DefaultRetryer struct {
    // Num max Retries is the number of max retries that will be performed.
    // By default, this is zero.
    NumMaxRetries int

    // MinRetryDelay is the minimum retry delay after which retry will be performed.
    // If not set, the value is 0ns.
    MinRetryDelay time.Duration

    // MinThrottleRetryDelay is the minimum retry delay when throttled.
    // If not set, the value is 0ns.
    MinThrottleDelay time.Duration

    // MaxRetryDelay is the maximum retry delay before which retry must be performed.
    // If not set, the value is 0ns.
    MaxRetryDelay time.Duration

    // MaxThrottleDelay is the maximum retry delay when throttled.
    // If not set, the value is 0ns.
    MaxThrottleDelay time.Duration
}

DefaultRetryer implements basic retry logic using exponential backoff for most services. If you want to implement custom retry logic, you can implement the request.Retryer interface.

func (DefaultRetryer) MaxRetries Uses

func (d DefaultRetryer) MaxRetries() int

MaxRetries returns the number of maximum returns the service will use to make an individual API request.

func (DefaultRetryer) RetryRules Uses

func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration

RetryRules returns the delay duration before retrying this request again

func (DefaultRetryer) ShouldRetry Uses

func (d DefaultRetryer) ShouldRetry(r *request.Request) bool

ShouldRetry returns true if the request should be retried.

type NoOpRetryer Uses

type NoOpRetryer struct{}

NoOpRetryer provides a retryer that performs no retries. It should be used when we do not want retries to be performed.

func (NoOpRetryer) MaxRetries Uses

func (d NoOpRetryer) MaxRetries() int

MaxRetries returns the number of maximum returns the service will use to make an individual API; For NoOpRetryer the MaxRetries will always be zero.

func (NoOpRetryer) RetryRules Uses

func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration

RetryRules returns the delay duration before retrying this request again; since NoOpRetryer does not retry, RetryRules always returns 0.

func (NoOpRetryer) ShouldRetry Uses

func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool

ShouldRetry will always return false for NoOpRetryer, as it should never retry.

Directories

PathSynopsis
metadata

Package client imports 12 packages (graph) and is imported by 11240 packages. Updated 2019-10-24. Refresh now. Tools for package owners.