Documentation ¶
Index ¶
- Constants
- Variables
- func SaveRecord(ctx context.Context, api MigrationApi, tableName string, ...) (err error)
- type Attribute
- type Attributes
- type FilesMigrate
- type KeySchema
- type Keys
- type Migrate
- type Migration
- type MigrationApi
- type Projection
- type ProvisionedThroughput
- type Resource
- type Resources
- type SaveFunc
- type Schema
- type SchemaMigrate
- type SecondaryIndex
- type SecondaryIndexes
- type TableSchema
- func (t TableSchema) Create(ctx context.Context, api MigrationApi) (out *dynamodb.CreateTableOutput, err error)
- func (t TableSchema) Delete(ctx context.Context, api MigrationApi) (out *dynamodb.DeleteTableOutput, err error)
- func (t TableSchema) Exists(ctx context.Context, api MigrationApi) (out *dynamodb.DescribeTableOutput, err error)
- func (t TableSchema) Update(ctx context.Context, api MigrationApi, desc types.TableDescription) (out *dynamodb.UpdateTableOutput, err error)
- type Template
- type TimeToLiveSpecification
Constants ¶
View Source
const DynamoDB = "AWS::DynamoDB::Table"
View Source
const MigrationTable = "dynamo_migrations"
Variables ¶
View Source
var ErrNotFound *types.ResourceNotFoundException
Functions ¶
func SaveRecord ¶
Types ¶
type Attribute ¶
type Attribute struct { Type types.ScalarAttributeType `json:"AttributeType" yaml:"AttributeType"` Name string `json:"AttributeName" yaml:"AttributeName"` }
func (Attribute) Definition ¶
func (attr Attribute) Definition() types.AttributeDefinition
type Attributes ¶
type Attributes []Attribute
func (Attributes) Definitions ¶
func (attrs Attributes) Definitions() []types.AttributeDefinition
func (Attributes) Map ¶
func (attrs Attributes) Map() map[string]types.ScalarAttributeType
type FilesMigrate ¶
type FilesMigrate struct {
// contains filtered or unexported fields
}
type KeySchema ¶
type KeySchema struct { Type types.KeyType `json:"KeyType" yaml:"KeyType"` Name string `json:"AttributeName" yaml:"AttributeName"` }
func (KeySchema) Element ¶
func (k KeySchema) Element() *types.KeySchemaElement
type Keys ¶
type Keys []KeySchema
func (Keys) Elements ¶
func (keys Keys) Elements() []types.KeySchemaElement
type Migrate ¶
func New ¶
func New(api MigrationApi, dirPath ...string) Migrate
func Parse ¶
func Parse(api MigrationApi, schema string) Migrate
type MigrationApi ¶
type MigrationApi interface { DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error) CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.CreateTableOutput, error) UpdateTimeToLive(ctx context.Context, params *dynamodb.UpdateTimeToLiveInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateTimeToLiveOutput, error) UpdateTable(ctx context.Context, params *dynamodb.UpdateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateTableOutput, error) DescribeTimeToLive(ctx context.Context, params *dynamodb.DescribeTimeToLiveInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTimeToLiveOutput, error) DeleteTable(ctx context.Context, params *dynamodb.DeleteTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteTableOutput, error) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error) PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error) }
type Projection ¶
type Projection struct { Type types.ProjectionType `json:"ProjectionType" yaml:"ProjectionType"` AttributeNames []string `json:"NonKeyAttributes" yaml:"NonKeyAttributes"` }
func (Projection) Element ¶
func (p Projection) Element() *types.Projection
type ProvisionedThroughput ¶
type ProvisionedThroughput struct { Read int64 `json:"ReadCapacityUnits" yaml:"ReadCapacityUnits"` Write int64 `json:"WriteCapacityUnits" yaml:"WriteCapacityUnits"` }
func (ProvisionedThroughput) Element ¶
func (t ProvisionedThroughput) Element() *types.ProvisionedThroughput
func (ProvisionedThroughput) Update ¶
func (t ProvisionedThroughput) Update(desc types.TableDescription) *types.ProvisionedThroughput
type Resource ¶
type Resource struct { Type string `json:"Type" yaml:"Type"` Properties TableSchema `json:"Properties" yaml:"Properties"` }
type Schema ¶
type Schema struct { Table TableSchema `json:"schema" yaml:"schema"` Records []map[string]interface{} `json:"records" yaml:"records"` // contains filtered or unexported fields }
type SchemaMigrate ¶
type SchemaMigrate struct {
// contains filtered or unexported fields
}
type SecondaryIndex ¶
type SecondaryIndex struct { Name string `json:"IndexName" yaml:"IndexName"` Keys Keys `json:"KeySchema" yaml:"KeySchema"` Projection *Projection `json:"Projection" yaml:"Projection"` Throughput *ProvisionedThroughput `json:"ProvisionedThroughput,omitempty" yaml:"ProvisionedThroughput,omitempty"` }
func (SecondaryIndex) CreateGlobal ¶
func (s SecondaryIndex) CreateGlobal() types.GlobalSecondaryIndex
func (SecondaryIndex) CreateLocal ¶
func (s SecondaryIndex) CreateLocal() types.LocalSecondaryIndex
type SecondaryIndexes ¶
type SecondaryIndexes []SecondaryIndex
func (SecondaryIndexes) GlobalIndexes ¶
func (indexes SecondaryIndexes) GlobalIndexes() []types.GlobalSecondaryIndex
func (SecondaryIndexes) LocalIndexes ¶
func (indexes SecondaryIndexes) LocalIndexes() []types.LocalSecondaryIndex
func (SecondaryIndexes) UpdateGlobals ¶
func (indexes SecondaryIndexes) UpdateGlobals(desc types.TableDescription) []types.GlobalSecondaryIndexUpdate
type TableSchema ¶
type TableSchema struct { TableName string `json:"TableName" yaml:"TableName"` Attributes Attributes `json:"AttributeDefinitions" yaml:"AttributeDefinitions"` Keys Keys `json:"KeySchema" yaml:"KeySchema"` Throughput ProvisionedThroughput `json:"ProvisionedThroughput" yaml:"ProvisionedThroughput"` BillingMode types.BillingMode `json:"BillingMode" yaml:"BillingMode"` GlobalSecondaryIndex SecondaryIndexes `json:"GlobalSecondaryIndexes,omitempty" yaml:"GlobalSecondaryIndexes,omitempty"` LocalSecondaryIndex SecondaryIndexes `json:"LocalSecondaryIndexes,omitempty" yaml:"LocalSecondaryIndexes,omitempty"` TableClass types.TableClass `json:"TableClass" yaml:"TableClass"` TimeToLive *TimeToLiveSpecification `json:"TimeToLiveSpecification,omitempty" yaml:"TimeToLiveSpecification,omitempty"` }
func (TableSchema) Create ¶
func (t TableSchema) Create(ctx context.Context, api MigrationApi) (out *dynamodb.CreateTableOutput, err error)
func (TableSchema) Delete ¶
func (t TableSchema) Delete(ctx context.Context, api MigrationApi) (out *dynamodb.DeleteTableOutput, err error)
func (TableSchema) Exists ¶
func (t TableSchema) Exists(ctx context.Context, api MigrationApi) (out *dynamodb.DescribeTableOutput, err error)
func (TableSchema) Update ¶
func (t TableSchema) Update(ctx context.Context, api MigrationApi, desc types.TableDescription) (out *dynamodb.UpdateTableOutput, err error)
type TimeToLiveSpecification ¶
type TimeToLiveSpecification struct { AttributeName string `json:"AttributeName" yaml:"AttributeName"` Enabled bool `json:"Enabled" yaml:"Enabled"` }
func (TimeToLiveSpecification) Element ¶
func (s TimeToLiveSpecification) Element() *types.TimeToLiveSpecification
Click to show internal directories.
Click to hide internal directories.