Documentation
¶
Index ¶
- type Manifest
- type ManifestFile
- type ManifestResult
- type Store
- func (s *Store) Exists(hash string) bool
- func (s *Store) Get(ctx context.Context, hash string) ([]byte, error)
- func (s *Store) Propagate(ctx context.Context, hash string, src *Store) error
- func (s *Store) Put(ctx context.Context, b []byte) (hash string, size int64, err error)
- func (s *Store) StoredSize(hash string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manifest ¶
type Manifest struct {
Version int64 `json:"version"`
CreatedAt int64 `json:"created_at"`
RepoRoot string `json:"repo_root"`
Files []ManifestFile `json:"files"`
}
type ManifestFile ¶
type ManifestResult ¶
ManifestResult holds the output of BuildManifest.
func BuildManifest ¶
func BuildManifest(ctx context.Context, bs *Store, repoRoot string, paths []string, readFile func(rel string) ([]byte, error), prevFiles []ManifestFile) (*ManifestResult, error)
BuildManifest reads each file via readFile, stores blobs, builds a manifest, and stores the manifest blob itself. Returns the manifest hash and total size.
If prevFiles is non-nil, unchanged files (same path, size, mode, and mtime) reuse the previous blob hash without re-reading or re-hashing the file. Symlinks are always re-read regardless of previous state.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Exists ¶
Exists reports whether the compressed blob file already exists in this store.
func (*Store) Propagate ¶
Propagate transfers a blob by hash from src into this store. It attempts a hardlink first (zero-copy, same filesystem). If the hardlink fails for any reason other than the destination already existing, it falls back to a raw copy of the compressed file - no decompress/recompress cycle.