Browse Source

Move exp/scan to redisx.

Gary Burd 13 năm trước cách đây
mục cha
commit
3159684423
6 tập tin đã thay đổi với 13 bổ sung14 xóa
  1. 1 1
      README.markdown
  2. 3 4
      redisx/doc.go
  3. 3 3
      redisx/example.go
  4. 1 1
      redisx/struct.go
  5. 4 4
      redisx/struct_test.go
  6. 1 1
      redisx/util.go

+ 1 - 1
README.markdown

@@ -11,7 +11,7 @@ Features
 * [Publish/Subscribe](http://go.pkgdoc.org/github.com/garyburd/redigo/redis#Publish_and_Subscribe).
 * [Connection pooling](http://go.pkgdoc.org/github.com/garyburd/redigo/redis#Pool).
 * [Script helper object](http://go.pkgdoc.org/github.com/garyburd/redigo/redis#Script) with optimistic use of EVALSHA.
-* [Helper functions](http://go.pkgdoc.org/pkg/github.com/garyburd/redigo/redis#Reply_Helpers) for working with command replies.
+* [Helper functions](http://go.pkgdoc.org/github.com/garyburd/redigo/redis#Reply_Helpers) for working with command replies.
 
 Documentation
 -------------

+ 3 - 4
exp/scan/doc.go → redisx/doc.go

@@ -12,7 +12,6 @@
 // License for the specific language governing permissions and limitations
 // under the License.
 
-// Package scan is an experimental package for working with Redis commands and replies.  
-//
-// This package is a work in progress. The API is not stable.
-package scan
+// Package redisx contains experimental features for Redigo. Features in this
+// package may be modified or deleted at any time.
+package redisx

+ 3 - 3
exp/scan/example.go → redisx/example.go

@@ -3,8 +3,8 @@
 package main
 
 import (
-	"github.com/garyburd/redigo/exp/scan"
 	"github.com/garyburd/redigo/redis"
+	"github.com/garyburd/redigo/redisx"
 	"log"
 )
 
@@ -21,7 +21,7 @@ func main() {
 
 	v0 := &MyStruct{1, "hello"}
 
-	_, err = c.Do("HMSET", scan.AppendStruct([]interface{}{"key"}, v0)...)
+	_, err = c.Do("HMSET", redisx.AppendStruct([]interface{}{"key"}, v0)...)
 	if err != nil {
 		log.Fatal(err)
 	}
@@ -33,7 +33,7 @@ func main() {
 
 	v1 := &MyStruct{}
 
-	err = scan.ScanStruct(reply, v1)
+	err = redisx.ScanStruct(reply, v1)
 	if err != nil {
 		log.Fatal(err)
 	}

+ 1 - 1
exp/scan/struct.go → redisx/struct.go

@@ -12,7 +12,7 @@
 // License for the specific language governing permissions and limitations
 // under the License.
 
-package scan
+package redisx
 
 import (
 	"errors"

+ 4 - 4
exp/scan/struct_test.go → redisx/struct_test.go

@@ -12,10 +12,10 @@
 // License for the specific language governing permissions and limitations
 // under the License.
 
-package scan_test
+package redisx_test
 
 import (
-	"github.com/garyburd/redigo/exp/scan"
+	"github.com/garyburd/redigo/redisx"
 	"reflect"
 	"testing"
 )
@@ -51,7 +51,7 @@ func TestScanStruct(t *testing.T) {
 
 		value := reflect.New(reflect.ValueOf(tt.value).Type().Elem())
 
-		if err := scan.ScanStruct(reply, value.Interface()); err != nil {
+		if err := redisx.ScanStruct(reply, value.Interface()); err != nil {
 			t.Fatalf("ScanStruct(%s) returned error %v", tt.title)
 		}
 
@@ -83,7 +83,7 @@ var formatStructTests = []struct {
 
 func TestFormatStruct(t *testing.T) {
 	for _, tt := range formatStructTests {
-		args := scan.AppendStruct(nil, tt.value)
+		args := redisx.AppendStruct(nil, tt.value)
 		if !reflect.DeepEqual(args, tt.args) {
 			t.Fatalf("FormatStruct(%s) returned %v, want %v", tt.title, args, tt.args)
 		}

+ 1 - 1
exp/scan/util.go → redisx/util.go

@@ -12,7 +12,7 @@
 // License for the specific language governing permissions and limitations
 // under the License.
 
-package scan
+package redisx
 
 import (
 	"errors"