You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/11 08:28:54 UTC

[GitHub] [apisix-go-plugin-runner] yunkunrao opened a new pull request #38: Remove the util.RPCTest hack

yunkunrao opened a new pull request #38:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/38


   Signed-off-by: rao yunkun <yu...@gmail.com>
   
   This PR is related with issue #33 


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-go-plugin-runner] yunkunrao commented on a change in pull request #38: Remove the util.RPCTest hack

Posted by GitBox <gi...@apache.org>.
yunkunrao commented on a change in pull request #38:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/38#discussion_r707040767



##########
File path: internal/server/server.go
##########
@@ -62,19 +71,11 @@ func recoverPanic() {
 }
 
 func dispatchRPC(ty byte, in []byte, conn net.Conn) (*flatbuffers.Builder, error) {
-	var err error
-	var bd *flatbuffers.Builder
-	switch ty {
-	case util.RPCPrepareConf:
-		bd, err = plugin.PrepareConf(in)
-	case util.RPCHTTPReqCall:
-		bd, err = plugin.HTTPReqCall(in, conn)
-	case util.RPCTest: // Just for test
-		bd, err = dealRPCTest(in)
-	default:
-		err = UnknownType{ty}
+	hl, ok := typeHandlerMap[ty]
+	if !ok {
+		return nil, UnknownType{ty}
 	}
-	return bd, err
+	return hl(in, conn)

Review comment:
       OK~




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-go-plugin-runner] spacewander merged pull request #38: chore: remove the util.RPCTest hack

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #38:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/38


   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-go-plugin-runner] spacewander commented on a change in pull request #38: Remove the util.RPCTest hack

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #38:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/38#discussion_r706983998



##########
File path: internal/server/server.go
##########
@@ -62,19 +71,11 @@ func recoverPanic() {
 }
 
 func dispatchRPC(ty byte, in []byte, conn net.Conn) (*flatbuffers.Builder, error) {
-	var err error
-	var bd *flatbuffers.Builder
-	switch ty {
-	case util.RPCPrepareConf:
-		bd, err = plugin.PrepareConf(in)
-	case util.RPCHTTPReqCall:
-		bd, err = plugin.HTTPReqCall(in, conn)
-	case util.RPCTest: // Just for test
-		bd, err = dealRPCTest(in)
-	default:
-		err = UnknownType{ty}
+	hl, ok := typeHandlerMap[ty]
+	if !ok {
+		return nil, UnknownType{ty}
 	}
-	return bd, err
+	return hl(in, conn)

Review comment:
       Let's remove the definition of RPCTest too




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-go-plugin-runner] codecov-commenter commented on pull request #38: Remove the util.RPCTest hack

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #38:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/38#issuecomment-917811437


   # [Codecov](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#38](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (68c07bb) into [master](https://codecov.io/gh/apache/apisix-go-plugin-runner/commit/f3df416f9b7002d12ad9535e7e11d6f738640195?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f3df416) will **decrease** coverage by `0.21%`.
   > The diff coverage is `30.00%`.
   
   > :exclamation: Current head 68c07bb differs from pull request most recent head 22213a9. Consider uploading reports for the commit 22213a9 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38/graphs/tree.svg?width=650&height=150&src=pr&token=BPFYE6AVQ3&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master      #38      +/-   ##
   ==========================================
   - Coverage   78.74%   78.52%   -0.22%     
   ==========================================
     Files          10       10              
     Lines         668      666       -2     
   ==========================================
   - Hits          526      523       -3     
   - Misses        115      116       +1     
     Partials       27       27              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [internal/server/server.go](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aW50ZXJuYWwvc2VydmVyL3NlcnZlci5nbw==) | `51.26% <30.00%> (-1.64%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f3df416...22213a9](https://codecov.io/gh/apache/apisix-go-plugin-runner/pull/38?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org