mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
added password for cassandra storage
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user