Documentation
¶
Index ¶
- Constants
- type ChildEntry
- type CustomMetadata
- type DirEntry
- type ExtendedAttribute
- type FSEntry
- type FileAttributes
- type FileEntry
- func (f *FileEntry) AddChecksum(checksum [32]byte)
- func (f *FileEntry) AddChunk(chunk objects.Chunk)
- func (f *FileEntry) AddContentType(contentType string)
- func (f *FileEntry) AddFileAttributes(fileAttributes FileAttributes)
- func (f *FileEntry) AddSymlinkTarget(symlinkTarget string)
- func (f *FileEntry) AddTags(tags []string)
- func (f *FileEntry) FileInfo() *objects.FileInfo
- func (f *FileEntry) Serialize() ([]byte, error)
- type Filesystem
- func (fsc *Filesystem) Children(path string) (<-chan string, error)
- func (fsc *Filesystem) Directories() <-chan string
- func (fsc *Filesystem) DirectoryChecksums() <-chan [32]byte
- func (fsc *Filesystem) FileChecksums() <-chan [32]byte
- func (fsc *Filesystem) Files() <-chan string
- func (fsc *Filesystem) Pathnames() <-chan string
- func (fsc *Filesystem) Stat(path string) (FSEntry, error)
- type ObjectType
Constants ¶
View Source
const VERSION = 001
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChildEntry ¶
type CustomMetadata ¶
type DirEntry ¶
type DirEntry struct { Version uint32 `msgpack:"version"` // Version number of the file entry structure for compatibility Name string `msgpack:"name"` // Name of the directory Type importer.RecordType `msgpack:"type"` // Type of entry (directory) Size int64 `msgpack:"size,omitempty"` // Size of the file in bytes (optional for directories) Permissions os.FileMode `msgpack:"permissions"` // Directory permissions (read/write/execute) ModTime time.Time `msgpack:"modTime"` // Modification time of the directory DeviceID uint64 `msgpack:"deviceID,omitempty"` // Device ID for special files (block/character devices) InodeID uint64 `msgpack:"inodeID,omitempty"` // Inode ID for special files (block/character devices) UserID uint64 `msgpack:"userID,omitempty"` // User ID of the owner (optional) GroupID uint64 `msgpack:"groupID,omitempty"` // Group ID of the owner (optional) NumLinks uint16 `msgpack:"numLinks,omitempty"` // Number of hard links to the directory (optional) Children []ChildEntry `msgpack:"children,omitempty"` // List of child entries' serialized checksums (files and subdirectories) ExtendedAttributes []ExtendedAttribute `msgpack:"extendedAttributes,omitempty"` // Extended attributes (xattrs) (optional) CustomMetadata []CustomMetadata `msgpack:"customMetadata,omitempty"` // Custom key-value metadata defined by the user (optional) Tags []string `msgpack:"tags,omitempty"` // List of tags associated with the directory (optional) ParentPath string `msgpack:"parentPath,omitempty"` // Path to the parent directory (optional) }
DirEntry represents the comprehensive structure for a directory entry
func DirEntryFromBytes ¶
func NewDirectoryEntry ¶
func NewDirectoryEntry(parentPath string, record *importer.ScanRecord) *DirEntry
type ExtendedAttribute ¶
type FileAttributes ¶
type FileAttributes struct { IsHidden bool `msgpack:"isHidden,omitempty"` // Hidden file attribute (Windows, Linux) IsSystem bool `msgpack:"isSystem,omitempty"` // System file attribute (Windows) IsReadonly bool `msgpack:"isReadonly,omitempty"` // Read-only attribute IsArchive bool `msgpack:"isArchive,omitempty"` // Archive attribute (Windows) IsTemporary bool `msgpack:"isTemporary,omitempty"` // Temporary file (Windows) }
FileAttributes represents platform-specific file attributes (e.g., hidden, system, etc.)
type FileEntry ¶
type FileEntry struct { Version uint32 `msgpack:"version"` // Version number of the file entry structure for compatibility Name string `msgpack:"name"` // Name of the file Type importer.RecordType `msgpack:"type"` // Type of entry (file, directory, symlink, etc.) Size int64 `msgpack:"size,omitempty"` // Size of the file in bytes (optional for directories) Permissions os.FileMode `msgpack:"permissions"` // File permissions (read/write/execute) ModTime time.Time `msgpack:"modTime"` // Modification time of the file or directory DeviceID uint64 `msgpack:"deviceID,omitempty"` // Device ID for special files (block/character devices) InodeID uint64 `msgpack:"inodeID,omitempty"` // Inode ID for special files (block/character devices) UserID uint64 `msgpack:"userID,omitempty"` // User ID of the owner (optional) GroupID uint64 `msgpack:"groupID,omitempty"` // Group ID of the owner (optional) NumLinks uint16 `msgpack:"numLinks,omitempty"` // Number of hard links to the file (optional) Checksum [32]byte `msgpack:"checksum,omitempty"` // Checksum of the file contents (SHA-256, etc.) Chunks []objects.Chunk `msgpack:"chunks,omitempty"` // List of chunk checksums (optional) ExtendedAttributes []ExtendedAttribute `msgpack:"extendedAttributes,omitempty"` // Extended attributes (xattrs) (optional) FileAttributes FileAttributes `msgpack:"fileAttributes,omitempty"` // Platform-specific attributes (e.g., hidden, system, etc.) SymlinkTarget string `msgpack:"symlinkTarget,omitempty"` // Target path if the entry is a symbolic link (optional) ContentType string `msgpack:"contentType,omitempty"` // MIME type of the file (optional) CustomMetadata []CustomMetadata `msgpack:"customMetadata,omitempty"` // Custom key-value metadata defined by the user (optional) Tags []string `msgpack:"tags,omitempty"` // List of tags associated with the file or directory (optional) ParentPath string `msgpack:"parentPath,omitempty"` // Path to the parent directory (optional) }
FileEntry represents the comprehensive structure for a file entry, capturing all relevant metadata
func FileEntryFromBytes ¶
func NewFileEntry ¶
func NewFileEntry(parentPath string, record *importer.ScanRecord) *FileEntry
func (*FileEntry) AddChecksum ¶
func (*FileEntry) AddContentType ¶
func (*FileEntry) AddFileAttributes ¶
func (f *FileEntry) AddFileAttributes(fileAttributes FileAttributes)
func (*FileEntry) AddSymlinkTarget ¶
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
func NewFilesystem ¶
func NewFilesystem(repo *repository.Repository, root [32]byte) (*Filesystem, error)
func (*Filesystem) Directories ¶
func (fsc *Filesystem) Directories() <-chan string
func (*Filesystem) DirectoryChecksums ¶
func (fsc *Filesystem) DirectoryChecksums() <-chan [32]byte
func (*Filesystem) FileChecksums ¶
func (fsc *Filesystem) FileChecksums() <-chan [32]byte
func (*Filesystem) Files ¶
func (fsc *Filesystem) Files() <-chan string
func (*Filesystem) Pathnames ¶
func (fsc *Filesystem) Pathnames() <-chan string
type ObjectType ¶
type ObjectType string
const ( ObjectTypeFile ObjectType = "file" ObjectTypeDir ObjectType = "directory" ObjectTypeSymlink ObjectType = "symlink" ObjectTypeDevice ObjectType = "device" ObjectTypePipe ObjectType = "pipe" ObjectTypeSocket ObjectType = "socket" )
Click to show internal directories.
Click to hide internal directories.