Skip to content
This repository has been archived by the owner. It is now read-only.

fyrchik/chunker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content-Defined Chunking in Golang

This package provides various CDC methods in Go.

Currently implemented:

Design

  1. All work is done through Chunker interface. Next method should return nil error iff a new chunk was consumed. Errors from underlying reader are returns unchanged except io.ErrUnexpectedEOF which is replaced with io.EOF.
  2. All chunkers are well-behaved in a sense that they don't use underlying Reader after encountering any error.

Usage

As simple as it seems:

r := bytes.NewReader(buf)
ch := NewRabin()
ch.Reset(r)
for chunk, err := r.Next(nil); err != nil {
    // process chunk
}

Next method can be provided with pre-allocated buffer for storing chunk data.

TODO

About

Contend-Defined Chunking in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages