forked from mirror/ledisdb
rename package
This commit is contained in:
parent
eb77615b4b
commit
7d1f13f9d7
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
. ./dev.sh
|
. ./dev.sh
|
||||||
|
|
||||||
go get github.com/siddontang/go-log/log
|
|
||||||
go get github.com/siddontang/go-snappy/snappy
|
|
||||||
|
|
||||||
go get github.com/siddontang/goleveldb/leveldb
|
go get github.com/siddontang/goleveldb/leveldb
|
||||||
|
|
||||||
go get github.com/szferi/gomdb
|
go get github.com/szferi/gomdb
|
||||||
|
@ -14,6 +11,8 @@ go get github.com/boltdb/bolt
|
||||||
go get github.com/ugorji/go/codec
|
go get github.com/ugorji/go/codec
|
||||||
go get github.com/BurntSushi/toml
|
go get github.com/BurntSushi/toml
|
||||||
|
|
||||||
go get github.com/siddontang/go-bson/bson
|
|
||||||
|
|
||||||
|
go get github.com/siddontang/go/bson
|
||||||
|
go get github.com/siddontang/go/log
|
||||||
|
go get github.com/siddontang/go/snappy
|
||||||
go get github.com/siddontang/go/num
|
go get github.com/siddontang/go/num
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package ledis
|
package ledis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/ledisdb/rpl"
|
"github.com/siddontang/ledisdb/rpl"
|
||||||
"github.com/siddontang/ledisdb/store"
|
"github.com/siddontang/ledisdb/store"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"github.com/siddontang/go-snappy/snappy"
|
"github.com/siddontang/go/snappy"
|
||||||
"github.com/siddontang/ledisdb/store"
|
"github.com/siddontang/ledisdb/store"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
|
@ -2,7 +2,7 @@ package ledis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/ledisdb/config"
|
"github.com/siddontang/ledisdb/config"
|
||||||
"github.com/siddontang/ledisdb/rpl"
|
"github.com/siddontang/ledisdb/rpl"
|
||||||
"github.com/siddontang/ledisdb/store"
|
"github.com/siddontang/ledisdb/store"
|
||||||
|
|
|
@ -3,7 +3,7 @@ package ledis
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/ledisdb/rpl"
|
"github.com/siddontang/ledisdb/rpl"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
|
@ -110,6 +110,10 @@ func StrPutInt64(v int64) []byte {
|
||||||
return strconv.AppendInt(nil, v, 10)
|
return strconv.AppendInt(nil, v, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func StrPutUint64(v uint64) []byte {
|
||||||
|
return strconv.AppendUint(nil, v, 10)
|
||||||
|
}
|
||||||
|
|
||||||
func MinUInt32(a uint32, b uint32) uint32 {
|
func MinUInt32(a uint32, b uint32) uint32 {
|
||||||
if a > b {
|
if a > b {
|
||||||
return b
|
return b
|
||||||
|
|
|
@ -2,7 +2,7 @@ package rpl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
|
@ -2,7 +2,7 @@ package rpl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/ledisdb/config"
|
"github.com/siddontang/ledisdb/config"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -3,8 +3,8 @@ package server
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/siddontang/go-bson/bson"
|
"github.com/siddontang/go/bson"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/ledisdb/ledis"
|
"github.com/siddontang/ledisdb/ledis"
|
||||||
"github.com/ugorji/go/codec"
|
"github.com/ugorji/go/codec"
|
||||||
"io"
|
"io"
|
||||||
|
|
|
@ -3,7 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/ledisdb/ledis"
|
"github.com/siddontang/ledisdb/ledis"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
|
@ -2,7 +2,7 @@ package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/siddontang/go-snappy/snappy"
|
"github.com/siddontang/go/snappy"
|
||||||
"github.com/siddontang/ledisdb/ledis"
|
"github.com/siddontang/ledisdb/ledis"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
|
@ -150,9 +150,22 @@ func (i *info) dumpReplication(buf *bytes.Buffer) {
|
||||||
buf.WriteString("# Replication\r\n")
|
buf.WriteString("# Replication\r\n")
|
||||||
|
|
||||||
p := []infoPair{}
|
p := []infoPair{}
|
||||||
|
slaves := make([]string, 0, len(i.app.slaves))
|
||||||
for s, _ := range i.app.slaves {
|
for s, _ := range i.app.slaves {
|
||||||
p = append(p, infoPair{"slave", s.remoteAddr})
|
slaves = append(slaves, s.remoteAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p = append(p, infoPair{"readonly", i.app.ldb.IsReadOnly()})
|
||||||
|
|
||||||
|
if len(slaves) > 0 {
|
||||||
|
p = append(p, infoPair{"slave", strings.Join(slaves, ",")})
|
||||||
|
}
|
||||||
|
|
||||||
|
s, _ := i.app.ldb.ReplicationStat()
|
||||||
|
p = append(p, infoPair{"last_log_id", s.LastID})
|
||||||
|
p = append(p, infoPair{"first_log_id", s.FirstID})
|
||||||
|
p = append(p, infoPair{"commit_log_id", s.CommitID})
|
||||||
|
|
||||||
i.dumpPairs(buf, p...)
|
i.dumpPairs(buf, p...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/siddontang/go-log/log"
|
"github.com/siddontang/go/log"
|
||||||
"github.com/siddontang/go-snappy/snappy"
|
"github.com/siddontang/go/snappy"
|
||||||
"github.com/siddontang/ledisdb/ledis"
|
"github.com/siddontang/ledisdb/ledis"
|
||||||
"github.com/siddontang/ledisdb/rpl"
|
"github.com/siddontang/ledisdb/rpl"
|
||||||
"net"
|
"net"
|
||||||
|
|
Loading…
Reference in New Issue