Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSDriver ¶
type FSDriver interface {
// Walk traverses the file system entries and writes each entry to fsEntriesCh.
// It must check for an error in errCh (which indicates the receiver of fsEntriesCh encountered
// a problem and terminate if one is present.
// Walk is the PRODUCER on fsEntriesCh and IS RESPONSIBLE FOR CLOSING IT!!
Walk(ctx context.Context, fsName db.FSName, path string, fsEntriesCh chan<- db.FSEntry, errCh <-chan error) error
}
FSDriver represents the operations that may be performed on a file system.
type RefreshOption ¶
type RefreshOption func(*config)
func WithEntriesChannelSize ¶
func WithEntriesChannelSize(n int) RefreshOption
WithEntriesChannelSize is a functional parameter that allows to choose the size of the entries channel used by AddNewFileSystemEntries.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker contains the elements necessary to track file system mutations.
func NewTracker ¶
func NewTracker(ctx context.Context, logger *zap.Logger, store storer, fsDriver FSDriver, fsName db.FSName) (*Tracker, error)
NewTracker creates a new initiliased Tracker.
func (*Tracker) GetRootPath ¶
TODO: the fact that this method returns an interface indicates a problem.
the implementation of this method likely belongs to the sync package, not the tracker.
func (*Tracker) ListMutations ¶
ListMutations finds all mutations that have taken place in the file system between VersionPrevious and VersionNew.
func (*Tracker) RefreshFSContents ¶
func (t *Tracker) RefreshFSContents(ctx context.Context, opts ...RefreshOption) error
RefreshFSContents walks the specified file system and saves the new contents as VersionNew. In order to proceed, RefreshFSContents first drops all VersionPrevious entries and moves the current VersionNew entries as VersionPrevious.