chunks

package
v0.0.0-...-42c81d0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package chunks implements low-level storage for chunks of data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Type  string
	Level uint8
	Buf   []byte
}

Chunk is a chunk of data, to be stored in a CAS. A Chunk is assumed to be small enough to fit fully in memory in a single contiguous range of bytes.

func (*Chunk) String

func (c *Chunk) String() string

type Store

type Store interface {
	// Get a chunk from the chunk store.
	//
	// The returned Chunk is considered read-only and must not be
	// modified.
	Get(key cas.Key, type_ string, level uint8) (*Chunk, error)

	// Add a chunk to the chunk store.
	Add(chunk *Chunk) (key cas.Key, err error)
}

Store is a low-level CAS store that stores limited size chunks. It is not meant to store files directly.

Directories

Path Synopsis
Package chunkutil contains helper functions only needed by chunks.Store implementations.
Package chunkutil contains helper functions only needed by chunks.Store implementations.
Package mock contains chunks.Store implementation for testing.
Package mock contains chunks.Store implementation for testing.

Jump to

Keyboard shortcuts

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