Documentation ¶
Index ¶
Constants ¶
const MinChunkSize = 4096
Minimum valid chunk size.
Variables ¶
var MissingType = errors.New("Manifest is missing Type")
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct {
// contains filtered or unexported fields
}
Blob is a container for arbitrary size data (byte sequence), constructed from lower-level Chunks.
func Open ¶
Open returns a new Blob, using the given chunk store and manifest.
It makes a copy of the manifest, so the caller is free to use it in any way after the call.
A Blob need not exist; passing in a Manifest with an Empty Root gives a Blob with zero contents. However, all the fields must be set to valid values.
func (*Blob) Save ¶
Save persists the Blob into the Store and returns a new Manifest that can be passed to Open later.
type Manifest ¶
type Manifest struct { Type string Root cas.Key Size uint64 // Must be >= MinChunkSize. ChunkSize uint32 // Must be >= 2. Fanout uint32 }
Manifest is a description of a Blob as persisted in a chunks.Store.
When creating a new Blob, create a Manifest and set the Type, ChunkSize and Fanout fields, the rest can be left to their zero values. See EmptyManifest for a helper that uses default tuning.
func EmptyManifest ¶
EmptyManifest returns an empty manifest of the given type with the default tuning parameters.
type SmallChunkSizeError ¶
type SmallChunkSizeError struct {
Given uint32
}
SmallChunkSizeError is the error returned from Open if the configuration has a ChunkSize less than MinChunkSize
func (SmallChunkSizeError) Error ¶
func (s SmallChunkSizeError) Error() string
type SmallFanoutError ¶
type SmallFanoutError struct {
Given uint32
}
SmallFanoutError is the error returned from Open if the configuration has a Fanout less than 2.
func (SmallFanoutError) Error ¶
func (s SmallFanoutError) Error() string