bingobot/internal/state
Ava Affine 0a29b35f4b Refactor state module to leverage DocumentBuffer
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>
2024-12-05 16:40:34 -08:00
..
state.go Refactor state module to leverage DocumentBuffer 2024-12-05 16:40:34 -08:00
state_test.go Refactor state module to leverage DocumentBuffer 2024-12-05 16:40:34 -08:00