Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for protobuf with gRPC, suggest ignore service field or add gRPC support? #45

Closed
tsingson opened this issue Nov 11, 2019 · 1 comment
Closed

Comments

@tsingson
Copy link

suggest 1:

as .proto like this

syntax = "proto3";

package apkaaa;

message ActiveReq {
 string serial = 1;
 string code = 2;
 string mac_address_1 = 3;
 string mac_address_2 = 4;
 string release_sn = 5;
}

message ME {
     string user_id = 1;
     string register_date = 2;
     string expiration = 3;
}

message Active {
    ME me =1;
    string token = 2;
}

message ActiveResp {
 repeated Active active =1;
}

service ApkAaaService {
    rpc Active( ActiveReq ) returns (  ActiveResp ) {}
}

should membuffers to ignore the service field ??

suggest 2:

as we know, gRPC support custom codec like gRPC with flatbuffers,
should membuffers support gRPC ?

in go, gRPC codec interface

// Codec defines the interface gRPC uses to encode and decode messages.
// Note that implementations of this interface must be thread safe;
// a Codec's methods can be called from concurrent goroutines.
//
// Deprecated: use encoding.Codec instead.
type Codec interface {
	// Marshal returns the wire format of v.
	Marshal(v interface{}) ([]byte, error)
	// Unmarshal parses the wire format into v.
	Unmarshal(data []byte, v interface{}) error
	// String returns the name of the Codec implementation.  This is unused by
	// gRPC.
	String() string
}
@tsingson
Copy link
Author

sorry, i double check the docs first .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant