zsync

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 15 Imported by: 0

README

zsync

Zsync implementation in Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sync

func Sync(local *os.File, output io.Writer, control control.Control) (err error)

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 SyncData

type SyncData struct {
	control.Control

	WeakChecksumBuilder   hash.Hash
	StrongChecksumBuilder hash.Hash
	Local                 *os.File
	Output                io.Writer
}

func (*SyncData) AddMissingChunks

func (syncData *SyncData) AddMissingChunks(matchingChunks []chunks.ChunkInfo) (missing []chunks.ChunkInfo)

func (*SyncData) SearchAllMatchingChunks

func (syncData *SyncData) SearchAllMatchingChunks() ([]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.

Jump to

Keyboard shortcuts

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