Skip to content

picobuf compatibility with regards to Marshal and Unmarshal. #53

Description

@egonelbre

At the moment picobuf.Marshal and picobuf.Unmarshal expect messages of type picobuf.Message, which has some specific methods. However, drpc endpoints create typedefinitions such as:

type drpcEncoding_File_certificate_proto struct{}

func (drpcEncoding_File_certificate_proto) Marshal(msg drpc.Message) ([]byte, error) {
	return picobuf.Marshal(msg)
}

func (drpcEncoding_File_certificate_proto) Unmarshal(buf []byte, msg drpc.Message) error {
	return picobuf.Unmarshal(buf, msg)
}

func (c *drpcCertificatesClient) Sign(ctx context.Context, in *SigningRequest) (*SigningResponse, error) {
	out := new(SigningResponse)
	err := c.cc.Invoke(ctx, "/node.Certificates/Sign", drpcEncoding_File_certificate_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

I would expect the Invoke to register with a more specific message such as picobuf.Message instead of relying on drpc.Message and expecting that Marshal and Unmarshal don't have additional constraints.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions