From 050aef8b7af5d75a5afa1a8df3c32a9831bd3913 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Tue, 16 Jul 2024 18:40:03 +0200 Subject: [PATCH] remove deprecated amqp mod, added official amqp mod --- go.mod | 4 ++-- go.sum | 7 +++---- rabbitmq/queue.go | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6f639ae..9b2d003 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,12 @@ module git.pbiernat.io/egommerce/go-api-pkg go 1.18 require ( - git.pbiernat.io/egommerce/api-entities v0.0.26 + git.pbiernat.io/egommerce/api-entities v0.2.3 github.com/fluent/fluent-logger-golang v1.9.0 github.com/go-redis/redis/v8 v8.11.5 github.com/hashicorp/consul v1.16.0 github.com/hashicorp/consul/api v1.22.0 github.com/joho/godotenv v1.5.1 - github.com/streadway/amqp v1.0.0 ) require ( @@ -71,6 +70,7 @@ require ( github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect + github.com/rabbitmq/amqp091-go v1.10.0 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/stretchr/testify v1.8.3 // indirect diff --git a/go.sum b/go.sum index 1c63ec4..97b9d8c 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,7 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.pbiernat.dev/egommerce/api-entities v0.0.26 h1:Avz02GINwuYWOjw1fmZIJ3QgGEIz3a5vRQZNaxxUQIk= -git.pbiernat.dev/egommerce/api-entities v0.0.26/go.mod h1:+BXvUcr6Cr6QNpJsW8BUfe1vVILdWDADNE0e3u0lNvU= +git.pbiernat.io/egommerce/api-entities v0.2.3/go.mod h1:INXAG5x4+i+vNwg1NpfPHiDW8nY1kn1K7pgLOtX+/I0= github.com/Azure/azure-sdk-for-go v44.0.0+incompatible h1:e82Yv2HNpS0kuyeCrV29OPKvEiqfs2/uJHic3/3iKdg= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= @@ -470,6 +469,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw= +github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o= github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -487,8 +488,6 @@ github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0 github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d h1:bVQRCxQvfjNUeRqaY/uT0tFuvuFY0ulgnczuR684Xic= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= -github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/rabbitmq/queue.go b/rabbitmq/queue.go index f382a5a..aa185da 100644 --- a/rabbitmq/queue.go +++ b/rabbitmq/queue.go @@ -6,12 +6,12 @@ import ( "fmt" "log" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" ) type Message map[string]interface{} -func Serialize(msg any) (string, error) { +func Serialize(msg any) (string, error) { // FIXME move to separate service var b bytes.Buffer encoder := json.NewEncoder(&b) err := encoder.Encode(msg) @@ -19,7 +19,7 @@ func Serialize(msg any) (string, error) { return b.String(), err } -func Deserialize(b []byte) (Message, error) { +func Deserialize(b []byte) (Message, error) { // FIXME move to separate service var msg Message buf := bytes.NewBuffer(b) decoder := json.NewDecoder(buf)