client

package
v1.14.27-0...-ebc1ea8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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.

View Source
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.

Functions

This section is empty.

Types

type Client

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

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

func (c *Client) AddDebugHandlers()

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

func (*Client) NewRequest

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

type Config struct {
	Config        *aws.Config
	Handlers      request.Handlers
	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 overriden based on metadata the
	// service has.
	SigningNameDerived bool
}

A Config provides configuration to a service client instance.

type ConfigNoResolveEndpointProvider

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

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

type DefaultRetryer struct {
	NumMaxRetries int
}

DefaultRetryer implements basic retry logic using exponential backoff for most services. If you want to implement custom retry logic, implement the request.Retryer interface or create a structure type that composes this struct and override the specific methods. For example, to override only the MaxRetries method:

		type retryer struct {
     client.DefaultRetryer
   }

   // This implementation always has 100 max retries
   func (d retryer) MaxRetries() int { return 100 }

func (DefaultRetryer) MaxRetries

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

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

RetryRules returns the delay duration before retrying this request again

func (DefaultRetryer) ShouldRetry

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

ShouldRetry returns true if the request should be retried.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL