-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): watchfs sends over event bus, websocket API is an even…
…t stream move all filesystem-specific logic from websocket into watchfs. Rework watchfs to publish over the event bus. This sets up a broader shift for the websocket connection, which is now jus a stream of events coming off the bus. BREAKING CHANGE: websocket JSON messages have changed. They're now _always_ an object with "type" and "data" keys.
- Loading branch information
Showing
7 changed files
with
243 additions
and
217 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package event | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
const ( | ||
// ETFSICreateLinkEvent type for when FSI creates a link between a dataset | ||
// and working directory | ||
ETFSICreateLinkEvent = Type("fsi:CreateLinkEvent") | ||
) | ||
|
||
// FSICreateLinkEvent describes an FSI created link | ||
type FSICreateLinkEvent struct { | ||
FSIPath string | ||
Username string | ||
Dsname string | ||
} | ||
|
||
const ( | ||
// ETCreatedNewFile is the event for creating a new file | ||
ETCreatedNewFile = Type("watchfs:CreatedNewFile") | ||
// ETModifiedFile is the event for modifying a file | ||
ETModifiedFile = Type("watchfs:ModifiedFile") | ||
// ETDeletedFile is the event for deleting a file | ||
ETDeletedFile = Type("watchfs:DeletedFile") | ||
// ETRenamedFolder is the event for renaming a folder | ||
ETRenamedFolder = Type("watchfs:RenamedFolder") | ||
// ETRemovedFolder is the event for removing a folder | ||
ETRemovedFolder = Type("watchfs:RemovedFolder") | ||
) | ||
|
||
// WatchfsChange represents events for filesystem changes | ||
type WatchfsChange struct { | ||
Username string | ||
Dsname string | ||
Source string | ||
Destination string | ||
Time time.Time | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.