Documentation
¶
Index ¶
Constants ¶
const (
StorageBoltDB
)
Snapshot type constants
Variables ¶
var ErrEncMetadata = errors.New("snapshot metadata cannot be encoded")
ErrEncMetadata represents an error when encoding snapshot metadata
var ErrMetadataRead = errors.New("snapshot metadata cannot be decoded")
ErrMetadataRead represents an error when metadata cannot be decoded
var ErrMetadataSizeRead = errors.New("snapshot metadata size cannot be decoded")
ErrMetadataSizeRead represents an error when reading the metadata size
var ErrNonexistantFile = errors.New("cannot find snapshot file")
ErrNonexistantFile represents an error when the snapshot passed in to be decoded is missing
var ErrSnapshotSize = errors.New("invalid snapshot size")
ErrSnapshotSize represents an error when reading the snapshot size
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot represents a snapshot struct with metadata and data
func DecodeFromFile ¶
DecodeFromFile decodes a snapshot file from a given path
func (*Snapshot) Encode ¶
Encode returns the bytes slice snapshot representation Snapshot Layout:
|metadata-size|metadata|data|
metadata-size: uint64 (8 bytes) specifies the amount of metadata bytes
metadata: Gob encoded of Metadata struct
data: Proxy data, byte slice. The Metadata have information about it, Storage, Gzipped and version.
func (*Snapshot) WriteDataToFile ¶
WriteDataToFile writes the data field (unzipped) to a given file path
func (*Snapshot) WriteDataToTmpFile ¶
WriteDataToTmpFile writes the data field (unzipped) to a temporal file