dynamoutils

package module
v0.0.0-...-00e1fdf Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Provides utility functions for marshaling and unmarshaling values for storage in DynamoDB with the official client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) *dynamodb.AttributeValue

FormatDuration converts a time.Duration to an *AttributeValue number.

func FormatInt

func FormatInt(i int) *dynamodb.AttributeValue

FormatInt converts an int to an *AttributeValue.

func FormatString

func FormatString(s string) *dynamodb.AttributeValue

FormatString converts a string to an *AttributeValue.

func FormatTime

func FormatTime(t time.Time) *dynamodb.AttributeValue

FormatTime converts a time to an *AttributeValue. The time is stored as an integer representing nanoseconds since epoch, and is not necessarily compatible with other serializations.

func IsConditionFailed

func IsConditionFailed(err error) bool

IsConditionalCheckFailed returns true if an error is an awserr.Error with code "CondtionalCheckFailedException"

func ParseDuration

func ParseDuration(v *dynamodb.AttributeValue) (time.Duration, error)

func ParseInt

func ParseInt(v *dynamodb.AttributeValue) (int, error)

ParseInt converts an *AttributeValue to an int.

func ParseString

func ParseString(v *dynamodb.AttributeValue) string

FormatString converts an AttributeValue to a string.

func ParseTime

func ParseTime(v *dynamodb.AttributeValue) (time.Time, error)

ParseTime converts an AttributeValue to a time, assuming it is stored in the format used in FormatTime.

Types

This section is empty.

Jump to

Keyboard shortcuts

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