// GenCassandra generates a cassandra DSN from the passed URL.
GenCassandra generates a cassandra DSN from the passed URL.
// GenCassandra generates a cassandra DSN from the passed URL .
func GenCassandra(u *URL) (string, error) {
	host, port, dbname := "localhost", "9042", strings.TrimPrefix(u.Path, "/")
	if h := u.Hostname(); h != "" {
		host = h
	}
	if p := u.Port(); p != "" {
		port = p
	}
	q := u.Query()
	if u.User != nil {
		q.Set("username", u.User.Username())
		if pass, _ := u.User.Password(); pass != "" {
			q.Set("password", pass)
		}
	}
	if dbname != "" {
		q.Set("keyspace", dbname)
	}
	return host + ":" + port + genQueryOptions(q), nil
}
func GenCassandra ( u * URL ) ( string , error ) { host , port , dbname := " " , " " , strings . TrimPrefix ( u . Path , " " ) if h := u . Hostname ( ) ; h != " " { host = h } if p := u . Port ( ) ; p != " " { port = p } q := u . Query ( ) if u . User != nil { q . Set ( " " , u . User . Username ( ) ) if pass , _ := u . User . Password ( ) ; pass != " " { q . Set ( " " , pass ) } } if dbname != " " { q . Set ( " " , dbname ) } return host + " " + port + genQueryOptions ( q ) , nil }
GenCassandra generates a cassandra DSN from the passed URL.
GenCassandra generates a cassandra DSN from the passed URL .
// add user/pass // add dbname