Documentation
¶
Index ¶
Constants ¶
const GobBackendName string = "gob"
Variables ¶
This section is empty.
Functions ¶
func GobCacheDir ¶
func GobCacheFilename ¶
Types ¶
type GobBackend ¶
Stores commits on disk at a particular filepath.
Commits are stored in Gob format. The file stored on disk is a series of Gob-encoded arrays, each prefixed with a four-byte value indicating the number of bytes in the next array. This framing creates redundancy (since the Gob type metadata is repeated for each array) but allows us to append to the file on disk instead of replacing the whole file when we want to cache new commits.
The Gob backend produces a cache file roughly half the size of the JSON backend on disk. It's also SIGNIFICANTLY faster to read the cache from disk when in Gob format rather than JSON format.
We also gzip the file when we're done using it to keep it even smaller on disk.
func (*GobBackend) Clear ¶
func (b *GobBackend) Clear() error
func (*GobBackend) Close ¶
func (b *GobBackend) Close() error
func (*GobBackend) Name ¶
func (b *GobBackend) Name() string
func (*GobBackend) Open ¶
func (b *GobBackend) Open() error
type JSONBackend ¶
type JSONBackend struct {
Path string
}
Stores commits on disk at a particular filepath.
Commits are stored as newline-delimited JSON. For now, all commits that match the revs being searched for are loaded into memory before being returned.
func (JSONBackend) Clear ¶
func (b JSONBackend) Clear() error
func (JSONBackend) Close ¶
func (b JSONBackend) Close() error
func (JSONBackend) Name ¶
func (b JSONBackend) Name() string
func (JSONBackend) Open ¶
func (b JSONBackend) Open() error
type NoopBackend ¶
type NoopBackend struct{}
func (NoopBackend) Clear ¶
func (b NoopBackend) Clear() error
func (NoopBackend) Close ¶
func (b NoopBackend) Close() error
func (NoopBackend) Name ¶
func (b NoopBackend) Name() string
func (NoopBackend) Open ¶
func (b NoopBackend) Open() error