models

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadOnly = errors.New("in read-only mode")

Functions

func Sort

func Sort(items []Item, tableInfo *TableInfo)

Sort sorts the items in place

Types

type DescribingPrinter

type DescribingPrinter interface {
	Println(v ...any)
	Printf(format string, v ...any)
}

type Item

type Item map[string]types.AttributeValue

func (Item) AttributeValueAsString

func (i Item) AttributeValueAsString(key string) (string, bool)

func (Item) Clone

func (i Item) Clone() Item

Clone creates a clone of the current item

func (Item) KeyValue

func (i Item) KeyValue(info *TableInfo) map[string]types.AttributeValue

func (Item) PKSK added in v0.4.0

func (i Item) PKSK(info *TableInfo) (pk types.AttributeValue, sk types.AttributeValue)

type ItemAttribute

type ItemAttribute struct {
	Marked bool
	Hidden bool
	Dirty  bool
	New    bool
}

type ItemIndex

type ItemIndex struct {
	Index int
	Item  Item
}

type ItemType

type ItemType string
const (
	UnsetItemType  ItemType = ""
	StringItemType ItemType = "S"
	NumberItemType ItemType = "N"
	BoolItemType   ItemType = "BOOL"
	NullItemType   ItemType = "NULL"

	ExprValueItemType ItemType = "exprvalue"
)

type KeyAttribute

type KeyAttribute struct {
	PartitionKey string
	SortKey      string
}

type PartialResultsError

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

func NewPartialResultsError

func NewPartialResultsError(err error) PartialResultsError

func (PartialResultsError) Error

func (pr PartialResultsError) Error() string

func (PartialResultsError) Unwrap

func (pr PartialResultsError) Unwrap() error

type QueryExecutionPlan

type QueryExecutionPlan struct {
	CanQuery   bool
	IndexName  string
	Expression expression.Expression
}

func (QueryExecutionPlan) Describe

func (qep QueryExecutionPlan) Describe(dp DescribingPrinter)

type Queryable

type Queryable interface {
	String() string
	SerializeToBytes() ([]byte, error)
	HashCode() uint64
	Plan(tableInfo *TableInfo) (*QueryExecutionPlan, error)
}

type ResultSet

type ResultSet struct {
	// Query information
	TableInfo         *TableInfo
	Query             Queryable
	Created           time.Time
	ExclusiveStartKey map[string]types.AttributeValue

	// Result information
	LastEvaluatedKey map[string]types.AttributeValue
	// contains filtered or unexported fields
}

func (*ResultSet) AddNewItem

func (rs *ResultSet) AddNewItem(item Item, attrs ItemAttribute)

func (*ResultSet) Columns

func (rs *ResultSet) Columns() []string

func (*ResultSet) HasNextPage added in v0.3.0

func (rs *ResultSet) HasNextPage() bool

func (*ResultSet) Hidden

func (rs *ResultSet) Hidden(idx int) bool

func (*ResultSet) IsDirty

func (rs *ResultSet) IsDirty(idx int) bool

func (*ResultSet) IsNew

func (rs *ResultSet) IsNew(idx int) bool

func (*ResultSet) Items

func (rs *ResultSet) Items() []Item

func (*ResultSet) Marked

func (rs *ResultSet) Marked(idx int) bool

func (*ResultSet) MarkedItems

func (rs *ResultSet) MarkedItems() []ItemIndex

func (*ResultSet) NoResults

func (rs *ResultSet) NoResults() bool

func (*ResultSet) RefreshColumns

func (rs *ResultSet) RefreshColumns()

func (*ResultSet) SetDirty

func (rs *ResultSet) SetDirty(idx int, dirty bool)

func (*ResultSet) SetHidden

func (rs *ResultSet) SetHidden(idx int, hidden bool)

func (*ResultSet) SetItems

func (rs *ResultSet) SetItems(items []Item)

func (*ResultSet) SetMark

func (rs *ResultSet) SetMark(idx int, marked bool)

func (*ResultSet) SetNew

func (rs *ResultSet) SetNew(idx int, isNew bool)

type TableGSI

type TableGSI struct {
	Name string
	Keys KeyAttribute
}

type TableInfo

type TableInfo struct {
	Name              string
	Keys              KeyAttribute
	DefinedAttributes []string
	GSIs              []TableGSI
}

func (*TableInfo) Equal

func (ti *TableInfo) Equal(other *TableInfo) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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