Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvaildIndex = errors.New("invaild index") ErrWrongOrder = errors.New("wrong order") )
filesystem error
View Source
var (
ErrPieceCheck = errors.New("check piece sha1 fail")
)
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem manager data for memory and disk
func NewFileSystem ¶
func NewFileSystem(torrent *meta.Torrent, path string) *FileSystem
NewFileSystem return a FileSystem instance
func (*FileSystem) Dump ¶
func (fs *FileSystem) Dump() (int64, error)
Dump save data from memory to disk
func (*FileSystem) RequestData ¶
func (fs *FileSystem) RequestData(index, begin, length int, blockc chan *Block)
RequestData get demand block from memory or disk
Click to show internal directories.
Click to hide internal directories.