This commit refactors the state module to remove the eventCache and introduce an eventStream instead. The eventStream is not a static array but a DocumentBuffer, and thus many functions had to be altered. This commit is best reviewed side by side with a before/after view instead of just looking at the diff. An Init() function is added to initialize the DocumentBuffer with config values. Facilities are added to both Event and EventType to allow for parsing them to and from string documents. a MakeEvent() function is added to create events of proper subtype based on a general data map input. ApplyToEvents() is added, which wraps around DocumentBuffer's Apply() method to alter the filter input type with one that Marshals and Unmarshals events. GetMatchingEvents() is now a proof of concept for DocumentBuffer's Apply() PruneCache() is now no longer needed. Signed-off-by: Ava Affine <ava@sunnypup.io> |
||
|---|---|---|
| .. | ||
| config | ||
| discord | ||
| docbuf | ||
| logging | ||
| state | ||