-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use event type constants correctly
- Loading branch information
1 parent
59b0b02
commit adbf509
Showing
3 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
package event_types | ||
|
||
type EventType = string | ||
type EventType string | ||
|
||
var ( | ||
Create EventType = "CREATE" | ||
Write = "WRITE" | ||
Remove = "REMOVE" | ||
Rename = "RENAME" | ||
Write EventType = "WRITE" | ||
Remove EventType = "REMOVE" | ||
Rename EventType = "RENAME" | ||
) | ||
|
||
func (e EventType) IsValid() bool { | ||
switch e { | ||
case Create, Write, Remove, Rename: | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
func (e EventType) String() string { | ||
return string(e) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters