chunker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_CHUNK = 256 << 10
	MAX_CHUNK = 4 << 20
	POL       = restic.Pol(0x39fc525c05db35)
)
View Source
const (
	AVG_CHUNK = 256 << 10
)

Variables

View Source
var ErrInvalidChunker = fmt.Errorf("Invalid chunker string")

Invalid chunker string error

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Data        []byte
	Size        int64
	Offset      int64
	Fingerprint uint64
}

Defines a chunk of data

type Chunker

type Chunker interface {
	Name() string
	Next() (*Chunk, error)
}

Chunker interface wraps the Next() method Next() gives the next chunk

func GetChunker

func GetChunker(cStr string, reader io.Reader) (Chunker, error)

Returns the appropriate chunker implementation based on the input string

func NewFastCDCChunker

func NewFastCDCChunker(r io.Reader) (Chunker, error)

func NewRabinFPChunker

func NewRabinFPChunker(r io.Reader) (Chunker, error)

type FastCDCChunker

type FastCDCChunker struct {
	*fastcdc.Chunker
}

Implements the FastCDC algorithm

func (*FastCDCChunker) Name

func (fc *FastCDCChunker) Name() string

func (*FastCDCChunker) Next

func (fc *FastCDCChunker) Next() (*Chunk, error)

type RabinFPChunker

type RabinFPChunker struct {
	*restic.Chunker
}

Implements the Rabin-fingerprint based CDC algorithm

func (*RabinFPChunker) Name

func (rc *RabinFPChunker) Name() string

func (*RabinFPChunker) Next

func (rc *RabinFPChunker) Next() (*Chunk, error)

Jump to

Keyboard shortcuts

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