Documentation
¶
Index ¶
- type DiffMetadata
- type FileMetadata
- type Options
- type SnapshotMetadata
- type Store
- func (s *Store) AddDiffMetadata(baseSnapshotID, targetSnapshotID, path string, metadata DiffMetadata) error
- func (s *Store) AddFileMetadata(snapshotID, path string, metadata FileMetadata) error
- func (s *Store) AddSnapshot(snapshot SnapshotMetadata) error
- func (s *Store) Close() error
- func (s *Store) DeleteSnapshot(id string) error
- func (s *Store) FindFilesByHash(snapshotID, hash string) (map[string]FileMetadata, error)
- func (s *Store) FindFilesByModTime(snapshotID string, startTime, endTime time.Time) (map[string]FileMetadata, error)
- func (s *Store) FindFilesByPattern(snapshotID, pattern string) (map[string]FileMetadata, error)
- func (s *Store) FindFilesBySize(snapshotID string, minSize, maxSize int64) (map[string]FileMetadata, error)
- func (s *Store) GetDiffMetadata(baseSnapshotID, targetSnapshotID, path string) (DiffMetadata, error)
- func (s *Store) GetFileMetadata(snapshotID, path string) (FileMetadata, error)
- func (s *Store) GetSnapshot(id string) (SnapshotMetadata, error)
- func (s *Store) IsHotLayerEnabled() bool
- func (s *Store) ListDiffs(baseSnapshotID, targetSnapshotID string) (map[string]DiffMetadata, error)
- func (s *Store) ListSnapshots() ([]SnapshotMetadata, error)
- func (s *Store) Shrink() error
- type StoreType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffMetadata ¶
type DiffMetadata struct {
Type string `json:"type"` // "added", "modified", "deleted"
OldSize int64 `json:"oldSize,omitempty"`
NewSize int64 `json:"newSize,omitempty"`
OldModTime int64 `json:"oldMtime,omitempty"`
NewModTime int64 `json:"newMtime,omitempty"`
OldPermissions uint32 `json:"oldMode,omitempty"`
NewPermissions uint32 `json:"newMode,omitempty"`
OldHash string `json:"oldHash,omitempty"`
NewHash string `json:"newHash,omitempty"`
DiffRef string `json:"diffRef,omitempty"` // Reference to diff data
}
DiffMetadata represents metadata for a file diff between snapshots
type FileMetadata ¶
type FileMetadata struct {
Size int64 `json:"size"`
ModTime int64 `json:"mtime"`
Permissions uint32 `json:"mode"`
IsDir bool `json:"isDir"`
Hash string `json:"hash,omitempty"`
DataRef string `json:"dataRef,omitempty"` // Reference to FlatBuffer data
SymlinkTarget string `json:"symlinkTarget,omitempty"`
}
FileMetadata represents metadata for a file in a snapshot
type Options ¶
Options for configuring the metadata store
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the default options for the metadata store
type SnapshotMetadata ¶
type SnapshotMetadata struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Description string `json:"description,omitempty"`
FileCount int `json:"fileCount"`
TotalSize int64 `json:"totalSize"`
RootPath string `json:"rootPath"`
IsHot bool `json:"isHot"` // Whether this snapshot is in the hot layer
}
SnapshotMetadata represents metadata for a snapshot
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a metadata store backed by BuntDB
func (*Store) AddDiffMetadata ¶
func (s *Store) AddDiffMetadata(baseSnapshotID, targetSnapshotID, path string, metadata DiffMetadata) error
AddDiffMetadata adds diff metadata between two snapshots
func (*Store) AddFileMetadata ¶
func (s *Store) AddFileMetadata(snapshotID, path string, metadata FileMetadata) error
AddFileMetadata adds file metadata to a snapshot
func (*Store) AddSnapshot ¶
func (s *Store) AddSnapshot(snapshot SnapshotMetadata) error
AddSnapshot adds a new snapshot to the metadata store
func (*Store) DeleteSnapshot ¶
DeleteSnapshot deletes a snapshot and all its file metadata
func (*Store) FindFilesByHash ¶
func (s *Store) FindFilesByHash(snapshotID, hash string) (map[string]FileMetadata, error)
FindFilesByHash finds files in a snapshot by hash
func (*Store) FindFilesByModTime ¶
func (s *Store) FindFilesByModTime(snapshotID string, startTime, endTime time.Time) (map[string]FileMetadata, error)
FindFilesByModTime finds files in a snapshot by modification time range
func (*Store) FindFilesByPattern ¶
func (s *Store) FindFilesByPattern(snapshotID, pattern string) (map[string]FileMetadata, error)
FindFilesByPattern finds files in a snapshot by pattern
func (*Store) FindFilesBySize ¶
func (s *Store) FindFilesBySize(snapshotID string, minSize, maxSize int64) (map[string]FileMetadata, error)
FindFilesBySize finds files in a snapshot by size range
func (*Store) GetDiffMetadata ¶
func (s *Store) GetDiffMetadata(baseSnapshotID, targetSnapshotID, path string) (DiffMetadata, error)
GetDiffMetadata retrieves diff metadata between two snapshots
func (*Store) GetFileMetadata ¶
func (s *Store) GetFileMetadata(snapshotID, path string) (FileMetadata, error)
GetFileMetadata retrieves file metadata from a snapshot
func (*Store) GetSnapshot ¶
func (s *Store) GetSnapshot(id string) (SnapshotMetadata, error)
GetSnapshot retrieves a snapshot from the metadata store
func (*Store) IsHotLayerEnabled ¶
IsHotLayerEnabled returns whether the hot layer is enabled
func (*Store) ListDiffs ¶
func (s *Store) ListDiffs(baseSnapshotID, targetSnapshotID string) (map[string]DiffMetadata, error)
ListDiffs lists all diffs between two snapshots
func (*Store) ListSnapshots ¶
func (s *Store) ListSnapshots() ([]SnapshotMetadata, error)
ListSnapshots lists all snapshots in the metadata store