Documentation ¶
Index ¶
- func FilterFutureDismissals(msgs []gregor.InBandMessage, allmsgs map[string]gregor.InBandMessage, ...) []gregor.InBandMessage
- type MemEngine
- func (m *MemEngine) Clear() error
- func (m *MemEngine) Clock() clockwork.Clock
- func (m *MemEngine) ConsumeMessage(msg gregor.Message) (time.Time, error)
- func (m *MemEngine) DeleteReminder(r gregor.ReminderID) error
- func (m *MemEngine) InBandMessagesSince(u gregor.UID, d gregor.DeviceID, t time.Time) ([]gregor.InBandMessage, error)
- func (m *MemEngine) InitState(s gregor.State) error
- func (m *MemEngine) IsEphemeral() bool
- func (m *MemEngine) LatestCTime(u gregor.UID, d gregor.DeviceID) *time.Time
- func (m *MemEngine) ObjFactory() gregor.ObjFactory
- func (m *MemEngine) ReminderLockDuration() time.Duration
- func (m *MemEngine) Reminders(maxReminders int) (gregor.ReminderSet, error)
- func (m *MemEngine) State(u gregor.UID, d gregor.DeviceID, t gregor.TimeOrOffset) (gregor.State, error)
- func (m *MemEngine) StateByCategoryPrefix(u gregor.UID, d gregor.DeviceID, t gregor.TimeOrOffset, cp gregor.Category) (gregor.State, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterFutureDismissals ¶
func FilterFutureDismissals(msgs []gregor.InBandMessage, allmsgs map[string]gregor.InBandMessage, cutoff time.Time) []gregor.InBandMessage
Types ¶
type MemEngine ¶
MemEngine is an implementation of a gregor StateMachine that just keeps all incoming messages in a hash table, with one entry per user. It doesn't do anything fancy w/r/t indexing Items, so just iterates over all of them every time a dismissal or a state dump comes in. Used mainly for testing when SQLite isn't available.
func NewMemEngine ¶
func NewMemEngine(f gregor.ObjFactory, cl clockwork.Clock) *MemEngine
NewMemEngine makes a new MemEngine with the given object factory and the potentially fake clock (or a real clock if not testing).
func (*MemEngine) ConsumeMessage ¶
func (*MemEngine) DeleteReminder ¶
func (m *MemEngine) DeleteReminder(r gregor.ReminderID) error
func (*MemEngine) InBandMessagesSince ¶
func (*MemEngine) IsEphemeral ¶
func (*MemEngine) LatestCTime ¶
func (*MemEngine) ObjFactory ¶
func (m *MemEngine) ObjFactory() gregor.ObjFactory
func (*MemEngine) ReminderLockDuration ¶
func (*MemEngine) Reminders ¶
func (m *MemEngine) Reminders(maxReminders int) (gregor.ReminderSet, error)
Click to show internal directories.
Click to hide internal directories.