Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileID ¶ added in v1.13.0
type FileID struct {
// contains filtered or unexported fields
}
FileID is an opaque, comparable file identity: one kind byte and 24 raw bytes with the unused tail zeroed, so == and map keys stay well-defined. An ID only means something on the filesystem that produced it; compare IDs through fsops.SameFile or key maps by fsops.FileKey.
func FileIDFromBytes ¶ added in v1.33.0
FileIDFromBytes is the inverse of Bytes. Any other length is no identity, which is what a row written before the tagged form decodes to.
func GetFileID ¶ added in v1.13.0
GetFileID returns the FileID and link count for a file without allocations. This is more efficient than LinkInfo when you don't need the string representation.
func RemoteFileID ¶ added in v1.33.0
RemoteFileID wraps up to 24 bytes of identity a remote host reported. Empty or longer input is no identity: cutting it would let two identities that share their first 24 bytes compare equal.
func UnixFileID ¶ added in v1.33.0
UnixFileID builds the identity of a (device, inode) pair.
func WindowsFileID ¶ added in v1.33.0
WindowsFileID builds the identity of a volume serial and file identifier.
func (FileID) Bytes ¶ added in v1.13.0
Bytes returns the tagged form, kind byte first. This is what dirscan stores.
func (FileID) Less ¶ added in v1.13.0
Less orders IDs by kind, then raw bytes, for stable signatures.
func (FileID) WriteToHash ¶ added in v1.13.0
WriteToHash writes the tagged form without allocating a slice.