Explorar el Código

dropped go 1.1, added go 1.3 and tip

Christoph Hack hace 11 años
padre
commit
8a46f2c8b7
Se han modificado 5 ficheros con 18 adiciones y 36 borrados
  1. 2 1
      .travis.yml
  2. 3 1
      README.md
  3. 13 0
      conn.go
  4. 0 13
      conn_go11.go
  5. 0 21
      conn_go12.go

+ 2 - 1
.travis.yml

@@ -1,8 +1,9 @@
 language: go
 
 go:
-  - 1.1
   - 1.2
+  - 1.3
+  - tip
 
 script:
   - bash integration.sh

+ 3 - 1
README.md

@@ -13,6 +13,8 @@ Project Website: http://gocql.github.io/<br>
 API documentation: http://godoc.org/github.com/gocql/gocql<br>
 Discussions: https://groups.google.com/forum/#!forum/gocql
 
+Supported Versions: Cassandra 1.2, 2.0, 2.1; Go 1.2, 1.3
+
 Installation
 ------------
 
@@ -22,7 +24,7 @@ Installation
 Features
 --------
 
-* Modern Cassandra client for Cassandra 1.2 and 2.0
+* Modern Cassandra client using the native transport
 * Automatic type conversations between Cassandra and Go
   * Support for all common types including sets, lists and maps
   * Custom types can implement a `Marshaler` and `Unmarshaler` interface

+ 13 - 0
conn.go

@@ -606,6 +606,19 @@ func (c *Conn) decodeFrame(f frame, trace Tracer) (rval interface{}, err error)
 	}
 }
 
+func (c *Conn) setKeepalive(d time.Duration) error {
+	if tc, ok := c.conn.(*net.TCPConn); ok {
+		err := tc.SetKeepAlivePeriod(d)
+		if err != nil {
+			return err
+		}
+
+		return tc.SetKeepAlive(true)
+	}
+
+	return nil
+}
+
 type queryInfo struct {
 	id   []byte
 	args []ColumnInfo

+ 0 - 13
conn_go11.go

@@ -1,13 +0,0 @@
-// +build !go1.2
-
-package gocql
-
-import (
-	"log"
-	"time"
-)
-
-func (c *Conn) setKeepalive(d time.Duration) error {
-	log.Println("WARN: KeepAlive provided but not supported on Go < 1.2")
-	return nil
-}

+ 0 - 21
conn_go12.go

@@ -1,21 +0,0 @@
-// +build go1.2
-
-package gocql
-
-import (
-	"net"
-	"time"
-)
-
-func (c *Conn) setKeepalive(d time.Duration) error {
-	if tc, ok := c.conn.(*net.TCPConn); ok {
-		err := tc.SetKeepAlivePeriod(d)
-		if err != nil {
-			return err
-		}
-
-		return tc.SetKeepAlive(true)
-	}
-
-	return nil
-}