Skip to content

Commit

Permalink
Merge pull request #20 from philippgille/patch-2
Browse files Browse the repository at this point in the history
Add comment regarding credentials and TLS config in example code
  • Loading branch information
Aleksandr Sokolovskii authored Jan 1, 2019
2 parents fd03f3b + 4c1ce80 commit 854fd8d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ c, err := ignite.Connect(ctx, ignite.ConnInfo{
Major: 1,
Minor: 1,
Patch: 0,
// Credentials are only needed if they're configured in your Ignite server.
Username: "ignite",
Password: "ignite",
Dialer: net.Dialer{
Timeout: 10 * time.Second,
},
// Don't set the TLSConfig if your Ignite server
// isn't configured with any TLS certificates.
TLSConfig: &tls.Config{
// You should only set this to true for testing purposes.
InsecureSkipVerify: true,
},
})
Expand Down
36 changes: 24 additions & 12 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ func Test_SQL_Driver(t *testing.T) {
// open connection
db, err := sql.Open("ignite", "tcp://localhost:10800/ExampleDB?"+
"version=1.1.0"+
// Credentials are only needed if they're configured in your Ignite server.
"&username=ignite"+
"&password=ignite"+
// Don't set "tls=yes" if your Ignite server
// isn't configured with any TLS certificates.
"&tls=yes"+
// You should only set this to true for testing purposes.
"&tls-insecure-skip-verify=yes"+
"&page-size=10000"+
"&timeout=5000")
Expand Down Expand Up @@ -106,18 +110,22 @@ func Test_SQL_Driver(t *testing.T) {
func Test_Key_Value(t *testing.T) {
// connect
c, err := ignite.Connect(ignite.ConnInfo{
Network: "tcp",
Host: "localhost",
Port: 10800,
Major: 1,
Minor: 1,
Patch: 0,
Network: "tcp",
Host: "localhost",
Port: 10800,
Major: 1,
Minor: 1,
Patch: 0,
// Credentials are only needed if they're configured in your Ignite server.
Username: "ignite",
Password: "ignite",
Dialer: net.Dialer{
Timeout: 10 * time.Second,
},
// Don't set the TLSConfig if your Ignite server
// isn't configured with any TLS certificates.
TLSConfig: &tls.Config{
// You should only set this to true for testing purposes.
InsecureSkipVerify: true,
},
})
Expand Down Expand Up @@ -181,18 +189,22 @@ func Test_Key_Value(t *testing.T) {
func Test_SQL_Queries(t *testing.T) {
// connect
c, err := ignite.Connect(ignite.ConnInfo{
Network: "tcp",
Host: "localhost",
Port: 10800,
Major: 1,
Minor: 1,
Patch: 0,
Network: "tcp",
Host: "localhost",
Port: 10800,
Major: 1,
Minor: 1,
Patch: 0,
// Credentials are only needed if they're configured in your Ignite server.
Username: "ignite",
Password: "ignite",
Dialer: net.Dialer{
Timeout: 10 * time.Second,
},
// Don't set the TLSConfig if your Ignite server
// isn't configured with any TLS certificates.
TLSConfig: &tls.Config{
// You should only set this to true for testing purposes.
InsecureSkipVerify: true,
},
})
Expand Down

0 comments on commit 854fd8d

Please sign in to comment.