Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Subscriber ¶
func Subscriber(port string, handler func(event *pb.EventRequest))
Types ¶
type ActionHandler ¶
type ActionHandler struct {
Client pb.WatcherClient
}
ActionHandler publish directory changes over to remote grpc server.
func (*ActionHandler) OnFileCreated ¶
func (g *ActionHandler) OnFileCreated(path string) error
OnFileCreated sends Create action details to remote events server.
func (*ActionHandler) OnFileDeleted ¶
func (g *ActionHandler) OnFileDeleted(path string) error
OnFileDeleted sends remove action details to remote events server.
type EventHandler ¶
type Watcher ¶
type Watcher struct { Dir string EventHandler EventHandler // contains filtered or unexported fields }
Watcher watches the Dir and sends notification about file system changes events to EventHandler.
func New ¶
func New(dir string, eventHanlder EventHandler) *Watcher
Click to show internal directories.
Click to hide internal directories.