Created a cassandra cluster using gocql library.
func CreateCassandraCluster(host string) (*gocql.Session, error) {
cluster := gocql.NewCluster(host)
cluster.ConnectTimeout = time.Second * 10
cluster.DisableInitialHostLookup = true
session, err := cluster.CreateSession()
if err != nil {
return session, err
}
return session, nil
}
my objective is to make a function with *gocql.Session as a argument that will check when passing any cassandra cluster's session is it connected or not connected? For redis we have PING query to determine redis is connected or not do we have similar thing for cassandra using gocql?