BewareMyPower commented on code in PR #1006:
URL: https://github.com/apache/pulsar-client-go/pull/1006#discussion_r1166390253


##########
pulsar/schema.go:
##########
@@ -219,6 +226,107 @@ func (ps *ProtoSchema) GetSchemaInfo() *SchemaInfo {
        return &ps.SchemaInfo
 }
 
+type ProtoNativeSchema struct {
+       SchemaInfo
+}
+
+func NewProtoNativeSchemaWithMessage(message proto.Message, properties 
map[string]string) *ProtoNativeSchema {
+       return NewProtoNativeSchema(GetProtoNativeSchemaInfo(message), 
properties)
+}
+
+func NewProtoNativeSchema(protoNativeSchemaDef string, properties 
map[string]string) *ProtoNativeSchema {

Review Comment:
   I think this function should not be exposed to users. It's hard for users to 
know which string should be passed to the 1st parameter. I suggest only 
exposing the method that accepts a `proto.Message`:
   
   ```go
   func NewProtoNativeSchema(message proto.Message, properties 
map[string]string) *ProtoNativeSchema {
           return newProtoNativeSchema(GetProtoNativeSchemaInfo(message), 
properties)
   }
   
   func newProtoNativeSchema(protoNativeSchemaDef string, properties 
map[string]string) *ProtoNativeSchema {
   ```



-- 
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]

Reply via email to