本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/dynamodb.DynamoDB.DeleteTable方法的典型用法代码示例。如果您正苦于以下问题:Golang DynamoDB.DeleteTable方法的具体用法?Golang DynamoDB.DeleteTable怎么用?Golang DynamoDB.DeleteTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/aws/aws-sdk-go/service/dynamodb.DynamoDB
的用法示例。
在下文中一共展示了DynamoDB.DeleteTable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: deleteTable
func deleteTable(db *dynamodb.DynamoDB, table string) error {
params := &dynamodb.DeleteTableInput{
TableName: aws.String(table),
}
_, err := db.DeleteTable(params)
if err != nil {
return err
}
return nil
}
示例2: deleteTable
func deleteTable(db *dynamodb.DynamoDB, tableName string) error {
params := &dynamodb.DeleteTableInput{
TableName: aws.String(tableName),
}
_, err := db.DeleteTable(params)
if err != nil {
return err
}
describeParams := &dynamodb.DescribeTableInput{
TableName: aws.String(tableName),
}
if err := db.WaitUntilTableNotExists(describeParams); err != nil {
return err
}
return nil
}
示例3: teardownTables
func teardownTables(t *testing.T, db *dynamodb.DynamoDB) {
resp, err := db.ListTables(&dynamodb.ListTablesInput{})
if err != nil {
t.Fatalf("teardown tables list: %s", err.Error())
}
for _, table := range resp.TableNames {
_, err = db.DeleteTable(&dynamodb.DeleteTableInput{
TableName: table,
})
if err != nil {
t.Logf("teardown table %s: %s", *table, err.Error())
}
}
if err != nil {
t.FailNow()
}
}
示例4: DeleteTable
func DeleteTable(tableName string) {
localAddr := os.Getenv("LOCAL_DYNAMO_ADDR")
if localAddr == "" {
log.Info("DeleteAppTable will only attempt to delete a local dynamodb table... returning.")
return
}
var svc *dynamodb.DynamoDB = dbutil.CreateDynamoDBClient()
params := &dynamodb.DeleteTableInput{
TableName: aws.String(tableName),
}
resp, err := svc.DeleteTable(params)
if err != nil {
log.Info(err.Error())
return
}
log.Printf("Table %s deleted:\n%s\n", tableName, resp.String())
}
示例5: deleteAccountsTable
func deleteAccountsTable(db *dynamodb.DynamoDB) error {
var input = new(dynamodb.DeleteTableInput)
input.TableName = aws.String("Accounts")
var _, err = db.DeleteTable(input)
return err
}