github.com/panw3i/tail@v1.1.2/watch/watch.go (about)

     1  // Copyright (c) 2015 HPE Software Inc. All rights reserved.
     2  // Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
     3  
     4  package watch
     5  
     6  import "gopkg.in/tomb.v1"
     7  
     8  // FileWatcher monitors file-level events.
     9  type FileWatcher interface {
    10  	// BlockUntilExists blocks until the file comes into existence.
    11  	BlockUntilExists(*tomb.Tomb) error
    12  
    13  	// ChangeEvents reports on changes to a file, be it modification,
    14  	// deletion, renames or truncations. Returned FileChanges group of
    15  	// channels will be closed, thus become unusable, after a deletion
    16  	// or truncation event.
    17  	// In order to properly report truncations, ChangeEvents requires
    18  	// the caller to pass their current offset in the file.
    19  	ChangeEvents(*tomb.Tomb, int64) (*FileChanges, error)
    20  }