Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SourceTree ¶
type SourceTree interface { GetBaseDir() string IsValid() bool Watch( dirList []string, filenameMatcher func(filename string) bool, interrupt <-chan bool, ) bool }
SourceTree is the interface that any implementation must comply with in order to be used by TCR engine
func New ¶
func New(dir string) (SourceTree, error)
New creates a new instance of source tree implementation with a root directory set as dir. The method returns an error if the root directory does not exist or cannot be accessed.
type SourceTreeImpl ¶
type SourceTreeImpl struct {
// contains filtered or unexported fields
}
SourceTreeImpl is the implementation of Source Tree interface
func (*SourceTreeImpl) GetBaseDir ¶
func (st *SourceTreeImpl) GetBaseDir() string
GetBaseDir returns the base directory for the source tree instance
func (*SourceTreeImpl) IsValid ¶
func (st *SourceTreeImpl) IsValid() bool
IsValid indicates that the source tree instance is valid
func (*SourceTreeImpl) Watch ¶
func (st *SourceTreeImpl) Watch( dirList []string, filenameMatcher func(filename string) bool, interrupt <-chan bool, ) bool
Watch starts watching for changes on a list of directories. The files under watch are the ones satisfying filenameMatcher() function. The watch lasts until either a watched file has been modified, or if an interruption is sent through the interrupt channel