chunks

package
v0.0.0-...-810cf82 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 3 Imported by: 20

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(ctx context.Context, key cas.Key, type_ string, level uint8) (*Chunk, error)

	// Add a chunk to the chunk store.
	Add(ctx context.Context, 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