Added a lua migration helper script, hope it works correctly all the time!
This commit is contained in:
+11
-2
@@ -9,13 +9,22 @@ import (
|
||||
|
||||
func (a *ExpensesApp) registerLuaBinds(L *lua.LState) {
|
||||
ljson.Preload(L)
|
||||
L.SetGlobal("GetAllExpenses", L.NewFunction(a.luaGetAllExpenses))
|
||||
// Add the decimal.Decimal operations
|
||||
L.SetGlobal("AddDecimal", L.NewFunction(luadec.AddDecimal))
|
||||
|
||||
// Add our API
|
||||
L.SetGlobal("GetAllExpenses", L.NewFunction(a.luaGetAllExpenses))
|
||||
L.SetGlobal("GetExpense", L.NewFunction(a.luaGetExpense))
|
||||
L.SetGlobal("UpdateExpense", L.NewFunction(a.luaUpdateExpense))
|
||||
L.SetGlobal("NormalizeShare", L.NewFunction(a.luaNormalizeShares))
|
||||
|
||||
L.SetGlobal("InsertShare", L.NewFunction(a.luaInsertShare))
|
||||
|
||||
L.SetGlobal("InsertPayment", L.NewFunction(a.luaInsertPayment))
|
||||
}
|
||||
|
||||
func returnWithError(L *lua.LState, strErr string) int {
|
||||
L.Push(lua.LNil)
|
||||
L.Push(lua.LBool(false))
|
||||
L.Push(lua.LString(strErr))
|
||||
return 2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user