Cole-Greer commented on code in PR #3335:
URL: https://github.com/apache/tinkerpop/pull/3335#discussion_r2984852775
##########
gremlin-go/driver/serializer.go:
##########
@@ -46,6 +46,15 @@ type GraphBinarySerializer struct {
// CustomTypeReader user provided function to deserialize custom types
type CustomTypeReader func(data *[]byte, i *int) (interface{}, error)
+// CustomTypeWriter user provided function to serialize custom types
+type CustomTypeWriter func(value interface{}, buffer *bytes.Buffer) error
Review Comment:
Nit: It might be nice to also pass in the full graphBinary serializer to
this function. It isn't strictly necessary but could prove useful for custom
serializer authors to take advantage of some of our existing type serializers.
One example of this is how our [SamplePersonSerializer test implementation in
Java utilizes the existing type serializers for String and
Date](https://github.com/apache/tinkerpop/blob/a112cae9f576332ca3ad3d4a519482a5adad8e2a/gremlin-util/src/test/java/org/apache/tinkerpop/gremlin/util/ser/binary/types/sample/SamplePersonSerializer.java#L114-L115).
```suggestion
type CustomTypeWriter func(value interface{}, buffer *bytes.Buffer,
serializer *graphBinaryTypeSerializer) error
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]