Documentation ¶
Index ¶
- func Sync(local *os.File, output io.Writer, control control.Control, ...) (err error)
- type ChunkLookupSlice
- type ProgressReporter
- type SyncData
- type ZSync2
- func (zsync *ZSync2) SearchReusableChunks(path string) (<-chan chunks.ChunkInfo, error)
- func (zsync *ZSync2) Sync(filePath string, output io.WriteSeeker) error
- func (zsync *ZSync2) WriteChunk(source io.ReadSeeker, target io.WriteSeeker, chunk chunks.ChunkInfo) error
- func (zsync *ZSync2) WriteChunks(source io.ReadSeeker, output io.WriteSeeker, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChunkLookupSlice ¶
type ChunkLookupSlice struct {
// contains filtered or unexported fields
}
func NewChunkLookupSlice ¶
func NewChunkLookupSlice(file io.ReadSeeker, chunkSize int64, weakChecksum hash.Hash, strongChecksum hash.Hash) (*ChunkLookupSlice, error)
func (ChunkLookupSlice) GetStrongChecksum ¶
func (s ChunkLookupSlice) GetStrongChecksum() []byte
func (ChunkLookupSlice) GetWeakChecksum ¶
func (s ChunkLookupSlice) GetWeakChecksum() []byte
type ProgressReporter ¶ added in v0.1.2
type ProgressReporter interface { SetDescription(label string) SetProgress(value int64) SetTotal(value int64) Write(p []byte) (n int, err error) }
func NewDummyProgressReporter ¶ added in v0.1.2
func NewDummyProgressReporter() ProgressReporter
type SyncData ¶
type SyncData struct { control.Control WeakChecksumBuilder hash.Hash StrongChecksumBuilder hash.Hash Local *os.File Output io.Writer // contains filtered or unexported fields }
func (*SyncData) AddMissingChunks ¶
type ZSync2 ¶ added in v0.1.3
type ZSync2 struct { BlockSize int64 ChecksumsIndex *index.ChecksumIndex RemoteFileUrl string RemoteFileSize int64 }
func (*ZSync2) SearchReusableChunks ¶ added in v0.1.3
func (*ZSync2) Sync ¶ added in v0.1.3
func (zsync *ZSync2) Sync(filePath string, output io.WriteSeeker) error
func (*ZSync2) WriteChunk ¶ added in v0.1.3
func (zsync *ZSync2) WriteChunk(source io.ReadSeeker, target io.WriteSeeker, chunk chunks.ChunkInfo) error
func (*ZSync2) WriteChunks ¶ added in v0.1.3
func (zsync *ZSync2) WriteChunks(source io.ReadSeeker, output io.WriteSeeker, chunkChannel <-chan chunks.ChunkInfo) error
Directories ¶
Path | Synopsis |
---|---|
Package chunks provides the basic structure for a pair of the weak and strong checksums.
|
Package chunks provides the basic structure for a pair of the weak and strong checksums. |
package filechecksum provides the FileChecksumGenerator, whose main responsibility is to read a file, and generate both weak and strong checksums for every block.
|
package filechecksum provides the FileChecksumGenerator, whose main responsibility is to read a file, and generate both weak and strong checksums for every block. |
Package index provides the functionality to describe a reference 'file' and its contents in terms of the weak and strong checksums, in such a way that you can check if a weak checksum is present, then check if there is a strong checksum that matches.
|
Package index provides the functionality to describe a reference 'file' and its contents in terms of the weak and strong checksums, in such a way that you can check if a weak checksum is present, then check if there is a strong checksum that matches. |
rollsum provides an implementation of a rolling checksum - a checksum that's efficient to advance a byte or more at a time.
|
rollsum provides an implementation of a rolling checksum - a checksum that's efficient to advance a byte or more at a time. |
Click to show internal directories.
Click to hide internal directories.