-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
events: add a generic DHT event. (#154)
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package event | ||
|
||
// RawJSON is a type that contains a raw JSON string. | ||
type RawJSON string | ||
|
||
// GenericDHTEvent is a type that encapsulates an actual DHT event by carrying | ||
// its raw JSON. | ||
// | ||
// Context: the DHT event system is rather bespoke and a bit messy at the time, | ||
// so until we unify/clean that up, this event bridges the gap. It should only | ||
// be consumed for informational purposes. | ||
// | ||
// EXPERIMENTAL: this will likely be removed if/when the DHT event types are | ||
// hoisted to core, and the DHT event system is reconciled with the eventbus. | ||
type GenericDHTEvent struct { | ||
// Type is the type of the DHT event that occured. | ||
Type string | ||
|
||
// Raw is the raw JSON representation of the event payload. | ||
Raw RawJSON | ||
} |