rename module name from bt to go-bt

This commit is contained in:
xgfone
2023-04-01 21:07:18 +08:00
parent fad4a74a4a
commit a212793117
46 changed files with 84 additions and 78 deletions

View File

@ -19,7 +19,7 @@ import (
"errors"
"net"
"github.com/xgfone/bt/bencode"
"github.com/xgfone/go-bt/bencode"
)
var errInvalidIP = errors.New("invalid ipv4 or ipv6")

View File

@ -19,16 +19,17 @@ import (
"encoding/binary"
"net"
"github.com/xgfone/bt/metainfo"
"github.com/xgfone/go-bt/metainfo"
)
// GenerateAllowedFastSet generates some allowed fast set of the torrent file.
//
// Argument:
// set: generated piece set, the length of which is the number to be generated.
// sz: the number of pieces in torrent.
// ip: the of the remote peer of the connection.
// infohash: infohash of torrent.
//
// set: generated piece set, the length of which is the number to be generated.
// sz: the number of pieces in torrent.
// ip: the of the remote peer of the connection.
// infohash: infohash of torrent.
//
// BEP 6
func GenerateAllowedFastSet(set []uint32, sz uint32, ip net.IP, infohash metainfo.Hash) {

View File

@ -18,7 +18,7 @@ import (
"net"
"testing"
"github.com/xgfone/bt/metainfo"
"github.com/xgfone/go-bt/metainfo"
)
func TestGenerateAllowedFastSet(t *testing.T) {

View File

@ -19,7 +19,7 @@ import (
"fmt"
"io"
"github.com/xgfone/bt/metainfo"
"github.com/xgfone/go-bt/metainfo"
)
var errInvalidProtocolHeader = fmt.Errorf("unexpected peer protocol header string")

View File

@ -14,9 +14,7 @@
package peerprotocol
import (
"testing"
)
import "testing"
func TestBitField(t *testing.T) {
bf := NewBitFieldFromBools([]bool{

View File

@ -21,8 +21,8 @@ import (
"net"
"time"
"github.com/xgfone/bt/bencode"
"github.com/xgfone/bt/metainfo"
"github.com/xgfone/go-bt/bencode"
"github.com/xgfone/go-bt/metainfo"
)
// Predefine some errors about extension support.

View File

@ -22,7 +22,7 @@ import (
"strings"
"time"
"github.com/xgfone/bt/metainfo"
"github.com/xgfone/go-bt/metainfo"
)
// Handler is used to handle the incoming peer connection.