Documentation
¶
Index ¶
Constants ¶
View Source
const ( GobName = "gob" GobExtension = "gobz" Version = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface {
// Write the given FileInfo structure to the given writer.
// The codec must protect the written data against modification, usually by hashing the contained information
Serialize(paths map[string]*godi.FileInfo, writer io.Writer) (err error)
// Read a FileInfo slice from the given reader. The fileinfo Paths must be relative to the index file
// An error must be returned if the data read could not be verified.
Deserialize(reader io.Reader) ([]SerializedFileInfo, error)
// Extension returns the file extension of the codec, without the '.' prefix
Extension() string
}
Represents a codec's standard capabilities. A codec is a specialized implementation able to read and write indices of file hash information NOTE: Even though it would be more idiomatic to have two interfaces for read and write respectively, we just don't need it here
type Gob ¶
type Gob struct {
}
Reads and writes a file structured like so - version - numEntries - gobValue... - sha1 (hash of all hashes in prior map)
func (*Gob) Deserialize ¶
func (g *Gob) Deserialize(reader io.Reader) ([]SerializedFileInfo, error)
type SerializedFileInfo ¶
type SerializedFileInfo struct {
FileInfo godi.FileInfo
RelaPath string
}
Used as structure when deserializing information It contains both absolute and relative paths to allow dealing with relocated trees, or relocated seal files
Click to show internal directories.
Click to hide internal directories.