...

Package smithy

import "github.com/aws/smithy-go"
Overview
Index
Subdirectories

Overview ▾

Package smithy provides the core components for a Smithy SDK.

Index ▾

type APIError
type CanceledError
    func (*CanceledError) CanceledError() bool
    func (e *CanceledError) Error() string
    func (e *CanceledError) Unwrap() error
type DeserializationError
    func (e *DeserializationError) Error() string
    func (e *DeserializationError) Unwrap() error
type Document
type ErrorFault
    func (f ErrorFault) String() string
type GenericAPIError
    func (e *GenericAPIError) Error() string
    func (e *GenericAPIError) ErrorCode() string
    func (e *GenericAPIError) ErrorFault() ErrorFault
    func (e *GenericAPIError) ErrorMessage() string
type InvalidParamError
type InvalidParamsError
    func (e *InvalidParamsError) Add(err InvalidParamError)
    func (e *InvalidParamsError) AddNested(nestedCtx string, nested InvalidParamsError)
    func (e InvalidParamsError) Error() string
    func (e InvalidParamsError) Errs() []error
    func (e *InvalidParamsError) Len() int
type OperationError
    func (e *OperationError) Error() string
    func (e *OperationError) Operation() string
    func (e *OperationError) Service() string
    func (e *OperationError) Unwrap() error
type ParamRequiredError
    func NewErrParamRequired(field string) *ParamRequiredError
    func (e *ParamRequiredError) AddNestedContext(ctx string)
    func (e ParamRequiredError) Error() string
    func (e ParamRequiredError) Field() string
    func (e *ParamRequiredError) SetContext(ctx string)
type Properties
    func (m *Properties) Get(key interface{}) interface{}
    func (m *Properties) Has(key interface{}) bool
    func (m *Properties) Set(key, value interface{})
    func (m *Properties) SetAll(other *Properties)
type PropertiesReader
type SerializationError
    func (e *SerializationError) Error() string
    func (e *SerializationError) Unwrap() error

Package files

doc.go document.go errors.go go_module_metadata.go properties.go validation.go

type APIError

APIError provides the generic API and protocol agnostic error type all SDK generated exception types will implement.

type APIError interface {
    error

    // ErrorCode returns the error code for the API exception.
    ErrorCode() string
    // ErrorMessage returns the error message for the API exception.
    ErrorMessage() string
    // ErrorFault returns the fault for the API exception.
    ErrorFault() ErrorFault
}

type CanceledError

CanceledError is the error that will be returned by an API request that was canceled. API operations given a Context may return this error when canceled.

type CanceledError struct {
    Err error
}

func (*CanceledError) CanceledError

func (*CanceledError) CanceledError() bool

CanceledError returns true to satisfy interfaces checking for canceled errors.

func (*CanceledError) Error

func (e *CanceledError) Error() string

func (*CanceledError) Unwrap

func (e *CanceledError) Unwrap() error

Unwrap returns the underlying error, if there was one.

type DeserializationError

DeserializationError provides a wrapper for an error that occurs during deserialization.

type DeserializationError struct {
    Err      error //  original error
    Snapshot []byte
}

func (*DeserializationError) Error

func (e *DeserializationError) Error() string

Error returns a formatted error for DeserializationError

func (*DeserializationError) Unwrap

func (e *DeserializationError) Unwrap() error

Unwrap returns the underlying Error in DeserializationError

type Document

Document provides access to loosely structured data in a document-like format.

Deprecated: See the github.com/aws/smithy-go/document package.

type Document interface {
    UnmarshalDocument(interface{}) error
    GetValue() (interface{}, error)
}

type ErrorFault

ErrorFault provides the type for a Smithy API error fault.

type ErrorFault int

ErrorFault enumeration values

const (
    FaultUnknown ErrorFault = iota
    FaultServer
    FaultClient
)

func (ErrorFault) String

func (f ErrorFault) String() string

type GenericAPIError

GenericAPIError provides a generic concrete API error type that SDKs can use to deserialize error responses into. Should be used for unmodeled or untyped errors.

type GenericAPIError struct {
    Code    string
    Message string
    Fault   ErrorFault
}

func (*GenericAPIError) Error

func (e *GenericAPIError) Error() string

func (*GenericAPIError) ErrorCode

func (e *GenericAPIError) ErrorCode() string

ErrorCode returns the error code for the API exception.

func (*GenericAPIError) ErrorFault

func (e *GenericAPIError) ErrorFault() ErrorFault

ErrorFault returns the fault for the API exception.

func (*GenericAPIError) ErrorMessage

func (e *GenericAPIError) ErrorMessage() string

ErrorMessage returns the error message for the API exception.

type InvalidParamError

An InvalidParamError represents an invalid parameter error type.

type InvalidParamError interface {
    error

    // Field name the error occurred on.
    Field() string

    // SetContext updates the context of the error.
    SetContext(string)

    // AddNestedContext updates the error's context to include a nested level.
    AddNestedContext(string)
}

type InvalidParamsError

An InvalidParamsError provides wrapping of invalid parameter errors found when validating API operation input parameters.

type InvalidParamsError struct {
    // Context is the base context of the invalid parameter group.
    Context string
    // contains filtered or unexported fields
}

func (*InvalidParamsError) Add

func (e *InvalidParamsError) Add(err InvalidParamError)

Add adds a new invalid parameter error to the collection of invalid parameters. The context of the invalid parameter will be updated to reflect this collection.

func (*InvalidParamsError) AddNested

func (e *InvalidParamsError) AddNested(nestedCtx string, nested InvalidParamsError)

AddNested adds the invalid parameter errors from another InvalidParamsError value into this collection. The nested errors will have their nested context updated and base context to reflect the merging.

Use for nested validations errors.

func (InvalidParamsError) Error

func (e InvalidParamsError) Error() string

Error returns the string formatted form of the invalid parameters.

func (InvalidParamsError) Errs

func (e InvalidParamsError) Errs() []error

Errs returns a slice of the invalid parameters

func (*InvalidParamsError) Len

func (e *InvalidParamsError) Len() int

Len returns the number of invalid parameter errors

type OperationError

OperationError decorates an underlying error which occurred while invoking an operation with names of the operation and API.

type OperationError struct {
    ServiceID     string
    OperationName string
    Err           error
}

func (*OperationError) Error

func (e *OperationError) Error() string

func (*OperationError) Operation

func (e *OperationError) Operation() string

Operation returns the name of the API operation the error occurred with.

func (*OperationError) Service

func (e *OperationError) Service() string

Service returns the name of the API service the error occurred with.

func (*OperationError) Unwrap

func (e *OperationError) Unwrap() error

Unwrap returns the nested error if any, or nil.

type ParamRequiredError

An ParamRequiredError represents an required parameter error.

type ParamRequiredError struct {
    // contains filtered or unexported fields
}

func NewErrParamRequired

func NewErrParamRequired(field string) *ParamRequiredError

NewErrParamRequired creates a new required parameter error.

func (*ParamRequiredError) AddNestedContext

func (e *ParamRequiredError) AddNestedContext(ctx string)

AddNestedContext prepends a context to the field's path.

func (ParamRequiredError) Error

func (e ParamRequiredError) Error() string

Error returns the string version of the invalid parameter error.

func (ParamRequiredError) Field

func (e ParamRequiredError) Field() string

Field Returns the field and context the error occurred.

func (*ParamRequiredError) SetContext

func (e *ParamRequiredError) SetContext(ctx string)

SetContext updates the base context of the error.

type Properties

Properties provides storing and reading metadata values. Keys may be any comparable value type. Get and Set will panic if a key is not comparable.

The zero value for a Properties instance is ready for reads/writes without any additional initialization.

type Properties struct {
    // contains filtered or unexported fields
}

func (*Properties) Get

func (m *Properties) Get(key interface{}) interface{}

Get attempts to retrieve the value the key points to. Returns nil if the key was not found.

Panics if key type is not comparable.

func (*Properties) Has

func (m *Properties) Has(key interface{}) bool

Has returns whether the key exists in the metadata.

Panics if the key type is not comparable.

func (*Properties) Set

func (m *Properties) Set(key, value interface{})

Set stores the value pointed to by the key. If a value already exists at that key it will be replaced with the new value.

Panics if the key type is not comparable.

func (*Properties) SetAll

func (m *Properties) SetAll(other *Properties)

SetAll accepts all of the given Properties into the receiver, overwriting any existing keys in the case of conflicts.

type PropertiesReader

PropertiesReader provides an interface for reading metadata from the underlying metadata container.

type PropertiesReader interface {
    Get(key interface{}) interface{}
}

type SerializationError

SerializationError represents an error that occurred while attempting to serialize a request

type SerializationError struct {
    Err error // original error
}

func (*SerializationError) Error

func (e *SerializationError) Error() string

Error returns a formatted error for SerializationError

func (*SerializationError) Unwrap

func (e *SerializationError) Unwrap() error

Unwrap returns the underlying Error in SerializationError

Subdirectories

Name Synopsis
..
auth Package auth defines protocol-agnostic authentication types for smithy clients.
bearer Package bearer provides middleware and utilities for authenticating API operation calls with a Bearer Token.
container
private
cache Package cache defines the interface for a key-based data store.
lru Package lru implements [cache.Cache] with an LRU eviction policy.
context
document Package document provides interface definitions and error types for document types.
json Package json provides a document Encoder and Decoder implementation that is used to implement Smithy document types for JSON based protocols.
encoding
httpbinding
json
xml Package xml holds the XMl encoder utility.
endpoints
private
rulesfn
io Package io provides utilities for Smithy generated API clients.
logging
middleware Package middleware provides transport agnostic middleware for decorating SDK handlers.
private
protocol
requestcompression Package requestcompression implements runtime support for smithy-modeled request compression.
ptr Package ptr provides utilities for converting scalar literal type values to and from pointers inline.
rand Package rand provides utilities for creating and working with random value generators.
sync
testing Package testing provides utilities for testing smith clients and protocols.
xml package xml is xml testing package that supports xml comparison utility.
time
transport
http Package http provides the HTTP transport client and request/response types needed to round trip API operation calls with an service.
waiter