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 2022/09/26 10:08:26 UTC

[GitHub] [apisix-go-plugin-runner] spacewander commented on a diff in pull request #107: feat: support get response body by extra_info

spacewander commented on code in PR #107:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/107#discussion_r979818776


##########
pkg/http/http.go:
##########
@@ -95,6 +95,20 @@ type Response interface {
 	// It allows you to add or set response headers before reaching the client.
 	Header() Header
 
+	// Var returns the value of a Nginx variable, like `r.Var("request_time")`
+	//
+	// To fetch the value, the runner will look up the request's cache first. If not found,
+	// the runner will ask it from the APISIX. If the RPC call is failed, an error in
+	// pkg/common.ErrConnClosed type is returned.
+	Var(name string) ([]byte, error)
+
+	// Read returns HTTP response body
+	//
+	// To fetch the value, the runner will look up the request's cache first. If not found,
+	// the runner will ask it from the APISIX. If the RPC call is failed, an error in
+	// pkg/common.ErrConnClosed type is returned.
+	Read() ([]byte, error)

Review Comment:
   Better to use ReadBody?



-- 
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