transfer

package
v0.0.0-...-70b045a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockFileIO

type BlockFileIO interface {
	BlockReader
	BlockWriter
}

type BlockReader

type BlockReader interface {
	// 1. 通过RPC告知对端要从blockIndex开始收blockCount个块
	// 2. 获取一个bufio.Reader
	Read(blockIndex int64, blockCount int64) (reader bufio.Reader, err error)
}

type BlockServer

type BlockServer struct {
	BlockFileIO
	BlockSocketIO
	// contains filtered or unexported fields
}

func (*BlockServer) DownloadBlock

func (b *BlockServer) DownloadBlock(startBlockIndex int64, blockCount int64) (count int64, err error)

func (*BlockServer) Read

func (b *BlockServer) Read(blockIndex int64, blockCount int64) (reader bufio.Reader, err error)

func (*BlockServer) Write

func (b *BlockServer) Write(blockIndex int64, blockCount int64) (reader bufio.Writer, err error)

type BlockSocketIO

type BlockSocketIO interface {
	BlockReader
	BlockWriter
}

type BlockWriter

type BlockWriter interface {
	// 1. 通过blockindex确定应该在哪个文件的位置开始写
	Write(blockIndex int64, blockCount int64) (writer bufio.Writer, err error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL