chunker

package
v0.0.0-...-4b51ba2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMinChunkSize is the default minimum chunk size.
	DefaultMinChunkSize = 2 << 10 // 2 KiB

	// DefaultMaxChunkSize is the default maximum chunk size.
	DefaultMaxChunkSize = 64 << 10 // 64 KiB

	// DefaultNormalChunkSize is the default normal chunk size.
	DefaultNormalChunkSize = 2<<10 + (8 << 10) // 10 KiB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunker

type Chunker struct {
	// contains filtered or unexported fields
}

Chunker is an implementation of the UltraCDC algorithm.

func NewChunker

func NewChunker(reader io.Reader) *Chunker

NewChunker creates a new chunker.

func NewChunkerWithOptions

func NewChunkerWithOptions(reader io.Reader, options *ChunkerOptions) *Chunker

NewChunker creates a new chunker with options.

func (*Chunker) Next

func (chunker *Chunker) Next() ([]byte, error)

Next returns the next chunk.

func (*Chunker) WriteTo

func (chunker *Chunker) WriteTo(writer io.Writer) (int64, error)

WriteTo implements io.WriterTo, writing all chunks to the given writer.

type ChunkerOptions

type ChunkerOptions struct {
	MinChunkSize    int
	MaxChunkSize    int
	NormalChunkSize int
}

ChunkerOptions contains options for a chunker.

Jump to

Keyboard shortcuts

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