Skip to content

Commit

Permalink
notify: add internal event for nonrecursiveTree (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeczalik committed Feb 12, 2015
1 parent a0545da commit c04bb6b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 40 deletions.
3 changes: 2 additions & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var estr = map[Event]string{
// got [notify.Delete notify.Delete|notify.Create] (i=1)
//
// Yup, here the diff have Recursive event inside. Go figure.
recursive: "internal.Recursive",
recursive: "recursive",
internal: "internal",
}

// String implements fmt.Stringer interface.
Expand Down
7 changes: 4 additions & 3 deletions event_fsevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ const (
Move = Event(FSEventsRenamed)
Error = Event(0x100000)

// Internal events TOOD(rjeczalik): unexport
//
// Recursive is used to distinguish recursive eventsets from non-recursive ones.
// recursive is used to distinguish recursive eventsets from non-recursive ones
recursive = Event(0x200000)
// internal is used for watching for new directories within recursive subtrees
// by non-recrusive watchers
internal = Event(0x400000)
)

const (
Expand Down
7 changes: 4 additions & 3 deletions event_inotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ const (
Move
Error

// Internal events TOOD(rjeczalik): unexport
//
// Recursive is used to distinguish recursive eventsets from non-recursive ones.
// recursive is used to distinguish recursive eventsets from non-recursive ones
recursive
// internal is used for watching for new directories within recursive subtrees
// by non-recrusive watchers
internal
)

// Inotify events.
Expand Down
7 changes: 4 additions & 3 deletions event_kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ const (
Move
Error

// Internal events TOOD(rjeczalik): unexport
//
// Recursive is used to distinguish recursive eventsets from non-recursive ones.
// recursive is used to distinguish recursive eventsets from non-recursive ones
recursive
// internal is used for watching for new directories within recursive subtrees
// by non-recrusive watchers
internal
)

const (
Expand Down
8 changes: 4 additions & 4 deletions event_readdcw.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const (
Move
Error

// Internal events TOOD(rjeczalik): unexport
//
// Recursive is used to distinguish recursive eventsets from non-recursive ones.
// recursive is used to distinguish recursive eventsets from non-recursive ones
recursive

// internal is used for watching for new directories within recursive subtrees
// by non-recrusive watchers
internal
// dirmarker TODO(pknap)
dirmarker
)
Expand Down
39 changes: 13 additions & 26 deletions event_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,29 @@ package notify
import "errors"

const (
Create = EvStubCreate
Delete = EvStubDelete
Write = EvStubWrite
Move = EvStubMove
Error = EvStubError

// Internal events TOOD(rjeczalik): unexport
//
// Recursive is used to distinguish recursive eventsets
// from non-recursive ones.
recursive = EvStubRecursive
)

// Events TODO
const (
EvStubCreate = Event(0x01)
EvStubDelete = Event(0x02)
EvStubWrite = Event(0x04)
EvStubMove = Event(0x08)
EvStubError = Event(0x10)
EvStubRecursive = Event(0x20)
EvStubAll = Event(0x7f)
Create Event = iota
Delete
Write
Move
Error

// recursive is used to distinguish recursive eventsets from non-recursive ones
recursive
// internal is used for watching for new directories within recursive subtrees
// by non-recrusive watchers
internal
)

var osestr = map[Event]string{}

var ekind = map[Event]Event{}

const notImplemented = "notify: not implemented"

type event struct{}

func (e *event) Event() Event { return Error }
func (e *event) Path() string { return notImplemented }
func (e *event) Path() string { return "" }
func (e *event) Sys() interface{} { return nil }

func isdir(EventInfo) (bool, error) {
return false, errors.New(notImplemented)
return false, errors.New("notify: not implemented")
}

0 comments on commit c04bb6b

Please sign in to comment.