globnotify

package module
v0.0.0-...-4546229 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2017 License: MIT Imports: 5 Imported by: 1

README

globnotify

golang glob watcher. it watches a filesystem tree and notifies on file changes based on a glob pattern.

package main

import (
	"fmt"
	"log"

	"github.com/pilu/globnotify"
)

func main() {
	w, err := globnotify.New("./**/*.css")
	if err != nil {
		log.Fatal(err)
	}

	events, err := w.Watch()
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("watching...\n")

	for {
		select {
		case event := <-events:
			fmt.Printf("%+v\n", event)
		}
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher interface {
	Watch() (chan fsnotify.Event, error)
	Close()
}

func New

func New(glob string) (Watcher, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL