core

package
v0.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrimaryIndexName = ""
)

Variables

View Source
var (

	// ErrConditionalRequestFailed when the conditional write is not meet
	ErrConditionalRequestFailed = errors.New("conditional request failed")

	// ErrInvalidAtrributeValue when the attributte value is invalid
	ErrInvalidAtrributeValue = errors.New("invalid attribute value type")
)

Functions

func GetKeyAt

func GetKeyAt(sortedKeys []string, size int64, pos int64, forward bool) string

Types

type QueryInput

type QueryInput struct {
	Index                     string
	ExpressionAttributeValues map[string]*types.Item
	Limit                     int64
	ExclusiveStartKey         map[string]*types.Item
	KeyConditionExpression    string
	ConditionExpression       *string
	FilterExpression          string
	Aliases                   map[string]string
	ScanIndexForward          bool
	Scan                      bool
	// contains filtered or unexported fields
}

type Table

type Table struct {
	Name                 string
	Indexes              map[string]*index
	AttributesDef        map[string]string
	SortedKeys           []string
	Data                 map[string]map[string]*types.Item
	KeySchema            keySchema
	BillingMode          *string
	UseNativeInterpreter bool
	NativeInterpreter    interpreter.Native
	LangInterpreter      interpreter.Language
}

Table has the Indexes and the operation functions

func NewTable

func NewTable(name string) *Table

func (*Table) AddGlobalIndexes

func (t *Table) AddGlobalIndexes(input []*types.GlobalSecondaryIndex) error

func (*Table) AddLocalIndexes

func (t *Table) AddLocalIndexes(input []*types.LocalSecondaryIndex) error

func (*Table) ApplyIndexChange

func (t *Table) ApplyIndexChange(change *types.GlobalSecondaryIndexUpdate) error

func (*Table) Clear

func (t *Table) Clear()

func (*Table) CreatePrimaryIndex

func (t *Table) CreatePrimaryIndex(input *types.CreateTableInput) error

func (*Table) Delete

func (t *Table) Delete(input *types.DeleteItemInput) (map[string]*types.Item, error)

func (*Table) Description

func (t *Table) Description(name string) *types.TableDescription

func (*Table) Put

func (t *Table) Put(input *types.PutItemInput) (map[string]*types.Item, error)

func (*Table) SearchData

func (t *Table) SearchData(input QueryInput) ([]map[string]*types.Item, map[string]*types.Item)

func (*Table) SetAttributeDefinition

func (t *Table) SetAttributeDefinition(attrs []*types.AttributeDefinition)

func (*Table) Update

func (t *Table) Update(input *types.UpdateItemInput) (map[string]*types.Item, error)

Jump to

Keyboard shortcuts

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