[Groonga-commit] groonga/grnci at a7a2d9d [master] Update comments.

Back to archive index

Susumu Yata null+****@clear*****
Fri Jul 28 12:24:06 JST 2017


Susumu Yata	2017-07-28 12:24:06 +0900 (Fri, 28 Jul 2017)

  New Revision: a7a2d9d496e67ad88fa37b92aad7ecb9fbdde6bd
  https://github.com/groonga/grnci/commit/a7a2d9d496e67ad88fa37b92aad7ecb9fbdde6bd

  Message:
    Update comments.

  Modified files:
    v2/gqtp.go
    v2/handler.go
    v2/http.go
    v2/libgrn/client.go

  Modified: v2/gqtp.go (+6 -3)
===================================================================
--- v2/gqtp.go    2017-07-27 17:22:34 +0900 (b277a47)
+++ v2/gqtp.go    2017-07-28 12:24:06 +0900 (afe5d05)
@@ -432,7 +432,8 @@ func (c *GQTPClient) exec(cmd string, body io.Reader) (Response, error) {
 	return resp, nil
 }
 
-// Exec assembles cmd and body into a Command and calls Query.
+// Exec parses cmd, sends the parsed command and returns the response.
+// It is the caller's responsibility to close the response.
 func (c *GQTPClient) Exec(cmd string, body io.Reader) (Response, error) {
 	command, err := ParseCommand(cmd)
 	if err != nil {
@@ -442,7 +443,9 @@ func (c *GQTPClient) Exec(cmd string, body io.Reader) (Response, error) {
 	return c.Query(command)
 }
 
-// Invoke assembles name, params and body into a Command and calls Query.
+// Invoke assembles name and params into a command,
+// sends the command and returns the response.
+// It is the caller's responsibility to close the response.
 func (c *GQTPClient) Invoke(name string, params map[string]interface{}, body io.Reader) (Response, error) {
 	cmd, err := NewCommand(name, params)
 	if err != nil {
@@ -452,7 +455,7 @@ func (c *GQTPClient) Invoke(name string, params map[string]interface{}, body io.
 	return c.Query(cmd)
 }
 
-// Query sends a command and receives a response.
+// Query sends cmd and returns the response.
 // It is the caller's responsibility to close the response.
 func (c *GQTPClient) Query(cmd *Command) (Response, error) {
 	if err := cmd.Check(); err != nil {

  Modified: v2/handler.go (+3 -0)
===================================================================
--- v2/handler.go    2017-07-27 17:22:34 +0900 (7f66ca0)
+++ v2/handler.go    2017-07-28 12:24:06 +0900 (76bb020)
@@ -5,13 +5,16 @@ import "io"
 // Handler defines the required methods of DB clients and handles.
 type Handler interface {
 	// Exec parses cmd, sends the parsed command and returns the response.
+	// It is the caller's responsibility to close the response.
 	Exec(cmd string, body io.Reader) (Response, error)
 
 	// Invoke assembles name and params into a command,
 	// sends the command and returns the response.
+	// It is the caller's responsibility to close the response.
 	Invoke(name string, params map[string]interface{}, body io.Reader) (Response, error)
 
 	// Query sends cmd and returns the response.
+	// It is the caller's responsibility to close the response.
 	Query(cmd *Command) (Response, error)
 
 	// Close closes the underlying connections or handles.

  Modified: v2/http.go (+6 -3)
===================================================================
--- v2/http.go    2017-07-27 17:22:34 +0900 (7491fdd)
+++ v2/http.go    2017-07-28 12:24:06 +0900 (bef7206)
@@ -379,7 +379,8 @@ func (c *HTTPClient) exec(name string, params map[string]string, body io.Reader)
 	return newHTTPResponse(resp)
 }
 
-// Exec assembles cmd and body into a Command and calls Query.
+// Exec parses cmd, sends the parsed command and returns the response.
+// It is the caller's responsibility to close the response.
 func (c *HTTPClient) Exec(cmd string, body io.Reader) (Response, error) {
 	command, err := ParseCommand(cmd)
 	if err != nil {
@@ -389,7 +390,9 @@ func (c *HTTPClient) Exec(cmd string, body io.Reader) (Response, error) {
 	return c.Query(command)
 }
 
-// Invoke assembles name, params and body into a Command and calls Query.
+// Invoke assembles name and params into a command,
+// sends the command and returns the response.
+// It is the caller's responsibility to close the response.
 func (c *HTTPClient) Invoke(name string, params map[string]interface{}, body io.Reader) (Response, error) {
 	cmd, err := NewCommand(name, params)
 	if err != nil {
@@ -399,7 +402,7 @@ func (c *HTTPClient) Invoke(name string, params map[string]interface{}, body io.
 	return c.Query(cmd)
 }
 
-// Query sends a command and receives a response.
+// Query sends cmd and returns the response.
 // It is the caller's responsibility to close the response.
 func (c *HTTPClient) Query(cmd *Command) (Response, error) {
 	if err := cmd.Check(); err != nil {

  Modified: v2/libgrn/client.go (+6 -3)
===================================================================
--- v2/libgrn/client.go    2017-07-27 17:22:34 +0900 (bd28e32)
+++ v2/libgrn/client.go    2017-07-28 12:24:06 +0900 (9f7c320)
@@ -147,7 +147,8 @@ func (c *Client) exec(cmd string, body io.Reader) (grnci.Response, error) {
 	return resp, nil
 }
 
-// Exec parses cmd, reassembles it and calls Query.
+// Exec parses cmd, sends the parsed command and returns the response.
+// It is the caller's responsibility to close the response.
 func (c *Client) Exec(cmd string, body io.Reader) (grnci.Response, error) {
 	command, err := grnci.ParseCommand(cmd)
 	if err != nil {
@@ -157,7 +158,9 @@ func (c *Client) Exec(cmd string, body io.Reader) (grnci.Response, error) {
 	return c.Query(command)
 }
 
-// Invoke assembles name, params and body into a command and calls Query.
+// Invoke assembles name and params into a command,
+// sends the command and returns the response.
+// It is the caller's responsibility to close the response.
 func (c *Client) Invoke(name string, params map[string]interface{}, body io.Reader) (grnci.Response, error) {
 	cmd, err := grnci.NewCommand(name, params)
 	if err != nil {
@@ -167,7 +170,7 @@ func (c *Client) Invoke(name string, params map[string]interface{}, body io.Read
 	return c.Query(cmd)
 }
 
-// Query sends a command and receives a response.
+// Query sends cmd and returns the response.
 // It is the caller's responsibility to close the response.
 func (c *Client) Query(cmd *grnci.Command) (grnci.Response, error) {
 	if err := cmd.Check(); err != nil {
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index