Documentation
¶
Index ¶
- func DeepFields(iface interface{}) []reflect.Value
- func DeepTypes(iface interface{}) []reflect.StructField
- func GetItems(input interface{}) (map[string]types.AttributeValue, error)
- type Attribute
- type DDBField
- type DDBFieldType
- type DDBSchema
- type DataModel
- type GSI
- type GlobalSecondaryIndexes
- type KeyAttributes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepFields ¶
DeepFields returns flattened slice of struct fields
func DeepTypes ¶
func DeepTypes(iface interface{}) []reflect.StructField
DeepTypes function returns slice of flattened struct fields
Types ¶
type Attribute ¶
type Attribute struct {
AttributeName string `json:"AttributeName,omitempty"`
AttributeType string `json:"AttributeType,omitempty"`
}
Component of DDBSchema
type DDBFieldType ¶
type DDBFieldType int
const ( UNKNOWN DDBFieldType = iota DDB_PK DDB_SK DDB_ATT DDB_GSIPK DDB_GSISK )
func GetFieldData ¶
func GetFieldData(fieldName string) (DDBFieldType, []string, error)
GetFieldData returns the enum type of field, a list of parts and an error
type DDBSchema ¶
type DDBSchema struct {
ModelName string `ddb_modelname:"ModelName"`
ModelMetadata struct {
Author string `json:"Author"`
DateCreated string `json:"DateCreated"`
DateLastModified string `json:"DateLastModified"`
Description string `json:"Description"`
AWSService string `json:"AWSService"`
Version string `json:"Version"`
} `json:"ModelMetadata"`
DataModel []DataModel `json:"DataModel"`
}
DynamoDB 2.0 Schema
func NewDDBSchema ¶
NewDDBSchema returns a new DDBSchema object.
type DataModel ¶
type DataModel struct {
TableName string `json:"TableName"`
KeyAttributes KeyAttributes `json:"KeyAttributes"`
NonKeyAttributes []Attribute `json:"NonKeyAttributes"`
GlobalSecondaryIndexes []GlobalSecondaryIndexes `json:"GlobalSecondaryIndexes,omitempty"`
}
Component of DDBSchema
type GlobalSecondaryIndexes ¶
type GlobalSecondaryIndexes struct {
KeyAttributes struct {
PartitionKey Attribute `json:"PartitionKey"`
SortKey *Attribute `json:"SortKey,omitempty"`
} `json:"KeyAttributes"`
IndexName string `json:"IndexName"`
Projection struct {
ProjectionType string `json:"ProjectionType"`
} `json:"Projection"`
}
Component of DDBSchema
type KeyAttributes ¶
type KeyAttributes struct {
PartitionKey Attribute `json:"PartitionKey"`
SortKey *Attribute `json:"SortKey,omitempty"`
}
KeyAttributes is a component of DataModel
Click to show internal directories.
Click to hide internal directories.