diff --git a/serializers/cbor.go b/serializers/cbor.go index 3b4845c..e4442b2 100644 --- a/serializers/cbor.go +++ b/serializers/cbor.go @@ -9,6 +9,8 @@ import ( "github.com/xconnio/wampproto-go/messages" ) +const CBORSerializerValue = 3 + var cborEncoder cbor.DecMode //nolint:gochecknoglobals type CBORSerializer struct{} diff --git a/serializers/helpers.go b/serializers/helpers.go index e99991d..71ed802 100644 --- a/serializers/helpers.go +++ b/serializers/helpers.go @@ -6,13 +6,6 @@ import ( "github.com/xconnio/wampproto-go/messages" ) -const ( - JSONSerializerValue = 1 - MsgPackSerializerValue = 2 - CBORSerializerValue = 3 - ProtobufSerializerValue = 16 -) - func ToMessage(wampMsg []any) (messages.Message, error) { messageType, _ := messages.AsInt64(wampMsg[0]) var msg messages.Message diff --git a/serializers/json.go b/serializers/json.go index d5ccd44..7176da3 100644 --- a/serializers/json.go +++ b/serializers/json.go @@ -6,6 +6,8 @@ import ( "github.com/xconnio/wampproto-go/messages" ) +const JSONSerializerValue = 1 + type JSONSerializer struct{} func (j *JSONSerializer) Serialize(message messages.Message) ([]byte, error) { diff --git a/serializers/msgpack.go b/serializers/msgpack.go index 7bf3d9e..0e27403 100644 --- a/serializers/msgpack.go +++ b/serializers/msgpack.go @@ -6,6 +6,8 @@ import ( "github.com/xconnio/wampproto-go/messages" ) +const MsgPackSerializerValue = 2 + type MsgPackSerializer struct{} func (m *MsgPackSerializer) Serialize(message messages.Message) ([]byte, error) {