Skip to content

ugo-framework/ugo-spectator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ugo spectator logo

Ugo Spectator

The only file watcher you will ever need written in go (Golang).

Installation

go get github.com/ugo-framework/ugo-spectator

Then use it in your code use the following sysntax

package examples

import spectator "github.com/ugo-framework/ugo-spectator/lib"

func main() {
	// initialise the spectator with the dirname
	watcher, err := spectator.Init(".")
	if err != nil {
		// Handle Error
	}
	defer watcher.Close() // handle error
	// event to catch for file change
	for {
		select {
		case res := <-watcher.Ch:
			// Do Something
		}
	}
}

The full example can be viewed here This documentation is not Complete and still in its early stages