beldilib

package
v0.0.0-...-91280e1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AVAILABLE = "AVAILABLE"
View Source
var DBClient = dynamodb.New(sess)
View Source
var DEBUG = false
View Source
var DLOGSIZE = "1000"
View Source
var LambdaClient = lambda.New(sess)
View Source
var RESERVED = []string{"K", "ROWHASH", "LOGS", "LOGSIZE", "GCSIZE", "NEXTROW"}
View Source
var T = int64(60)
View Source
var TYPE = "BELDI"

Functions

func AbortTxn

func AbortTxn(env *Env)

func AssertConditionFailure

func AssertConditionFailure(err error)

func AssignedSyncInvoke

func AssignedSyncInvoke(env *Env, callee string, input interface{}, stepNumber int32) (interface{}, string)

func AsyncInvoke

func AsyncInvoke(env *Env, callee string, input interface{}) string

func BeginTxn

func BeginTxn(env *Env)

func BuildProjection

func BuildProjection(names []string) expression.ProjectionBuilder

func CHECK

func CHECK(err error)

func ClearDAAL

func ClearDAAL(wg *sync.WaitGroup, lambdaId string, idx map[string]bool)

func ClearDangling

func ClearDangling(wg *sync.WaitGroup, lambdaId string)

func ClearIntent

func ClearIntent(wg *sync.WaitGroup, lambdaId string, ids []string)

func ClearReadLog

func ClearReadLog(wg *sync.WaitGroup, lambdaId string, instanceId string)

func ClearRow

func ClearRow(tablename string, key string, prevRow string, currentRow string, ts int64)

func ClearRowDAAL

func ClearRowDAAL(row aws.JSONValue, idx map[string]bool, lambdaId string)

func CommitTxn

func CommitTxn(env *Env)

func CondWrite

func CondWrite(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder, cond expression.ConditionBuilder) bool

func CreateBaselineTable

func CreateBaselineTable(lambdaId string)

func CreateCollectorTable

func CreateCollectorTable(lambdaId string)

func CreateLambdaTables

func CreateLambdaTables(lambdaId string)

func CreateLogTable

func CreateLogTable(lambdaId string)

func CreateMainTable

func CreateMainTable(lambdaId string)

func CreateTxnTables

func CreateTxnTables(lambdaId string)

func DeleteLambdaTables

func DeleteLambdaTables(lambdaId string)

func DeleteTable

func DeleteTable(tablename string)

func EOSCondWrite

func EOSCondWrite(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder,
	cond expression.ConditionBuilder) bool

func EOSCondWriteWithRow

func EOSCondWriteWithRow(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder, cond expression.ConditionBuilder, row string) bool

func EOSDelete

func EOSDelete(env *Env, tablename string, key string)

func EOSRead

func EOSRead(env *Env, tablename string, key string, projection []string) aws.JSONValue

func EOSReadWithRow

func EOSReadWithRow(env *Env, tablename string, key string, projection []string, row string) aws.JSONValue

func EOSScan

func EOSScan(env *Env, tablename string, projection []string) []aws.JSONValue

func EOSWrite

func EOSWrite(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder)

func EOSWriteWithRow

func EOSWriteWithRow(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder, row string)

func GC

func GC(lambdaId string)

func GLOGSIZE

func GLOGSIZE() int

func GeneratePK

func GeneratePK(k string, rowHash string) (aws.JSONValue, map[string]*dynamodb.AttributeValue)

func InsertHead

func InsertHead(tablename string, key string)

func InsertOrGetNewRow

func InsertOrGetNewRow(tablename string, key string, row string) string

func LastRow

func LastRow(tablename string, key string) string

func LibCondWrite

func LibCondWrite(tablename string, key string, update map[expression.NameBuilder]expression.OperandBuilder,
	cond expression.ConditionBuilder) bool

func LibDelete

func LibDelete(tablename string, key aws.JSONValue)

func LibPut

func LibPut(tablename string, key aws.JSONValue, values aws.JSONValue) bool

func LibQuery

func LibQuery(tablename string, cond expression.KeyConditionBuilder, projection []string) []aws.JSONValue

func LibRead

func LibRead(tablename string, key aws.JSONValue, projection []string) aws.JSONValue

func LibReadLatest

func LibReadLatest(tablename string, key string, projection []string, row string) aws.JSONValue

func LibScan

func LibScan(tablename string, projection []string, filter expression.ConditionBuilder) []aws.JSONValue

func LibScanWithLast

func LibScanWithLast(tablename string, projection []string, filter expression.ConditionBuilder,
	last map[string]*dynamodb.AttributeValue) []aws.JSONValue

func LibWrite

func LibWrite(tablename string, key aws.JSONValue, update map[expression.NameBuilder]expression.OperandBuilder)

func Lock

func Lock(env *Env, tablename string, key string) bool

func MarkDangling

func MarkDangling(wg *sync.WaitGroup, lambdaId string)

func Populate

func Populate(tablename string, key string, value interface{}, baseline bool)

func PrintExp

func PrintExp(exp expression.Expression)

func QueryCheck

func QueryCheck(env *Env, tablename string, key string, idx []string) bool

func QueryCondCheck

func QueryCondCheck(env *Env, tablename string, key string, idx []string) (bool, bool)

func QueryHeads

func QueryHeads(lambdaId string) []aws.JSONValue

func QuickCheckReturnLast

func QuickCheckReturnLast(env *Env, tablename string, key string, isCond bool) (bool, bool, string)

if done, res, last

func Read

func Read(env *Env, tablename string, key string) interface{}

func RestartAll

func RestartAll(lambdaId string)

func Scan

func Scan(env *Env, tablename string) interface{}

func ScanDangle

func ScanDangle(lambdaId string) []aws.JSONValue

func ScanIntent

func ScanIntent(lambdaId string) []aws.JSONValue

func StaticGC

func StaticGC(lambdaId string)

func SyncInvoke

func SyncInvoke(env *Env, callee string, input interface{}) (interface{}, string)

func TCondWrite

func TCondWrite(env *Env, tablename string, key string, value string, c bool) bool

func TPLAbort

func TPLAbort(env *Env)

func TPLCommit

func TPLCommit(env *Env)

func TPLRead

func TPLRead(env *Env, tablename string, key string, projection []string) (bool, aws.JSONValue)

func TPLWrite

func TPLWrite(env *Env, tablename string, key string, value aws.JSONValue) bool

func TQuery

func TQuery(env *Env, tablename string, key string) interface{}

func TRead

func TRead(env *Env, tablename string, key string) aws.JSONValue

func TWrite

func TWrite(env *Env, tablename string, key string, value string)

func Unlock

func Unlock(env *Env, tablename string, key string)

func WaitUntilActive

func WaitUntilActive(lambda string) bool

func WaitUntilAllActive

func WaitUntilAllActive(lambdas []string) bool

func WaitUntilAllDeleted

func WaitUntilAllDeleted(lambdas []string)

func WaitUntilDeleted

func WaitUntilDeleted(lambda string)

func Wrapper

func Wrapper(f func(env *Env) interface{}) func(iw interface{}) (OutputWrapper, error)

func Write

func Write(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder)

func WriteHead

func WriteHead(tablename string, key string)

func WriteNRows

func WriteNRows(tablename string, key string, n int)

func WriteTail

func WriteTail(tablename string, key string, row string)

Types

type Env

type Env struct {
	LambdaId    string
	InstanceId  string
	LogTable    string
	IntentTable string
	LocalTable  string
	StepNumber  int32
	Input       interface{}
	TxnId       string
	Instruction string
	Baseline    bool
}

func PrepareEnv

func PrepareEnv(iw *InputWrapper) *Env

type InputWrapper

type InputWrapper struct {
	CallerName  string      `mapstructure:"CallerName"`
	CallerId    string      `mapstructure:"CallerId"`
	CallerStep  int32       `mapstructure:"CallerStep"`
	InstanceId  string      `mapstructure:"InstanceId"`
	Input       interface{} `mapstructure:"Input"`
	TxnId       string      `mapstructure:"TxnId"`
	Instruction string      `mapstructure:"Instruction"`
	Async       bool        `mapstructure:"Async"`
}

func ParseInput

func ParseInput(raw interface{}) *InputWrapper

func (*InputWrapper) Deserialize

func (iw *InputWrapper) Deserialize(stream []byte)

func (*InputWrapper) Serialize

func (iw *InputWrapper) Serialize() []byte

type InvokeError

type InvokeError struct {
	ErrorMessage string           `json:"errorMessage"`
	ErrorType    string           `json:"errorType"`
	StackTrace   []StackTraceCall `json:"stackTrace"`
}

func (*InvokeError) Deserialize

func (ie *InvokeError) Deserialize(stream []byte)

type OutputWrapper

type OutputWrapper struct {
	Status string
	Output interface{}
}

func (*OutputWrapper) Deserialize

func (ow *OutputWrapper) Deserialize(stream []byte)

func (*OutputWrapper) Serialize

func (ow *OutputWrapper) Serialize() []byte

type StackTraceCall

type StackTraceCall struct {
	Label string `json:"label"`
	Line  int    `json:"line"`
	Path  string `json:"path"`
}

Jump to

Keyboard shortcuts

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