A lot of the deserialisation is happening via JSON, even for code that is already deserialised.
There is a non-json marshaller, unmarshalMapToStruct(data map[string]interface{}, outStruct interface{}), in gorilla.go.
It should be moved to a separate package (not protocol implementation related, not API related) and tested.
Describe the solution
Move the function unmarshalMapToStruct(data map[string]interface{}, outStruct interface{}) into a separate package.
Test the funciton independently of protocol implementations.
Alternative methods
There could already be code that does this. It's important that we don't rely on translating map[string]interface{} into json and back into a golang struct though.
SurrealDB version
1.0.0
Contact Details
pratim.bhosale@surrealdb.com hugh@surrealdb.com
Is there an existing issue for this?
[X] I have searched the existing issues
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Is your feature request related to a problem?
A lot of the deserialisation is happening via JSON, even for code that is already deserialised. There is a non-json marshaller,
unmarshalMapToStruct(data map[string]interface{}, outStruct interface{})
, in gorilla.go. It should be moved to a separate package (not protocol implementation related, not API related) and tested.Describe the solution
Move the function
unmarshalMapToStruct(data map[string]interface{}, outStruct interface{})
into a separate package. Test the funciton independently of protocol implementations.Alternative methods
There could already be code that does this. It's important that we don't rely on translating
map[string]interface{}
into json and back into a golang struct though.SurrealDB version
1.0.0
Contact Details
pratim.bhosale@surrealdb.com hugh@surrealdb.com
Is there an existing issue for this?
Code of Conduct