mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-01 13:48:56 +08:00

* Add pagination response to the readers Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com> * Remove println from influx reader Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
22 lines
411 B
Go
22 lines
411 B
Go
//
|
|
// Copyright (c) 2018
|
|
// Mainflux
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package cassandra
|
|
|
|
import (
|
|
"github.com/gocql/gocql"
|
|
)
|
|
|
|
// Connect establishes connection to the Cassandra cluster.
|
|
func Connect(hosts []string, keyspace string) (*gocql.Session, error) {
|
|
cluster := gocql.NewCluster(hosts...)
|
|
cluster.Keyspace = keyspace
|
|
cluster.Consistency = gocql.Quorum
|
|
|
|
return cluster.CreateSession()
|
|
}
|