transmitlib

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyLocalToLocal

func CopyLocalToLocal(sourcefile string, targetfile string, h *hasher.Hasher, chunksize int) error

Types

type LocalFile

type LocalFile struct {
	// contains filtered or unexported fields
}

func OpenLocalSource

func OpenLocalSource(filename string) (*LocalFile, error)

func OpenOrCreateLocalTarget

func OpenOrCreateLocalTarget(filename string) (*LocalFile, error)

func (*LocalFile) BuildCache

func (lf *LocalFile) BuildCache(h *hasher.Hasher, chunksize int) error

func (*LocalFile) Close

func (lf *LocalFile) Close() error

func (*LocalFile) CloseAndRemove

func (lf *LocalFile) CloseAndRemove() error

func (*LocalFile) GetAllChunks

func (lf *LocalFile) GetAllChunks() (int, chan structs.ChunkStream)

func (*LocalFile) GetChunk

func (lf *LocalFile) GetChunk(chunkNo uint64) (structs.Chunk, error)

func (*LocalFile) GetFileInfo

func (lf *LocalFile) GetFileInfo() (structs.FileData, error)

func (*LocalFile) LoadCache

func (lf *LocalFile) LoadCache() error

func (*LocalFile) ReadChunkData

func (lf *LocalFile) ReadChunkData(filepos int64) ([]byte, int, error)

func (*LocalFile) SetFilesize

func (lf *LocalFile) SetFilesize(newsize int64) error

func (*LocalFile) WriteChunkData

func (lf *LocalFile) WriteChunkData(filepos int64, data []byte, datalen int) error

type SourceFile

type SourceFile interface {
	LoadCache() error
	BuildCache(h *hasher.Hasher, chunksize int) error
	GetFileInfo() (structs.FileData, error)
	GetChunk(chunkNo uint64) (structs.Chunk, error)
	GetAllChunks() (int, chan structs.ChunkStream)
	ReadChunkData(filepos int64) ([]byte, int, error)
	Close() error
}

type TargetFile

type TargetFile interface {
	BuildCache(h *hasher.Hasher, chunksize int) error
	SetFilesize(newsize int64) error
	GetChunk(chunkNo uint64) (structs.Chunk, error)
	WriteChunkData(filepos int64, data []byte, datalen int) error
	CloseAndRemove() error
}

Jump to

Keyboard shortcuts

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