splitter

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package splitter manages splitting of object data into chunks.

Index

Constants

View Source
const DefaultAlgorithm = "DYNAMIC-4M-BUZHASH"

DefaultAlgorithm is the name of the splitter used by default for new repositories.

Variables

This section is empty.

Functions

func SupportedAlgorithms

func SupportedAlgorithms() []string

SupportedAlgorithms returns the list of supported splitters.

Types

type Factory

type Factory func() Splitter

Factory creates instances of Splitter

func Fixed

func Fixed(length int) Factory

Fixed returns a factory that creates splitters with fixed chunk length.

func GetFactory

func GetFactory(name string) Factory

GetFactory gets splitter factory with a specified name or nil if not found.

func Pooled added in v0.6.0

func Pooled(f Factory) Factory

Pooled returns a factory that recycles the splitters on Close().

type Splitter

type Splitter interface {
	ShouldSplit(b byte) bool
	MaxSegmentSize() int
	Reset()
	Close()
}

Splitter determines when to split a given object. It must return true if the object should be split after byte b is processed.

Jump to

Keyboard shortcuts

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