mirror of https://github.com/ledisdb/ledisdb.git
Merge branch 'develop'
This commit is contained in:
commit
1bb1caef09
3
Makefile
3
Makefile
|
@ -42,4 +42,5 @@ clean:
|
|||
$(GO) clean -i ./...
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
||||
gofmt -w=true cmd config ledis rpl server store vendor
|
||||
goimports -w=true cmd config ledis rpl server store vendor
|
|
@ -3,13 +3,14 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
var ip = flag.String("ip", "127.0.0.1", "redis/ledis/ssdb server ip")
|
||||
|
|
|
@ -5,10 +5,11 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
var ip = flag.String("h", "127.0.0.1", "ledisdb server ip (default 127.0.0.1)")
|
||||
|
|
|
@ -3,8 +3,9 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"os"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
var host = flag.String("host", "127.0.0.1", "ledis server host")
|
||||
|
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
|
|
@ -3,8 +3,6 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/server"
|
||||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
|
@ -13,6 +11,9 @@ import (
|
|||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/server"
|
||||
)
|
||||
|
||||
var configFile = flag.String("config", "", "ledisdb config file")
|
||||
|
|
|
@ -3,11 +3,12 @@ package config
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/siddontang/go/ioutil2"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"sync"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/siddontang/go/ioutil2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package ledis
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type batch struct {
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
type DumpHead struct {
|
||||
|
|
|
@ -2,10 +2,11 @@ package ledis
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
func TestDump(t *testing.T) {
|
||||
|
|
|
@ -3,8 +3,9 @@ package ledis
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/hack"
|
||||
"strconv"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
)
|
||||
|
||||
var errInvalidEvent = errors.New("invalid event")
|
||||
|
|
|
@ -2,16 +2,17 @@ package ledis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go/filelock"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/filelock"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
type Ledis struct {
|
||||
|
|
|
@ -4,8 +4,9 @@ import (
|
|||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"sync"
|
||||
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
type ibucket interface {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package ledis
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
var testLedis *Ledis
|
||||
|
|
|
@ -2,6 +2,7 @@ package ledis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/siddontang/rdb"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package ledis
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
func TestMigrate(t *testing.T) {
|
||||
|
|
|
@ -3,12 +3,13 @@ package ledis
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,10 +3,11 @@ package ledis
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
func checkLedisEqual(master *Ledis, slave *Ledis) error {
|
||||
|
|
|
@ -2,8 +2,9 @@ package ledis
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"regexp"
|
||||
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
var errDataType = errors.New("error data type")
|
||||
|
|
|
@ -3,9 +3,10 @@ package ledis
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
type Limit struct {
|
||||
|
|
|
@ -3,9 +3,10 @@ package ledis
|
|||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"time"
|
||||
)
|
||||
|
||||
type FVPair struct {
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
type KVPair struct {
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"container/list"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,9 +3,10 @@ package ledis
|
|||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"time"
|
||||
)
|
||||
|
||||
var errSetKey = errors.New("invalid set key")
|
||||
|
|
|
@ -3,9 +3,10 @@ package ledis
|
|||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -2,10 +2,11 @@ package ledis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go/hack"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
)
|
||||
|
||||
var m sync.Mutex
|
||||
|
|
|
@ -4,9 +4,10 @@ import (
|
|||
"bytes"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -582,9 +583,10 @@ func (db *DB) zRange(key []byte, min int64, max int64, offset int, count int, re
|
|||
return []ScorePair{}, nil
|
||||
}
|
||||
|
||||
nv := 64
|
||||
if count > 0 {
|
||||
nv = count
|
||||
nv := count
|
||||
// count may be very large, so we must limit it for below mem make.
|
||||
if nv <= 0 || nv > 1024 {
|
||||
nv = 64
|
||||
}
|
||||
|
||||
v := make([]ScorePair, 0, nv)
|
||||
|
|
|
@ -2,9 +2,10 @@ package ledis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,8 +3,9 @@ package ledis
|
|||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"github.com/siddontang/go/hack"
|
||||
"strconv"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
)
|
||||
|
||||
var errIntNumber = errors.New("invalid integer")
|
||||
|
|
|
@ -2,10 +2,11 @@ package rpl
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/edsrzf/mmap-go"
|
||||
"github.com/siddontang/go/log"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/edsrzf/mmap-go"
|
||||
"github.com/siddontang/go/log"
|
||||
)
|
||||
|
||||
//like leveldb or rocksdb file interface, haha!
|
||||
|
|
|
@ -2,14 +2,15 @@ package rpl
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -5,12 +5,13 @@ import (
|
|||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/sync2"
|
||||
"io"
|
||||
"path"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/sync2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package rpl
|
||||
|
||||
import (
|
||||
"github.com/siddontang/go/log"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
)
|
||||
|
||||
func TestFileTable(t *testing.T) {
|
||||
|
|
|
@ -3,12 +3,13 @@ package rpl
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
)
|
||||
|
||||
type GoLevelDBStore struct {
|
||||
|
|
|
@ -2,13 +2,14 @@ package rpl
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"path"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
type Stat struct {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package rpl
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
func TestReplication(t *testing.T) {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package rpl
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
func TestGoLevelDBStore(t *testing.T) {
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"net"
|
||||
"net/http"
|
||||
"path"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
type App struct {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
var testAppOnce sync.Once
|
||||
|
|
|
@ -3,10 +3,11 @@ package server
|
|||
import (
|
||||
"bytes"
|
||||
// "fmt"
|
||||
"github.com/siddontang/go/sync2"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/sync2"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
// var txUnsupportedCmds = map[string]struct{}{
|
||||
|
|
|
@ -3,15 +3,16 @@ package server
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/siddontang/go/bson"
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/ugorji/go/codec"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var allowedContentTypes = map[string]struct{}{
|
||||
|
|
|
@ -4,17 +4,18 @@ import (
|
|||
"bufio"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"io"
|
||||
"net"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
var errReadRequest = errors.New("invalid request protocol")
|
||||
|
|
|
@ -2,9 +2,10 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func TestHash(t *testing.T) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"strconv"
|
||||
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
// func getCommand(c *client) error {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/goredis"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func TestKV(t *testing.T) {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
func lpushCommand(c *client) error {
|
||||
|
|
|
@ -2,9 +2,10 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func testListIndex(key []byte, index int64, v int) error {
|
||||
|
|
|
@ -2,11 +2,12 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
func TestDumpRestore(t *testing.T) {
|
||||
|
|
|
@ -3,13 +3,14 @@ package server
|
|||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
func slaveofCommand(c *client) error {
|
||||
|
|
|
@ -2,12 +2,13 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
func checkDataEqual(master *App, slave *App) error {
|
||||
|
|
|
@ -2,11 +2,12 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func parseScanArgs(args [][]byte) (cursor []byte, match string, count int, desc bool, err error) {
|
||||
|
|
|
@ -2,10 +2,11 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
func TestScan(t *testing.T) {
|
||||
|
|
|
@ -6,11 +6,13 @@ import (
|
|||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
|
||||
"github.com/siddontang/ledisdb/vendor/lua"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/siddontang/ledisdb/vendor/lua"
|
||||
)
|
||||
|
||||
func parseEvalArgs(l *lua.State, c *client) error {
|
||||
|
|
|
@ -4,9 +4,10 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func TestCmdEval(t *testing.T) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/goredis"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func TestXSelect(t *testing.T) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/goredis"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func TestSet(t *testing.T) {
|
||||
|
|
|
@ -2,8 +2,9 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func checkTestSortRes(ay interface{}, checks []string) error {
|
||||
|
|
|
@ -2,9 +2,10 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func now() int64 {
|
||||
|
|
|
@ -2,13 +2,14 @@ package server
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//for simple implementation, we only support int64 score
|
||||
|
|
|
@ -2,10 +2,11 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/goredis"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/goredis"
|
||||
)
|
||||
|
||||
func TestZSet(t *testing.T) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package server
|
|||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
|
||||
|
|
|
@ -3,13 +3,14 @@ package server
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/sync2"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/sync2"
|
||||
)
|
||||
|
||||
type info struct {
|
||||
|
|
|
@ -4,18 +4,19 @@ import (
|
|||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/go/sync2"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"net"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/go/sync2"
|
||||
"github.com/siddontang/goredis"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,12 +5,13 @@ package server
|
|||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"github.com/siddontang/go/hack"
|
||||
"github.com/siddontang/go/num"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/siddontang/ledisdb/vendor/lua"
|
||||
"io"
|
||||
"sync"
|
||||
)
|
||||
|
||||
//ledis <-> lua type conversion, same as http://redis.io/commands/eval
|
||||
|
|
|
@ -4,6 +4,7 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/vendor/lua"
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
@ -11,6 +9,9 @@ import (
|
|||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
type testSnapshotDumper struct {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package server
|
||||
|
||||
import ()
|
||||
|
||||
func lowerSlice(buf []byte) []byte {
|
||||
for i, r := range buf {
|
||||
if 'A' <= r && r <= 'Z' {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package boltdb
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
var bucketName = []byte("ledisdb")
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
)
|
||||
|
||||
type DB struct {
|
||||
|
|
|
@ -2,6 +2,7 @@ package driver
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package store
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,8 +8,9 @@ package leveldb
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
"unsafe"
|
||||
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
)
|
||||
|
||||
type WriteBatch struct {
|
||||
|
|
|
@ -11,11 +11,12 @@ package leveldb
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"os"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
)
|
||||
|
||||
const defaultFilterBits int = 10
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
package mdb
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
mdb "github.com/siddontang/ledisdb/vendor/gomdb"
|
||||
"os"
|
||||
)
|
||||
|
||||
type Store struct {
|
||||
|
|
|
@ -12,11 +12,12 @@ package rocksdb
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"os"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
)
|
||||
|
||||
const defaultFilterBits int = 10
|
||||
|
|
|
@ -2,11 +2,12 @@ package store
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
|
||||
_ "github.com/siddontang/ledisdb/store/boltdb"
|
||||
_ "github.com/siddontang/ledisdb/store/goleveldb"
|
||||
_ "github.com/siddontang/ledisdb/store/leveldb"
|
||||
|
|
|
@ -3,11 +3,12 @@ package store
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
)
|
||||
|
||||
func TestStore(t *testing.T) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"testing"
|
||||
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
)
|
||||
|
||||
func TestTx(t *testing.T) {
|
||||
|
|
|
@ -2,9 +2,10 @@ package store
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"time"
|
||||
|
||||
"github.com/siddontang/ledisdb/store/driver"
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
"time"
|
||||
)
|
||||
|
||||
type WriteBatch struct {
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/binary"
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
|
|
Loading…
Reference in New Issue