Documentation ¶
Overview ¶
Package cache implements a simplistic persistent cache based on the filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CAS ¶
type CAS struct {
// contains filtered or unexported fields
}
CAS is a content addressable storage. It is intended to be used with git SHA1 data. It stores blobs as uncompressed files without git headers. This means that we can wire up files from the CAS directly with a FUSE file system.
type Cache ¶
type Cache struct { Git *gitCache Tree *TreeCache Blob *CAS // contains filtered or unexported fields }
Cache combines a blob, tree and git repo cache.
type LazyRepo ¶
type LazyRepo struct {
// contains filtered or unexported fields
}
LazyRepo represents a git repository that might be fetched on demand.
func NewLazyRepo ¶
NewLazyRepo creates a new repository. If the repository is never to be cloned, url should be set to empty string.
func (*LazyRepo) Clone ¶
func (r *LazyRepo) Clone()
Clone schedules the repository to be cloned. This method is safe for concurrent use from multiple goroutines.
func (*LazyRepo) Repository ¶
func (r *LazyRepo) Repository() *git.Repository
Repository returns a git.Repository for this repo, or nil if it wasn't loaded. This method is safe for concurrent use from multiple goroutines. The return value must not be Free'd since it is persisted inside LazyRepo.
type Options ¶
type Options struct { // FetchFrequency controls how often we run git fetch on the // locally cached git repositories. FetchFrequency time.Duration }
Options defines configurable options for the different caches.