-
Notifications
You must be signed in to change notification settings - Fork 903
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
[WIP] Support idl for hessian2 #2654
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2654 +/- ##
=======================================
Coverage 47.38% 47.39%
=======================================
Files 341 341
Lines 25122 25125 +3
=======================================
+ Hits 11904 11907 +3
+ Misses 12074 12072 -2
- Partials 1144 1146 +2 ☔ View full report in Codecov by Sentry. |
|
||
g.P() | ||
|
||
g.P("func ", "(x *", m.GoIdent.GoName, ")", "String() string {") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, we do not need this String()
method since dubbo-go-hessian2 just make use of reflection to serialize.
In the future, we could generate serialization details to make it fast. (hessian2 FastCodec)
// fieldGoType returns the Go type used for a field. | ||
// | ||
// If it returns pointer=true, the struct field is a pointer to the type. | ||
func fieldGoType(g *protogen.GeneratedFile, field *protogen.Field) (goType string, pointer bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe isPointer
is better?
} | ||
|
||
pointer = field.Desc.HasPresence() | ||
switch field.Desc.Kind() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss the mappings in details.
type serialization conversion: proto type => go type => java type
helping tool conversion: java interface file => proto file
e.g. Java does not support unsigned basic type, it would be complex when implementing helping tool if we decide to support unsigned basic type in proto and go.
Should we create a unique branch to track this working process. cc @chickenlj |
8319da0
to
9469cd8
Compare
9469cd8
to
4e34e05
Compare
ErrNoExtendArgsRespFieldNum = errors.New("extend args for response message should has a field") | ||
) | ||
|
||
type DubboGo struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dubbogo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
package generator | ||
|
||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用工具格式化下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Quality Gate passedIssues Measures |
@@ -22,15 +22,14 @@ import ( | |||
) | |||
|
|||
import ( | |||
"dubbo.apache.org/dubbo-go/v3/proto/hessian2_extend" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
挪到第三个 import 里面
Please submit a new pull request to https://github.com/dubbogo/protoc-gen-go-triple/ |
No description provided.