socketcluster-client-go icon indicating copy to clipboard operation
socketcluster-client-go copied to clipboard

Getting data before deserialization

Open kchaliki opened this issue 6 years ago • 2 comments

Hello - would like to ask what you think about the following:

When registering a callback to receive messages, the library code will by default call utils.DeserializeDataFromString on the message and pass a map[string]interface{} to the callback.

If the client code wants to unmarshall the message directly to a struct it has serialize then deserialize again or do an awful lot of copying and casting. Do you think it makes sense to pass back bytes instead?

kchaliki avatar Jun 06 '18 14:06 kchaliki

Yea, I think it would be nice to have this. +1

happilymarrieddad avatar Oct 02 '18 22:10 happilymarrieddad

Yeah, it will probably look into it. But, i am sure you will need some mechanism to convert bytes to struct.. or a proper json struct model.

sacOO7 avatar Oct 03 '18 14:10 sacOO7