ソースを参照

Updated readme (#1409)

Added authentication example
Aleks Volochnev 5 年 前
コミット
e5c8c1f505
1 ファイル変更16 行追加0 行削除
  1. 16 0
      README.md

+ 16 - 0
README.md

@@ -166,6 +166,22 @@ func main() {
 }
 ```
 
+
+Authentication 
+-------
+
+```go
+cluster := gocql.NewCluster("192.168.1.1", "192.168.1.2", "192.168.1.3")
+cluster.Authenticator = gocql.PasswordAuthenticator{
+	Username: "user",
+	Password: "password"
+}
+cluster.Keyspace = "example"
+cluster.Consistency = gocql.Quorum
+session, _ := cluster.CreateSession()
+defer session.Close()
+```
+
 Data Binding
 ------------