Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurentLimiter ¶
func NewConcurentLimiter ¶
func NewConcurentLimiter(n int) *ConcurentLimiter
func (*ConcurentLimiter) Exit ¶
func (c *ConcurentLimiter) Exit()
func (*ConcurentLimiter) TryEnter ¶
func (c *ConcurentLimiter) TryEnter() bool
type DownloadTask ¶
type ErrResponse ¶
type NodeInfoMapper ¶
type NodeInfoMapper struct { // nodeId -> addr Inner map[Node]string `json:"inner"` Locker sync.RWMutex `json:"-"` }
func NewNodeInfoMapper ¶
func NewNodeInfoMapper() *NodeInfoMapper
func (*NodeInfoMapper) Add ¶
func (m *NodeInfoMapper) Add(node Node, addr string)
func (*NodeInfoMapper) Clone ¶
func (m *NodeInfoMapper) Clone() *NodeInfoMapper
func (*NodeInfoMapper) Get ¶
func (m *NodeInfoMapper) Get(node Node) string
type NodeListResp ¶
type NodeListResp struct {
Nodes []string `json:"nodes"`
}
type PieceLocalMapper ¶
type PieceLocalMapper struct { Inner map[Piece]*LocalInfo `json:"inner"` Locker sync.RWMutex `json:"-"` }
func NewPieceLocalMapper ¶
func NewPieceLocalMapper() *PieceLocalMapper
func (*PieceLocalMapper) Add ¶
func (m *PieceLocalMapper) Add(piece Piece, info *LocalInfo)
type PieceMapper ¶
type PieceMapper struct { PN map[Piece]NodeSet `json:"pn"` NP map[Node]PieceSet `json:"np"` Locker sync.RWMutex `json:"-"` }
func NewPieceMapper ¶
func NewPieceMapper() *PieceMapper
func (*PieceMapper) AddPiece ¶
func (m *PieceMapper) AddPiece(node Node, piece Piece)
func (*PieceMapper) Clone ¶
func (m *PieceMapper) Clone() *PieceMapper
func (*PieceMapper) GetNodeList ¶
func (m *PieceMapper) GetNodeList(piece Piece, n int) []Node
func (*PieceMapper) PurgeNode ¶
func (m *PieceMapper) PurgeNode(node Node)
type ReportParam ¶
Click to show internal directories.
Click to hide internal directories.