put_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: 10 Imported by: 0

Documentation

Overview

Support for the DynamoDB PutItem endpoint.

example use:

tests/put_item-livestest.go

Index

Constants

View Source
const (
	ENDPOINT_NAME      = "PutItem"
	JSON_ENDPOINT_NAME = ENDPOINT_NAME + "JSON"
	PUTITEM_ENDPOINT   = aws_const.ENDPOINT_PREFIX + ENDPOINT_NAME
	// the permitted ReturnValues flags for this op
	RETVAL_ALL_OLD = aws_strings.RETVAL_ALL_OLD
	RETVAL_NONE    = aws_strings.RETVAL_NONE
)

Variables

This section is empty.

Functions

func ValidItem

func ValidItem(i string) bool

ValidItem validates the size of a json serialization of an Item. AWS says items can only be 400k bytes binary

Types

type Put

type Put PutItem

Put is an alias for backwards compatibility

func NewPut

func NewPut() *Put

func (*Put) EndpointReq

func (put *Put) EndpointReq() (string, int, error)

type PutItem

type PutItem struct {
	ConditionExpression         string                                            `json:",omitempty"`
	ConditionalOperator         string                                            `json:",omitempty"`
	Expected                    expected.Expected                                 `json:",omitempty"`
	ExpressionAttributeNames    expressionattributenames.ExpressionAttributeNames `json:",omitempty"`
	ExpressionAttributeValues   attributevalue.AttributeValueMap                  `json:",omitempty"`
	Item                        item.Item
	ReturnConsumedCapacity      string `json:",omitempty"`
	ReturnItemCollectionMetrics string `json:",omitempty"`
	ReturnValues                string `json:",omitempty"`
	TableName                   string
}

func NewPutItem

func NewPutItem() *PutItem

NewPut will return a pointer to an initialized PutItem struct.

func (*PutItem) EndpointReq

func (put_item *PutItem) EndpointReq() (string, int, error)

type PutItemJSON

type PutItemJSON struct {
	ConditionExpression         string                                            `json:",omitempty"`
	ConditionalOperator         string                                            `json:",omitempty"`
	Expected                    expected.Expected                                 `json:",omitempty"`
	ExpressionAttributeNames    expressionattributenames.ExpressionAttributeNames `json:",omitempty"`
	ExpressionAttributeValues   attributevalue.AttributeValueMap                  `json:",omitempty"`
	Item                        interface{}
	ReturnConsumedCapacity      string `json:",omitempty"`
	ReturnItemCollectionMetrics string `json:",omitempty"`
	ReturnValues                string `json:",omitempty"`
	TableName                   string
}

PutItemJSON differs from PutItem in that JSON is a string, which allows you to use a basic JSON document as the Item

func NewPutItemJSON

func NewPutItemJSON() *PutItemJSON

NewPutJSON will return a pointer to an initialized PutItemJSON struct.

func (*PutItemJSON) ToPutItem

func (put_item_json *PutItemJSON) ToPutItem() (*PutItem, error)

ToPutItem will attempt to convert a PutItemJSON to PutItem

type Request

type Request PutItem

func (*Request) EndpointReq

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

type Response

func NewResponse

func NewResponse() *Response

Jump to

Keyboard shortcuts

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