added password for cassandra storage

This commit is contained in:
Radu Ioan Fericean
2015-09-30 10:10:24 +03:00
parent 4ecce29965
commit 48d76a1e63

View File

@@ -15,10 +15,15 @@ type CassandraStorage struct {
ms Marshaler
}
func NewCassandraStorage(addresses []string, keyspace, mrshlerStr string) (*CassandraStorage, error) {
func NewCassandraStorage(addresses []string, keyspace, user, pass, mrshlerStr string) (*CassandraStorage, error) {
cluster := gocql.NewCluster(addresses...)
cluster.Keyspace = keyspace
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: user,
Password: pass,
}
session, err := cluster.CreateSession()
if err != nil {
return nil, err
}