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

[WIP] Support idl for hessian2 #2654

Closed
wants to merge 18 commits into from
Closed

Conversation

Yuukirn
Copy link

@Yuukirn Yuukirn commented Apr 6, 2024

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.39%. Comparing base (2f5143a) to head (b22996a).
Report is 12 commits behind head on main.

❗ Current head b22996a differs from pull request most recent head 705e77c. Consider uploading reports for the commit 705e77c to get more accurate results

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.
📢 Have feedback on the report? Share it here.


g.P()

g.P("func ", "(x *", m.GoIdent.GoName, ")", "String() string {")
Copy link
Contributor

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) {
Copy link
Contributor

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() {
Copy link
Contributor

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.

@DMwangnima
Copy link
Contributor

Should we create a unique branch to track this working process. cc @chickenlj

ErrNoExtendArgsRespFieldNum = errors.New("extend args for response message should has a field")
)

type DubboGo struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dubbogo

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


package generator

import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用工具格式化下

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
14 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
6.7% Duplication on New Code

See analysis details on SonarCloud

@@ -22,15 +22,14 @@ import (
)

import (
"dubbo.apache.org/dubbo-go/v3/proto/hessian2_extend"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

挪到第三个 import 里面

@chickenlj
Copy link
Contributor

Please submit a new pull request to https://github.com/dubbogo/protoc-gen-go-triple/

@chickenlj chickenlj closed this May 16, 2024
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

Successfully merging this pull request may close these issues.

None yet

5 participants