sqs-browse: remove assumption regarding table keys
Table keys are now retrieved from describe
This commit is contained in:
parent
3428bd2a8a
commit
5a69e6c954
47 changed files with 150 additions and 98 deletions
|
|
@ -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 {
|
||||
|
|
@ -45,4 +46,4 @@ func (c *CommandController) Execute() uimodels.Operation {
|
|||
|
||||
return command.Execute(WithCommandArgs(ctx, tokens[1:]))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -12,4 +13,4 @@ func WithCommandArgs(ctx context.Context, args []string) context.Context {
|
|||
func CommandArgs(ctx context.Context) []string {
|
||||
args, _ := ctx.Value(commandArgContextKey).([]string)
|
||||
return args
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue