chunkbuffer

package module
v0.0.0-...-05e8eff Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2015 License: MIT Imports: 6 Imported by: 0

README

chunkbuffer

Use a discrete object data-store such as Amazon S3, Google Cloud Storage, or the local filesystem as a buffer.

Documentation

Overview

chunkbuffer provides a buffer over an arbitrary object store.

To use a ChunkBuffer, you simply make and configure a Pile for the storage backend you want to use. Then you call `chunkbuffer.New` with your buffer's unique name and the Pile. This enables you to buffer anything using memory, the disk, the cloud, or anything other method.

Happy limitless buffering!

Index

Constants

View Source
const CHUNK_SIZE = 1024 * 1024 * 5
View Source
const PARALLEL_WORKERS = 2

Variables

View Source
var ErrLastChunk = errors.New("last chunk")

Functions

This section is empty.

Types

type ChunkBuffer

type ChunkBuffer struct {
	Name string
	// contains filtered or unexported fields
}

ChunkBuffer is a buffer working on a storage backend

func New

func New(name string, pile pile.Pile) *ChunkBuffer

New creates a ChunkBuffer

func (*ChunkBuffer) Close

func (cb *ChunkBuffer) Close() error

Close finalizes any in-progress reads and writes

func (*ChunkBuffer) Read

func (cb *ChunkBuffer) Read(p []byte) (n int, err error)

Read pulls data from the buffer

func (*ChunkBuffer) Write

func (cb *ChunkBuffer) Write(p []byte) (n int, err error)

Write pushes data into the buffer

Directories

Path Synopsis
pile provides abstract chunk storage methods for a ChunkBuffer.
pile provides abstract chunk storage methods for a ChunkBuffer.

Jump to

Keyboard shortcuts

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