Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
Name string
RelativePath string // Path relative to the root of the mounted filesystem.
RealPathOfFile string // Path on the local filesystem.
LastEditTime uint64 // Use time.Now().UnixNano().
CreatedTime uint64
Atime uint64 // Announced access time, unix nanoseconds. 0 means unknown.
Size uint64
Mode uint32 // Announced mode bits. 0 means unknown; presenters fall back to 0644.
}
type RWMutex ¶ added in v0.5.0
RWMutex is a sync.RWMutex whose write unlock bumps listWrites. The count adds no waiting: Unlock bumps it and returns.
type SyncTracker ¶
type SyncTracker struct {
LocalFilesMu RWMutex
LocalFiles map[string]*File
RemoteFilesMu RWMutex
RemoteFiles map[string]*File
}
func NewSyncTracker ¶
func NewSyncTracker() *SyncTracker
func (*SyncTracker) PruneStaleLocalFiles ¶ added in v0.3.0
func (st *SyncTracker) PruneStaleLocalFiles()
PruneStaleLocalFiles removes entries whose underlying file no longer exists. The disk checks run outside the lock: one stat per shared file under the write lock stalled every reader of the list. The write lock is taken only when something is gone, and an entry replaced meanwhile stays.
Click to show internal directories.
Click to hide internal directories.