sqs-browse: started working on put commands
This commit is contained in:
parent
43680000a8
commit
cecdbafabb
17 changed files with 339 additions and 26 deletions
|
|
@ -9,4 +9,5 @@ import (
|
|||
type TableProvider interface {
|
||||
ScanItems(ctx context.Context, tableName string) ([]models.Item, error)
|
||||
DeleteItem(ctx context.Context, tableName string, key map[string]types.AttributeValue) error
|
||||
PutItem(ctx context.Context, name string, item models.Item) error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@ func (s *Service) Scan(ctx context.Context, table string) (*models.ResultSet, er
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (s *Service) Put(ctx context.Context, tableName string, item models.Item) error {
|
||||
return s.provider.PutItem(ctx, tableName, item)
|
||||
}
|
||||
|
||||
func (s *Service) Delete(ctx context.Context, name string, item models.Item) error {
|
||||
// TODO: do not hardcode keys
|
||||
return s.provider.DeleteItem(ctx, name, map[string]types.AttributeValue{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue