chunker

package
v0.0.0-...-ee7ae68 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk []byte

type ChunkFunc

type ChunkFunc func(acc interface{}, chunk Chunk) (interface{}, interface{})

type ChunkMapFunc

type ChunkMapFunc func(acc interface{}, chunk Chunk) (interface{}, Chunk)

type Chunker

type Chunker interface {
	GetChannel() chan Chunk
	Map(f ChunkMapFunc, acc interface{}) Chunker
	Apply(f ChunkFunc, acc interface{}) interface{}
	Hash(hasher hash.Hash) []byte
}

type FileChunker

type FileChunker struct {
	Fname     string
	Size      int
	NumChunks int
	// contains filtered or unexported fields
}

func NewFileChunker

func NewFileChunker(fname string, chunkSize int) (*FileChunker, error)

func (*FileChunker) Apply

func (f *FileChunker) Apply(chunkFunc ChunkFunc, acc interface{}) interface{}

func (*FileChunker) GetChannel

func (f *FileChunker) GetChannel() chan Chunk

func (*FileChunker) Hash

func (f *FileChunker) Hash(hasher hash.Hash) []byte

func (*FileChunker) Map

func (f *FileChunker) Map(chunkFunc ChunkMapFunc, acc interface{}) Chunker

Jump to

Keyboard shortcuts

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