tables

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(provider TableProvider) *Service

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, tableInfo *models.TableInfo, items []models.Item) error

func (*Service) Describe

func (s *Service) Describe(ctx context.Context, table string) (*models.TableInfo, error)

func (*Service) Filter

func (s *Service) Filter(resultSet *models.ResultSet, filter string) *models.ResultSet

TODO: move into a new service

func (*Service) ListTables

func (s *Service) ListTables(ctx context.Context) ([]string, error)

func (*Service) Put

func (s *Service) Put(ctx context.Context, tableInfo *models.TableInfo, item models.Item) error

func (*Service) PutItemAt

func (s *Service) PutItemAt(ctx context.Context, resultSet *models.ResultSet, index int) error

func (*Service) PutSelectedItems

func (s *Service) PutSelectedItems(ctx context.Context, resultSet *models.ResultSet, markedItems []models.ItemIndex) error

func (*Service) Scan

func (s *Service) Scan(ctx context.Context, tableInfo *models.TableInfo) (*models.ResultSet, error)

func (*Service) ScanOrQuery

func (s *Service) ScanOrQuery(ctx context.Context, tableInfo *models.TableInfo, expr models.Queryable) (*models.ResultSet, error)

type TableProvider

type TableProvider interface {
	ListTables(ctx context.Context) ([]string, error)
	DescribeTable(ctx context.Context, tableName string) (*models.TableInfo, error)
	ScanItems(ctx context.Context, tableName string, filterExpr *expression.Expression, maxItems int) ([]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
	PutItems(ctx context.Context, name string, items []models.Item) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL