From a466392b84f6ac56d78166722ae34aef164f7962 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 23 Jun 2024 11:33:35 +0200 Subject: [PATCH] use github.com/shufflingpixels/jsontime-go instead of github.com/eosswedenorg-go/jsontime --- api/go.mod | 2 +- api/go.sum | 4 ++-- api/message/json/codec.go | 6 ++++-- api/message/types.go | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/api/go.mod b/api/go.mod index fe492ef..f8d2a68 100644 --- a/api/go.mod +++ b/api/go.mod @@ -4,9 +4,9 @@ go 1.20 require ( github.com/alicebob/miniredis/v2 v2.30.2 - github.com/eosswedenorg-go/jsontime v0.0.0-20230509125027-08422d6236c7 github.com/go-redis/redismock/v9 v9.2.0 github.com/redis/go-redis/v9 v9.4.0 + github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d github.com/stretchr/testify v1.8.4 github.com/ugorji/go/codec v1.2.12 ) diff --git a/api/go.sum b/api/go.sum index 7c06dcc..79690e8 100644 --- a/api/go.sum +++ b/api/go.sum @@ -14,8 +14,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/eosswedenorg-go/jsontime v0.0.0-20230509125027-08422d6236c7 h1:rLPu++RHaxg4WmUOXeWYioZuafWs0PVcYuvzOWbOJjk= -github.com/eosswedenorg-go/jsontime v0.0.0-20230509125027-08422d6236c7/go.mod h1:eNUkVOymzgl0lViUhmm08PkutzqLnOQ6Dr+RUnf+Mq0= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/go-redis/redismock/v9 v9.2.0 h1:ZrMYQeKPECZPjOj5u9eyOjg8Nnb0BS9lkVIZ6IpsKLw= github.com/go-redis/redismock/v9 v9.2.0/go.mod h1:18KHfGDK4Y6c2R0H38EUGWAdc7ZQS9gfYxc94k7rWT0= @@ -35,6 +33,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk= github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d h1:nju7jR1Kf210tArPT6l//HlfLLFnvje1BWl5TSRsohQ= +github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d/go.mod h1:W0TaKyg3kDqWmFUxlax3qAls/lRdo12EseM6f4f0dzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= diff --git a/api/message/json/codec.go b/api/message/json/codec.go index b0fc25e..d254b47 100644 --- a/api/message/json/codec.go +++ b/api/message/json/codec.go @@ -1,12 +1,14 @@ package json import ( - jsontime "github.com/eosswedenorg-go/jsontime/v2" + "time" + "github.com/eosswedenorg/thalos/api/message" + "github.com/shufflingpixels/jsontime-go" ) func createCodec() message.Codec { - json_codec := jsontime.ConfigWithCustomTimeFormat + json_codec := jsontime.New("2006-01-02T15:04:05.000", time.UTC) return message.Codec{ Encoder: json_codec.Marshal, diff --git a/api/message/types.go b/api/message/types.go index b17b0ff..b012b79 100644 --- a/api/message/types.go +++ b/api/message/types.go @@ -24,7 +24,7 @@ type AccountAuthSequence struct { type TransactionTrace struct { ID string `json:"id" msgpack:"id"` BlockNum uint32 `json:"blocknum" msgpack:"blocknum"` - Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"2006-01-02T15:04:05.000" time_location:"UTC"` + Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp"` Status string `json:"status" msgpack:"status"` CPUUsageUS uint32 `json:"cpu_usage_us" msgpack:"cpu_usage_us"` NetUsageWords uint32 `json:"net_usage_words" msgpack:"net_usage_words"` @@ -54,7 +54,7 @@ type ActionTrace struct { BlockNum uint32 `json:"blocknum" msgpack:"blocknum"` - Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"2006-01-02T15:04:05.000" time_location:"UTC"` + Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp"` Receipt *ActionReceipt `json:"receipt,omitempty" msgpack:"receipt"` @@ -96,7 +96,7 @@ type TableDeltaRow struct { type TableDelta struct { BlockNum uint32 `json:"blocknum" msgpack:"blocknum"` - Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"2006-01-02T15:04:05.000" time_location:"UTC"` + Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp"` Name string `json:"name" msgpack:"name"` Rows []TableDeltaRow `json:"rows" msgpack:"rows"` } diff --git a/go.mod b/go.mod index 0b2d150..136cacb 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,6 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/eosswedenorg-go/jsontime v0.0.0-20230509125027-08422d6236c7 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -48,6 +47,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect diff --git a/go.sum b/go.sum index 0166289..b84d15d 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,6 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/eosswedenorg-go/antelope-ship-client v0.2.9 h1:Isa90Tktdumj/P9XgQ8kBRqS+2MAdcPl7ev/n0KFvUQ= github.com/eosswedenorg-go/antelope-ship-client v0.2.9/go.mod h1:a0Kp4BJID8DMD0pmHnK5/gojtpRhh2pqqgt4Hcy5Wrw= -github.com/eosswedenorg-go/jsontime v0.0.0-20230509125027-08422d6236c7 h1:rLPu++RHaxg4WmUOXeWYioZuafWs0PVcYuvzOWbOJjk= -github.com/eosswedenorg-go/jsontime v0.0.0-20230509125027-08422d6236c7/go.mod h1:eNUkVOymzgl0lViUhmm08PkutzqLnOQ6Dr+RUnf+Mq0= github.com/eosswedenorg-go/pid v1.0.1 h1:W4AEnnNwb041SpNR1uTZ/KbJ0OTA5eqiqIR1Q5Ah6A0= github.com/eosswedenorg-go/pid v1.0.1/go.mod h1:wiOB/JXGt4YA3+T0j0xmCGSc3Jxzb7Ti/Ftli1fgWu4= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -150,6 +148,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d h1:nju7jR1Kf210tArPT6l//HlfLLFnvje1BWl5TSRsohQ= +github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d/go.mod h1:W0TaKyg3kDqWmFUxlax3qAls/lRdo12EseM6f4f0dzE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=