Rename to MoChi

This commit is contained in:
Lawrence, Rendall
2021-12-21 15:07:11 +03:00
parent 5a1ac73a3d
commit 4dbbb4ad83
72 changed files with 185 additions and 726 deletions
+7 -7
View File
@@ -1,4 +1,4 @@
// Package memory implements the storage interface for a Chihaya
// Package memory implements the storage interface for a Conf
// BitTorrent tracker keeping peer data in memory.
package memory
@@ -12,14 +12,14 @@ import (
"gopkg.in/yaml.v2"
"github.com/chihaya/chihaya/bittorrent"
"github.com/chihaya/chihaya/pkg/log"
"github.com/chihaya/chihaya/pkg/stop"
"github.com/chihaya/chihaya/pkg/timecache"
"github.com/chihaya/chihaya/storage"
"github.com/sot-tech/mochi/bittorrent"
"github.com/sot-tech/mochi/pkg/log"
"github.com/sot-tech/mochi/pkg/stop"
"github.com/sot-tech/mochi/pkg/timecache"
"github.com/sot-tech/mochi/storage"
)
// Name is the name by which this peer store is registered with Chihaya.
// Name is the name by which this peer store is registered with Conf.
const Name = "memory"
// Default config constants.
+2 -2
View File
@@ -1,8 +1,8 @@
package memory
import (
"github.com/chihaya/chihaya/storage"
"github.com/chihaya/chihaya/storage/test"
"github.com/sot-tech/mochi/storage"
"github.com/sot-tech/mochi/storage/test"
"testing"
"time"
)
+1 -1
View File
@@ -2,7 +2,7 @@ package storage
import (
"encoding/binary"
"github.com/chihaya/chihaya/bittorrent"
"github.com/sot-tech/mochi/bittorrent"
"net"
)
+8 -8
View File
@@ -1,4 +1,4 @@
// Package redis implements the storage interface for a Chihaya
// Package redis implements the storage interface for a Conf
// BitTorrent tracker keeping peer data in redis with hash.
// There two categories of hash:
//
@@ -32,14 +32,14 @@ import (
"github.com/gomodule/redigo/redis"
"gopkg.in/yaml.v2"
"github.com/chihaya/chihaya/bittorrent"
"github.com/chihaya/chihaya/pkg/log"
"github.com/chihaya/chihaya/pkg/stop"
"github.com/chihaya/chihaya/pkg/timecache"
"github.com/chihaya/chihaya/storage"
"github.com/sot-tech/mochi/bittorrent"
"github.com/sot-tech/mochi/pkg/log"
"github.com/sot-tech/mochi/pkg/stop"
"github.com/sot-tech/mochi/pkg/timecache"
"github.com/sot-tech/mochi/storage"
)
// Name is the name by which this peer store is registered with Chihaya.
// Name is the name by which this peer store is registered with Conf.
const Name = "redis"
// Default config constants.
@@ -850,7 +850,7 @@ func (ps *store) Stop() stop.Result {
go func() {
close(ps.closed)
ps.wg.Wait()
log.Info("storage: exiting. chihaya does not clear data in redis when exiting. chihaya keys have prefix 'IPv{4,6}_'.")
log.Info("storage: exiting. mochi does not clear data in redis when exiting. mochi keys have prefix 'IPv{4,6}_'.")
c.Done()
}()
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"time"
"github.com/alicebob/miniredis"
s "github.com/chihaya/chihaya/storage"
"github.com/chihaya/chihaya/storage/test"
s "github.com/sot-tech/mochi/storage"
"github.com/sot-tech/mochi/storage/test"
)
func createNew() s.Storage {
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"errors"
"sync"
"github.com/chihaya/chihaya/bittorrent"
"github.com/chihaya/chihaya/pkg/log"
"github.com/chihaya/chihaya/pkg/stop"
"github.com/sot-tech/mochi/bittorrent"
"github.com/sot-tech/mochi/pkg/log"
"github.com/sot-tech/mochi/pkg/stop"
)
var (
+2 -2
View File
@@ -1,8 +1,8 @@
package test
import (
"github.com/chihaya/chihaya/bittorrent"
"github.com/chihaya/chihaya/storage"
"github.com/sot-tech/mochi/bittorrent"
"github.com/sot-tech/mochi/storage"
"math/rand"
"net"
"runtime"
+2 -2
View File
@@ -1,8 +1,8 @@
package test
import (
"github.com/chihaya/chihaya/bittorrent"
"github.com/chihaya/chihaya/storage"
"github.com/sot-tech/mochi/bittorrent"
"github.com/sot-tech/mochi/storage"
"github.com/stretchr/testify/require"
"testing"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package test
import (
"github.com/chihaya/chihaya/bittorrent"
"github.com/sot-tech/mochi/bittorrent"
"net"
)