[Groonga-commit] groonga/grnci at 8fa960d [master] Rename Dial/Open/CreateClient to Dial/Open/Create.

Back to archive index

Susumu Yata null+****@clear*****
Thu Jul 27 12:20:12 JST 2017


Susumu Yata	2017-07-27 12:20:12 +0900 (Thu, 27 Jul 2017)

  New Revision: 8fa960d91b17c1cce6851c3daffe7ea1360617e9
  https://github.com/groonga/grnci/commit/8fa960d91b17c1cce6851c3daffe7ea1360617e9

  Message:
    Rename Dial/Open/CreateClient to Dial/Open/Create.

  Modified files:
    v2/libgrn/client.go
    v2/libgrn/db_test.go

  Modified: v2/libgrn/client.go (+6 -6)
===================================================================
--- v2/libgrn/client.go    2017-07-27 12:19:25 +0900 (d0ee702)
+++ v2/libgrn/client.go    2017-07-27 12:20:12 +0900 (a78a14e)
@@ -29,9 +29,9 @@ type Client struct {
 	idleConns chan *conn
 }
 
-// DialClient returns a new Client connected to a GQTP server.
+// Dial returns a new Client connected to a GQTP server.
 // The expected address format is [scheme://][host][:port].
-func DialClient(addr string, options *ClientOptions) (*Client, error) {
+func Dial(addr string, options *ClientOptions) (*Client, error) {
 	if options == nil {
 		options = NewClientOptions()
 	}
@@ -48,8 +48,8 @@ func DialClient(addr string, options *ClientOptions) (*Client, error) {
 	return c, nil
 }
 
-// OpenClient opens an existing DB and returns a new Client.
-func OpenClient(path string, options *ClientOptions) (*Client, error) {
+// Open opens an existing DB and returns a new Client.
+func Open(path string, options *ClientOptions) (*Client, error) {
 	if options == nil {
 		options = NewClientOptions()
 	}
@@ -63,8 +63,8 @@ func OpenClient(path string, options *ClientOptions) (*Client, error) {
 	}, nil
 }
 
-// CreateClient creates a new DB and returns a new Client.
-func CreateClient(path string, options *ClientOptions) (*Client, error) {
+// Create creates a new DB and returns a new Client.
+func Create(path string, options *ClientOptions) (*Client, error) {
 	if options == nil {
 		options = NewClientOptions()
 	}

  Modified: v2/libgrn/db_test.go (+2 -2)
===================================================================
--- v2/libgrn/db_test.go    2017-07-27 12:19:25 +0900 (a7893b0)
+++ v2/libgrn/db_test.go    2017-07-27 12:20:12 +0900 (880b6e9)
@@ -20,12 +20,12 @@ func makeDB(t *testing.T) (db *grnci.DB, dir string) {
 	if err != nil {
 		t.Fatalf("ioutil.TempDir failed: %v", err)
 	}
-	conn, err := CreateClient(filepath.Join(dir, "db"), nil)
+	client, err := Create(filepath.Join(dir, "db"), nil)
 	if err != nil {
 		os.RemoveAll(dir)
 		t.Fatalf("Open failed: %v", err)
 	}
-	return grnci.NewDB(conn), dir
+	return grnci.NewDB(client), dir
 }
 
 // removeDB removes a temporary DB.
-------------- next part --------------
HTML����������������������������...
Télécharger 



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