Documentation
¶
Overview ¶
Package delta implements file version tracking and diff-based compression.
Index ¶
- type CommitDelta
- type CompressionDecision
- type FileDelta
- type GitIntegration
- type Manager
- func (m *Manager) Cleanup(path string, keep int) error
- func (m *Manager) ComputeDiff(path string, fromHash, toHash string) (filter.IncrementalDelta, error)
- func (m *Manager) DecideCompression(path string, content string) CompressionDecision
- func (m *Manager) Get(path string, hash string) (*Version, error)
- func (m *Manager) GetLatest(path string) (*Version, error)
- func (m *Manager) GetVersions(path string) []*Version
- func (m *Manager) Load() error
- func (m *Manager) Save() error
- func (m *Manager) ShouldCompress(path string, content string) (bool, string)
- func (m *Manager) Stats() Stats
- func (m *Manager) Track(path string, content string) (*Version, error)
- type Stats
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitDelta ¶
CommitDelta represents changes in a commit.
type CompressionDecision ¶
type CompressionDecision struct {
UseDelta bool
BaseHash string
FullContent bool
EstimatedSavings int
}
CompressionDecision determines how to compress content.
type FileDelta ¶
type FileDelta struct {
Path string
OldHash string
NewHash string
ChangeType string // added, modified, deleted
}
FileDelta represents a file change.
type GitIntegration ¶
type GitIntegration struct {
// contains filtered or unexported fields
}
GitIntegration provides git-aware delta tracking.
func NewGitIntegration ¶
func NewGitIntegration(manager *Manager) *GitIntegration
NewGitIntegration creates git integration.
func (*GitIntegration) GetCommitDelta ¶
func (g *GitIntegration) GetCommitDelta(repoPath, commitHash string) (*CommitDelta, error)
GetCommitDelta returns delta for a commit.
func (*GitIntegration) TrackChangedFiles ¶
func (g *GitIntegration) TrackChangedFiles(repoPath string, sinceRef string) ([]string, error)
TrackChangedFiles tracks files changed since a ref.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager tracks file versions and computes deltas.
func (*Manager) ComputeDiff ¶
func (m *Manager) ComputeDiff(path string, fromHash, toHash string) (filter.IncrementalDelta, error)
ComputeDiff returns the diff between two versions.
func (*Manager) DecideCompression ¶
func (m *Manager) DecideCompression(path string, content string) CompressionDecision
DecideCompression determines the best compression strategy.
func (*Manager) GetVersions ¶
GetVersions returns all versions for a path.
func (*Manager) ShouldCompress ¶
ShouldCompress determines if delta compression should be used.