schema

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2016 License: MIT Imports: 0 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeDefinition

type AttributeDefinition struct {
	AttributeName string
	AttributeType AttributeType
}

type AttributeType

type AttributeType string
const (
	String AttributeType = "S"
	Number AttributeType = "N"
	Binary AttributeType = "B"
)

type CreateRequest

type CreateRequest struct {
	TableName              string
	AttributeDefinitions   []AttributeDefinition
	KeySchema              []KeySchema
	ProvisionedThroughput  ProvisionedThroughput
	GlobalSecondaryIndexes []SecondaryIndex
	LocalSecondaryIndexes  []SecondaryIndex
	StreamSpecification    *StreamSpecification `json:",omitempty"`
}

CreateRequest is the request to create a new DynamoDB table.

func NewCreateRequest

func NewCreateRequest(table string) *CreateRequest

func (*CreateRequest) HashKey

func (r *CreateRequest) HashKey(name string, attributeType AttributeType) *CreateRequest

Simple way to add a hash key and attribute definition in one go.

func (*CreateRequest) RangeKey

func (r *CreateRequest) RangeKey(name string, attributeType AttributeType) *CreateRequest

RangeKey is a simple way to add a hash key and attribute definition in one go.

type CreateResult

type CreateResult struct {
	TableDescription TableDescription
}

CreateResult describes the table created

type DeleteRequest

type DeleteRequest struct {
	TableName string
}

DeleteRequest asks to delete a DynamoDB table

type DeleteResult

type DeleteResult struct {
	TableDescription TableDescription
}

DeleteResult describes the table deleted

type DescribeRequest

type DescribeRequest struct {
	TableName string
}

DescribeRequest gives details about a single table.

type DescribeResponse

type DescribeResponse struct {
	Table TableDescription
}

type KeySchema

type KeySchema struct {
	AttributeName string
	KeyType       KeyType
}

type KeyType

type KeyType string
const (
	HashKey  KeyType = "HASH"
	RangeKey KeyType = "RANGE"
)

type ListRequest

type ListRequest struct {
	ExclusiveStartTableName string `json:",omitempty"`
	Limit                   uint   `json:",omitempty"`
}

ListRequest asks to list all tables on the current account.

type ListResponse

type ListResponse struct {
	LastEvaluatedTableName *string
	TableNames             []string
}

ListResponse is the response of table list request.

type Projection

type Projection struct {
	ProjectionType   ProjectionType
	NonKeyAttributes []string `json:",omitempty"`
}

func NewProjection added in v1.4.2

func NewProjection(projectionType ProjectionType, nonkeys ...string) Projection

NewProjection is a future-safe way to create a projection

type ProjectionType

type ProjectionType string
const (
	ProjectKeysOnly ProjectionType = "KEYS_ONLY"
	ProjectInclude  ProjectionType = "INCLUDE"
	ProjectAll      ProjectionType = "ALL"
)

type ProvisionedThroughput

type ProvisionedThroughput struct {
	ReadCapacityUnits  uint
	WriteCapacityUnits uint
}

func NewThroughput added in v1.4.2

func NewThroughput(read, write uint) ProvisionedThroughput

NewThroughput is a shortcut to create a ProvisionedThroughput without using unkeyed literals.

type ProvisionedThroughputDescription added in v1.1.0

type ProvisionedThroughputDescription struct {
	ProvisionedThroughput
	LastDecreaseDateTime   float64
	LastIncreaseDateTime   float64
	NumberOfDecreasesToday int
}

type SecondaryIndex

type SecondaryIndex struct {
	IndexName             string
	KeySchema             []KeySchema
	Projection            Projection
	ProvisionedThroughput ProvisionedThroughput
}

type SecondaryIndexResponse

type SecondaryIndexResponse struct {
	SecondaryIndex
	Backfilling    bool
	IndexSizeBytes int
	IndexStatus    string
	ItemCount      int
}

Secondary indexes as described in table descriptions

type StreamSpecification added in v1.1.0

type StreamSpecification struct {
	StreamEnabled  bool
	StreamViewType string
}

type TableDescription

type TableDescription struct {
	TableName        string
	TableSizeBytes   uint64
	TableStatus      string
	CreationDateTime float64 // Unix epoch time

	KeySchema              []KeySchema
	AttributeDefinitions   []AttributeDefinition
	GlobalSecondaryIndexes []SecondaryIndexResponse
	LocalSecondaryIndexes  []SecondaryIndexResponse
	ProvisionedThroughput  ProvisionedThroughputDescription

	// Streams
	LatestStreamArn     string
	LatestStreamLabel   string
	StreamSpecification *StreamSpecification
}

Jump to

Keyboard shortcuts

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