Documentation
¶
Index ¶
Constants ¶
View Source
const FileDirectionry = "file"
View Source
const FileProtocolBufSize = 2 * 1024 * 1024
View Source
const P2PReadReqRespTime = time.Duration(time.Second * 10)
View Source
const P2PResponseFinish uint32 = 210
View Source
const P2PResponseOK uint32 = 200
View Source
const P2PWriteReqRespTime = time.Duration(time.Second * 10)
Variables ¶
This section is empty.
Functions ¶
func CalcFileSHA256 ¶
CalcFileSHA256 is used to calculate the sha256 value of the file type.
func CalcPathSHA256 ¶
CalcPathSHA256 is used to calculate the sha256 value of a file with a given path.
func CalcSHA256 ¶
CalcSHA256 is used to calculate the sha256 value of the data.
Types ¶
type Protocol ¶
type Protocol struct {
*core.Node
*WriteFileProtocol
*ReadFileProtocol
}
func NewProtocol ¶
type ReadFileProtocol ¶
type ReadFileProtocol struct {
// contains filtered or unexported fields
}
func NewReadFileProtocol ¶
func NewReadFileProtocol(node *core.Node) *ReadFileProtocol
func (*ReadFileProtocol) ReadFileAction ¶
type WriteFileProtocol ¶
type WriteFileProtocol struct {
// contains filtered or unexported fields
}
func NewWriteFileProtocol ¶
func NewWriteFileProtocol(node *core.Node) *WriteFileProtocol
func (*WriteFileProtocol) WriteFileAction ¶
func (e *WriteFileProtocol) WriteFileAction(id peer.ID, roothash, path string) error
Click to show internal directories.
Click to hide internal directories.