socketcluster-client-go
socketcluster-client-go copied to clipboard
Getting data before deserialization
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?
Yea, I think it would be nice to have this. +1
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.