From f279423fd40335de5cc16f10b69a640830daaae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 19 Mar 2024 05:37:53 +0000 Subject: [PATCH] lua: bit32 --- flow/go.mod | 1 + flow/go.sum | 2 ++ flow/pua/peerdb.go | 3 +++ 3 files changed, 6 insertions(+) diff --git a/flow/go.mod b/flow/go.mod index 433d8c912c..e151b67788 100644 --- a/flow/go.mod +++ b/flow/go.mod @@ -10,6 +10,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs v1.0.4 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0 github.com/ClickHouse/clickhouse-go/v2 v2.21.1 + github.com/PeerDB-io/gluabit32 v1.0.0 github.com/aws/aws-sdk-go-v2 v1.25.3 github.com/aws/aws-sdk-go-v2/config v1.27.7 github.com/aws/aws-sdk-go-v2/credentials v1.17.7 diff --git a/flow/go.sum b/flow/go.sum index 4a3616a854..ec8e3499f8 100644 --- a/flow/go.sum +++ b/flow/go.sum @@ -54,6 +54,8 @@ github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= +github.com/PeerDB-io/gluabit32 v1.0.0 h1:jn88j22LqiqDoS47LUnvk29hsFQE6yW0imSsHHiYsV8= +github.com/PeerDB-io/gluabit32 v1.0.0/go.mod h1:tsHStN1XG5uGVWEA8d/RameB7el3PE3sVkvk8e3+FJg= github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= diff --git a/flow/pua/peerdb.go b/flow/pua/peerdb.go index 44dade8a89..31fb8bcae8 100644 --- a/flow/pua/peerdb.go +++ b/flow/pua/peerdb.go @@ -7,6 +7,7 @@ import ( "strconv" "time" + "github.com/PeerDB-io/gluabit32" "github.com/google/uuid" "github.com/jackc/pgx/v5" "github.com/shopspring/decimal" @@ -34,6 +35,8 @@ func RegisterTypes(ls *lua.LState) { loaders := ls.G.Registry.RawGetString("_LOADERS").(*lua.LTable) loaders.RawSetInt(2, ls.NewFunction(LoadPeerdbScript)) + ls.PreloadModule("bit32", bit32.Loader) + mt := LuaRecord.NewMetatable(ls) mt.RawSetString("__index", ls.NewFunction(LuaRecordIndex))