sqs-browse: remove assumption regarding table keys
Table keys are now retrieved from describe
This commit is contained in:
parent
3428bd2a8a
commit
5a69e6c954
|
@ -4,6 +4,8 @@ import (
|
|||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
@ -15,7 +17,6 @@ import (
|
|||
"github.com/lmika/awstools/internal/dynamo-browse/services/tables"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui"
|
||||
"github.com/lmika/gopkgs/cli"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -77,4 +78,3 @@ type msgLoopback struct {
|
|||
func (m *msgLoopback) Send(msg tea.Msg) {
|
||||
m.program.Send(msg)
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@ import (
|
|||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
@ -17,8 +20,6 @@ import (
|
|||
"github.com/lmika/awstools/internal/sqs-browse/ui"
|
||||
"github.com/lmika/events"
|
||||
"github.com/lmika/gopkgs/cli"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,15 +3,16 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
|
||||
"github.com/pkg/errors"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/lmika/gopkgs/cli"
|
||||
)
|
||||
|
@ -85,7 +86,7 @@ func main() {
|
|||
}
|
||||
|
||||
func handleMessage(ctx context.Context, outDir string, msg types.Message) error {
|
||||
outFile := filepath.Join(outDir, aws.ToString(msg.MessageId) + ".json")
|
||||
outFile := filepath.Join(outDir, aws.ToString(msg.MessageId)+".json")
|
||||
msgBody := aws.ToString(msg.Body)
|
||||
|
||||
log.Printf("%v -> %v", aws.ToString(msg.MessageId), outFile)
|
||||
|
|
|
@ -2,11 +2,12 @@ package commandctrl
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/events"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/shellwords"
|
||||
"github.com/pkg/errors"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type CommandController struct {
|
||||
|
|
|
@ -2,11 +2,12 @@ package commandctrl_test
|
|||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/commandctrl"
|
||||
"github.com/lmika/awstools/internal/common/ui/events"
|
||||
"github.com/lmika/awstools/test/testuictx"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCommandController_Prompt(t *testing.T) {
|
||||
|
|
|
@ -2,7 +2,8 @@ package commandctrl
|
|||
|
||||
import "context"
|
||||
|
||||
type commandArgContextKeyType struct {}
|
||||
type commandArgContextKeyType struct{}
|
||||
|
||||
var commandArgContextKey = commandArgContextKeyType{}
|
||||
|
||||
func WithCommandArgs(ctx context.Context, args []string) context.Context {
|
||||
|
|
|
@ -2,6 +2,7 @@ package dispatcher
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/lmika/awstools/internal/common/ui/events"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
|
|
|
@ -2,10 +2,11 @@ package dispatcher
|
|||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/events"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/pkg/errors"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Dispatcher struct {
|
||||
|
@ -14,7 +15,6 @@ type Dispatcher struct {
|
|||
publisher MessagePublisher
|
||||
}
|
||||
|
||||
|
||||
func NewDispatcher(publisher MessagePublisher) *Dispatcher {
|
||||
return &Dispatcher{
|
||||
mutex: new(sync.Mutex),
|
||||
|
@ -44,6 +44,3 @@ func (d *Dispatcher) Start(ctx context.Context, operation uimodels.Operation) {
|
|||
d.runningOp = nil
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@ package uimodels
|
|||
|
||||
import "context"
|
||||
|
||||
type uiContextKeyType struct {}
|
||||
type uiContextKeyType struct{}
|
||||
|
||||
var uiContextKey = uiContextKeyType{}
|
||||
|
||||
func Ctx(ctx context.Context) UIContext {
|
||||
|
|
|
@ -11,4 +11,3 @@ type OperationFn func(ctx context.Context) error
|
|||
func (f OperationFn) Execute(ctx context.Context) error {
|
||||
return f(ctx)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@ package uimodels
|
|||
|
||||
import "context"
|
||||
|
||||
type promptValueKeyType struct {}
|
||||
type promptValueKeyType struct{}
|
||||
|
||||
var promptValueKey = promptValueKeyType{}
|
||||
|
||||
func PromptValue(ctx context.Context) string {
|
||||
|
|
|
@ -2,6 +2,7 @@ package controllers
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package controllers
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/services/tables"
|
||||
|
|
|
@ -2,6 +2,7 @@ package controllers
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models/modexpr"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/services/tables"
|
||||
|
|
|
@ -2,6 +2,8 @@ package controllers_test
|
|||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/events"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/controllers"
|
||||
|
@ -10,7 +12,6 @@ import (
|
|||
"github.com/lmika/awstools/test/testdynamo"
|
||||
"github.com/lmika/awstools/test/testuictx"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTableWriteController_ToggleReadWrite(t *testing.T) {
|
||||
|
@ -47,7 +48,10 @@ func TestTableWriteController_Delete(t *testing.T) {
|
|||
twc, ctrls, closeFn := setupController(t)
|
||||
t.Cleanup(closeFn)
|
||||
|
||||
resultSet, err := ctrls.tableService.Scan(context.Background(), ctrls.tableName)
|
||||
ti, err := ctrls.tableService.Describe(context.Background(), ctrls.tableName)
|
||||
assert.NoError(t, err)
|
||||
|
||||
resultSet, err := ctrls.tableService.Scan(context.Background(), ti)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, resultSet.Items, 3)
|
||||
|
||||
|
@ -71,7 +75,7 @@ func TestTableWriteController_Delete(t *testing.T) {
|
|||
err = promptRequest.OnDone.Execute(uimodels.WithPromptValue(ctx, "y"))
|
||||
assert.NoError(t, err)
|
||||
|
||||
afterResultSet, err := ctrls.tableService.Scan(context.Background(), ctrls.tableName)
|
||||
afterResultSet, err := ctrls.tableService.Scan(context.Background(), ti)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, afterResultSet.Items, 2)
|
||||
assert.Contains(t, afterResultSet.Items, resultSet.Items[0])
|
||||
|
@ -83,7 +87,10 @@ func TestTableWriteController_Delete(t *testing.T) {
|
|||
twc, ctrls, closeFn := setupController(t)
|
||||
t.Cleanup(closeFn)
|
||||
|
||||
resultSet, err := ctrls.tableService.Scan(context.Background(), ctrls.tableName)
|
||||
ti, err := ctrls.tableService.Describe(context.Background(), ctrls.tableName)
|
||||
assert.NoError(t, err)
|
||||
|
||||
resultSet, err := ctrls.tableService.Scan(context.Background(), ti)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, resultSet.Items, 3)
|
||||
|
||||
|
@ -107,7 +114,7 @@ func TestTableWriteController_Delete(t *testing.T) {
|
|||
err = promptRequest.OnDone.Execute(uimodels.WithPromptValue(ctx, "n"))
|
||||
assert.Error(t, err)
|
||||
|
||||
afterResultSet, err := ctrls.tableService.Scan(context.Background(), ctrls.tableName)
|
||||
afterResultSet, err := ctrls.tableService.Scan(context.Background(), ti)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, afterResultSet.Items, 3)
|
||||
assert.Contains(t, afterResultSet.Items, resultSet.Items[0])
|
||||
|
@ -119,7 +126,10 @@ func TestTableWriteController_Delete(t *testing.T) {
|
|||
tableWriteController, ctrls, closeFn := setupController(t)
|
||||
t.Cleanup(closeFn)
|
||||
|
||||
resultSet, err := ctrls.tableService.Scan(context.Background(), ctrls.tableName)
|
||||
ti, err := ctrls.tableService.Describe(context.Background(), ctrls.tableName)
|
||||
assert.NoError(t, err)
|
||||
|
||||
resultSet, err := ctrls.tableService.Scan(context.Background(), ti)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, resultSet.Items, 3)
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"math/big"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
)
|
||||
|
||||
func compareScalarAttributes(x, y types.AttributeValue) (int, bool) {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package modexpr_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models/modexpr"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestModExpr_Patch(t *testing.T) {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package modexpr
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/pkg/errors"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func (a *astLiteralValue) dynamoValue() (types.AttributeValue, error) {
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
package models_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSort(t *testing.T) {
|
||||
t.Run("pk and sk are both strings", func(t *testing.T) {
|
||||
tableInfo := &models.TableInfo{Keys: models.KeyAttribute{PartitionKey: "pk", SortKey: "sk"}}
|
||||
|
||||
items := make([]models.Item, len(testStringData))
|
||||
copy(items, testStringData)
|
||||
|
||||
models.Sort(items, "pk", "sk")
|
||||
models.Sort(items, tableInfo)
|
||||
|
||||
assert.Equal(t, items[0], testStringData[1])
|
||||
assert.Equal(t, items[1], testStringData[2])
|
||||
|
@ -20,10 +23,12 @@ func TestSort(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("pk and sk are both numbers", func(t *testing.T) {
|
||||
tableInfo := &models.TableInfo{Keys: models.KeyAttribute{PartitionKey: "pk", SortKey: "sk"}}
|
||||
|
||||
items := make([]models.Item, len(testNumberData))
|
||||
copy(items, testNumberData)
|
||||
|
||||
models.Sort(items, "pk", "sk")
|
||||
models.Sort(items, tableInfo)
|
||||
|
||||
assert.Equal(t, items[0], testNumberData[2])
|
||||
assert.Equal(t, items[1], testNumberData[1])
|
||||
|
@ -31,10 +36,12 @@ func TestSort(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("pk and sk are both bools", func(t *testing.T) {
|
||||
tableInfo := &models.TableInfo{Keys: models.KeyAttribute{PartitionKey: "pk", SortKey: "sk"}}
|
||||
|
||||
items := make([]models.Item, len(testBoolData))
|
||||
copy(items, testBoolData)
|
||||
|
||||
models.Sort(items, "pk", "sk")
|
||||
models.Sort(items, tableInfo)
|
||||
|
||||
assert.Equal(t, items[0], testBoolData[2])
|
||||
assert.Equal(t, items[1], testBoolData[1])
|
||||
|
|
|
@ -2,6 +2,7 @@ package dynamo
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
|
|
|
@ -2,11 +2,12 @@ package dynamo_test
|
|||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/providers/dynamo"
|
||||
"github.com/lmika/awstools/test/testdynamo"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProvider_ScanItems(t *testing.T) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package tables
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
)
|
||||
|
|
|
@ -2,9 +2,10 @@ package tables
|
|||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
"github.com/pkg/errors"
|
||||
"sort"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
|
|
|
@ -2,11 +2,12 @@ package tables_test
|
|||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/providers/dynamo"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/services/tables"
|
||||
"github.com/lmika/awstools/test/testdynamo"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestService_Describe(t *testing.T) {
|
||||
|
|
|
@ -3,6 +3,9 @@ package ui
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
|
@ -14,8 +17,6 @@ import (
|
|||
"github.com/lmika/awstools/internal/common/ui/events"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/controllers"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -2,11 +2,12 @@ package ui
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
"io"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type itemTableRow struct {
|
||||
|
|
|
@ -2,6 +2,7 @@ package controllers
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/services/messages"
|
||||
|
|
|
@ -2,13 +2,14 @@ package sqs
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
"github.com/pkg/errors"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
|
|
|
@ -2,6 +2,7 @@ package stormstore
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/asdine/storm"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
"github.com/pkg/errors"
|
||||
|
|
|
@ -2,6 +2,7 @@ package messages
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package messages
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
|
|
@ -2,6 +2,7 @@ package pollmessage
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@ package pollmessage
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/lmika/events"
|
||||
"github.com/pkg/errors"
|
||||
"log"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
|
|
|
@ -4,6 +4,9 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
"github.com/charmbracelet/bubbles/viewport"
|
||||
|
@ -14,8 +17,6 @@ import (
|
|||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/controllers"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -2,10 +2,11 @@ package ui
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
)
|
||||
|
||||
type messageTableRow models.Message
|
||||
|
|
|
@ -2,6 +2,8 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
|
||||
|
@ -12,7 +14,6 @@ import (
|
|||
"github.com/lmika/awstools/internal/dynamo-browse/providers/dynamo"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/services/tables"
|
||||
"github.com/lmika/gopkgs/cli"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -52,12 +53,17 @@ func main() {
|
|||
log.Fatalf("warn: cannot create table: %v", tableName)
|
||||
}
|
||||
|
||||
tableInfo := &models.TableInfo{
|
||||
Name: tableName,
|
||||
Keys: models.KeyAttribute{PartitionKey: "pk", SortKey: "sk"},
|
||||
}
|
||||
|
||||
dynamoProvider := dynamo.NewProvider(dynamoClient)
|
||||
tableService := tables.NewService(dynamoProvider)
|
||||
|
||||
for i := 0; i < totalItems; i++ {
|
||||
key := uuid.New().String()
|
||||
if err := tableService.Put(ctx, tableName, models.Item{
|
||||
if err := tableService.Put(ctx, tableInfo, models.Item{
|
||||
"pk": &types.AttributeValueMemberS{Value: key},
|
||||
"sk": &types.AttributeValueMemberS{Value: key},
|
||||
"name": &types.AttributeValueMemberS{Value: gofakeit.Name()},
|
||||
|
|
|
@ -2,6 +2,8 @@ package testdynamo
|
|||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/credentials"
|
||||
|
@ -9,7 +11,6 @@ import (
|
|||
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
|
||||
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type TestData []map[string]interface{}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package testdynamo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRecordAsItem(t *testing.T, item map[string]interface{}) models.Item {
|
||||
|
|
|
@ -2,6 +2,7 @@ package testuictx
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/lmika/awstools/internal/common/ui/dispatcher"
|
||||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
|
|
Loading…
Reference in a new issue