Created
January 11, 2014 12:18
-
-
Save bobrik/8370292 to your computer and use it in GitHub Desktop.
goes example_test.go changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/example_test.go b/example_test.go | |
index c800734..1e97f9e 100644 | |
--- a/example_test.go | |
+++ b/example_test.go | |
@@ -2,16 +2,15 @@ | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
-package goes_test | |
+package goes | |
import ( | |
"fmt" | |
- "goes" | |
"net/url" | |
) | |
func ExampleConnection_CreateIndex() { | |
- conn := goes.NewConnection("localhost", "9200") | |
+ conn := NewConnection("localhost", "9200") | |
mapping := map[string]interface{}{ | |
"settings": map[string]interface{}{ | |
@@ -40,7 +39,7 @@ func ExampleConnection_CreateIndex() { | |
} | |
func ExampleConnection_DeleteIndex() { | |
- conn := goes.NewConnection("localhost", "9200") | |
+ conn := NewConnection("localhost", "9200") | |
resp, err := conn.DeleteIndex("yourinde") | |
if err != nil { | |
@@ -51,7 +50,7 @@ func ExampleConnection_DeleteIndex() { | |
} | |
func ExampleConnection_RefreshIndex() { | |
- conn := goes.NewConnection("localhost", "9200") | |
+ conn := NewConnection("localhost", "9200") | |
resp, err := conn.RefreshIndex("yourindex") | |
if err != nil { | |
@@ -62,7 +61,7 @@ func ExampleConnection_RefreshIndex() { | |
} | |
func ExampleConnection_Search() { | |
- conn := goes.NewConnection("localhost", "9200") | |
+ conn := NewConnection("localhost", "9200") | |
var query = map[string]interface{}{ | |
"query": map[string]interface{}{ | |
@@ -97,9 +96,9 @@ func ExampleConnection_Search() { | |
} | |
func ExampleConnection_Index() { | |
- conn := goes.NewConnection("localhost", "9200") | |
+ conn := NewConnection("localhost", "9200") | |
- d := goes.Document{ | |
+ d := Document{ | |
Index: "twitter", | |
Type: "tweet", | |
Fields: map[string]interface{}{ | |
@@ -121,11 +120,11 @@ func ExampleConnection_Index() { | |
} | |
func ExampleConnection_Delete() { | |
- conn := goes.NewConnection("localhost", "9200") | |
+ conn := NewConnection("localhost", "9200") | |
//[create index, index document ...] | |
- d := goes.Document{ | |
+ d := Document{ | |
Index: "twitter", | |
Type: "tweet", | |
Id: "1", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment