Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrHandlerChanSize = 100 HandleErrorPool = 4 GCHandlingInterval = 1 * time.Second GCHandlingDelay = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileMd5NotMatchHandler ¶
type FileMd5NotMatchHandler struct {
// contains filtered or unexported fields
}
func (*FileMd5NotMatchHandler) Handle ¶
func (fnmh *FileMd5NotMatchHandler) Handle(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error
type FileNotExistHandler ¶
type FileNotExistHandler struct {
// contains filtered or unexported fields
}
func (*FileNotExistHandler) Handle ¶
func (feh *FileNotExistHandler) Handle(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error
type Handler ¶
type Handler interface {
Handle(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error
}
TODO: make it pluggable
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) HandlePieceError ¶
func (em *Manager) HandlePieceError(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error
HandlePieceError the peer should report the error with related info when it failed to download a piece from supernode. And the supernode should handle the piece Error and do some repair operations.
func (*Manager) StartHandleError ¶
StartHandleError starts a goroutine to handle the piece error.
Click to show internal directories.
Click to hide internal directories.