gosync

package module
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

Go implementation of the rsync algorithm

Build Status codecov Go Report Card

gosync is a go implementation of the rsync algorithm

Documentation

Index

Constants

View Source
const (
	ReadNextByte = iota
	ReadNextBlock
	ReadNone
)

consts...

Variables

This section is empty.

Functions

func ComputeWeakHash

func ComputeWeakHash(v []byte) uint32

ComputeWeakHash computes a weak hash

Types

type BlockRequester

type BlockRequester interface {
	DoRequest(startOffset int64, enfOffset int64) (data []byte, err error)
}

BlockRequester does synchronous requests on a remote source of blocks

type Config

type Config struct {
	// BlockSize force a fixed checksum block-size
	BlockSize int64

	// Logger is the logger used for gosync log.
	Logger logging.Logger

	// A hash function for calculating a strong checksum
	StrongHasher hash.Hash

	// MaxRequestBlockSize defines the maximum file block size for the remote transfer
	MaxRequestBlockSize int64

	// Resolver is an interface used by the patchers to obtain blocks from the source.
	Requester BlockRequester

	// Function for getting the file size
	SizeFunc func() (int64, error)
}

Config contains the parameters to start a gosync service.

type GoSync

GoSync represents a rsync service

func New

func New(c *Config) (GoSync, error)

New returns a new gosync instance given configuration.

type ReadSeekerAt

type ReadSeekerAt interface {
	io.ReadSeeker
	io.ReaderAt
}

ReadSeekerAt is the combination of ReadSeeker and ReaderAt interfaces

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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