forked from mirror/ledisdb
rename package
This commit is contained in:
parent
eb77615b4b
commit
7d1f13f9d7
|
@ -2,9 +2,6 @@
|
|||
|
||||
. ./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/szferi/gomdb
|
||||
|
@ -14,6 +11,8 @@ go get github.com/boltdb/bolt
|
|||
go get github.com/ugorji/go/codec
|
||||
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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package ledis
|
||||
|
||||
import (
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"sync"
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"github.com/siddontang/go-snappy/snappy"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
"io"
|
||||
"os"
|
||||
|
|
|
@ -2,7 +2,7 @@ package ledis
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"github.com/siddontang/ledisdb/store"
|
||||
|
|
|
@ -3,7 +3,7 @@ package ledis
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"io"
|
||||
"time"
|
||||
|
|
|
@ -110,6 +110,10 @@ func StrPutInt64(v int64) []byte {
|
|||
return strconv.AppendInt(nil, v, 10)
|
||||
}
|
||||
|
||||
func StrPutUint64(v uint64) []byte {
|
||||
return strconv.AppendUint(nil, v, 10)
|
||||
}
|
||||
|
||||
func MinUInt32(a uint32, b uint32) uint32 {
|
||||
if a > b {
|
||||
return b
|
||||
|
|
|
@ -2,7 +2,7 @@ package rpl
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
|
|
|
@ -2,7 +2,7 @@ package rpl
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"os"
|
||||
"path"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,8 +3,8 @@ package server
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/siddontang/go-bson/bson"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/bson"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/ugorji/go/codec"
|
||||
"io"
|
||||
|
|
|
@ -3,7 +3,7 @@ package server
|
|||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"io"
|
||||
"net"
|
||||
|
|
|
@ -2,7 +2,7 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/siddontang/go-snappy/snappy"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
|
|
@ -150,9 +150,22 @@ func (i *info) dumpReplication(buf *bytes.Buffer) {
|
|||
buf.WriteString("# Replication\r\n")
|
||||
|
||||
p := []infoPair{}
|
||||
slaves := make([]string, 0, len(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...)
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/siddontang/go-log/log"
|
||||
"github.com/siddontang/go-snappy/snappy"
|
||||
"github.com/siddontang/go/log"
|
||||
"github.com/siddontang/go/snappy"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
"github.com/siddontang/ledisdb/rpl"
|
||||
"net"
|
||||
|
|
Loading…
Reference in New Issue