Skip to content

Commit

Permalink
Rename Dial/Open/CreateClient to Dial/Open/Create.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jul 27, 2017
1 parent a42011d commit 8fa960d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions v2/libgrn/client.go
Expand Up @@ -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()
}
Expand All @@ -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()
}
Expand All @@ -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()
}
Expand Down
4 changes: 2 additions & 2 deletions v2/libgrn/db_test.go
Expand Up @@ -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.
Expand Down

0 comments on commit 8fa960d

Please sign in to comment.