get_item

package
v0.0.0-...-1bb5a49 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2014 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Support for the DynamoDB GetItem endpoint.

example use:

tests/get_item-livestest.go

Index

Constants

View Source
const (
	ENDPOINT_NAME      = "GetItem"
	JSON_ENDPOINT_NAME = ENDPOINT_NAME + "JSON"
	GETITEM_ENDPOINT   = aws_const.ENDPOINT_PREFIX + ENDPOINT_NAME
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Get

type Get GetItem

Get is an alias for backwards compatibility

func NewGet

func NewGet() *Get

func (*Get) EndpointReq

func (get *Get) EndpointReq() (string, int, error)

type GetItem

type GetItem struct {
	AttributesToGet          attributestoget.AttributesToGet                   `json:",omitempty"`
	ConsistentRead           bool                                              // false is sane default
	ExpressionAttributeNames expressionattributenames.ExpressionAttributeNames `json:",omitempty"`
	Key                      item.Key
	ProjectionExpression     string `json:",omitempty"`
	ReturnConsumedCapacity   string `json:",omitempty"`
	TableName                string
}

func NewGetItem

func NewGetItem() *GetItem

func (*GetItem) EndpointReq

func (get_item *GetItem) EndpointReq() (string, int, error)

type Request

type Request GetItem

func (*Request) EndpointReq

func (req *Request) EndpointReq() (string, int, error)

type Response

type Response struct {
	Item             item.Item
	ConsumedCapacity *capacity.ConsumedCapacity `json:",omitempty"`
}

func NewResponse

func NewResponse() *Response

func (Response) MarshalJSON

func (r Response) MarshalJSON() ([]byte, error)

Some work required to omit empty ConsumedCapacity fields

func (*Response) ToResponseItemJSON

func (resp *Response) ToResponseItemJSON() (*ResponseItemJSON, error)

ToResponseItemJSON will try to convert the Response to a ResponseItemJSON, where the interface value for Item represents a structure that can be marshaled into basic JSON.

type ResponseItemJSON

type ResponseItemJSON struct {
	Item             interface{}
	ConsumedCapacity *capacity.ConsumedCapacity `json:",omitempty"`
}

ResponseItemJSON can be formed from a Response when the caller wishes to receive the Item as basic JSON.

func NewResponseItemJSON

func NewResponseItemJSON() *ResponseItemJSON

func (ResponseItemJSON) MarshalJSON

func (r ResponseItemJSON) MarshalJSON() ([]byte, error)

Some work required to omit empty ConsumedCapacity fields

Jump to

Keyboard shortcuts

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