zsync

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 12 Imported by: 1

README

libzsync-go

libzsync implementation in Golang

See http://zsync.moria.org.uk/

Usage

import github.com/AppImageCrafters/libzsync-go
// Configure
sync, _ := zsync.NewZSync("https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage.zsync")
sync.RemoteFileUrl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"

// Execute
output, _ := os.Create("/tmp/appimagetool-new-x86_64.AppImage")
err = sync.Sync("/tmp/appimagetool-x86_64.AppImage", output)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZSync

type ZSync struct {
	BlockSize      int64
	ChecksumsIndex *index.ChecksumIndex

	RemoteFileUrl  string
	RemoteFileSize int64
}

func NewZSync

func NewZSync(zsyncFileUrl string) (*ZSync, error)

func NewZSyncFromControl

func NewZSyncFromControl(c *control.Control) *ZSync

func (*ZSync) SearchReusableChunks

func (zsync *ZSync) SearchReusableChunks(path string) (<-chan chunks.ChunkInfo, error)

func (*ZSync) Sync

func (zsync *ZSync) Sync(filePath string, output io.WriteSeeker) error

func (*ZSync) WriteChunk

func (zsync *ZSync) WriteChunk(source io.ReadSeeker, target io.WriteSeeker, chunk 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 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.

Jump to

Keyboard shortcuts

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