mock cache-service oplog truncation functionality
This commit is contained in:
@@ -10,6 +10,16 @@ func NewStore() *Store {
|
||||
return &store
|
||||
}
|
||||
|
||||
// todo pass context.context and failfast
|
||||
func (store *Store) Dump() []Event {
|
||||
result := make([]Event, 0)
|
||||
(*sync.Map)(store).Range(func(_, v any) bool {
|
||||
result = append(result, v.(Event))
|
||||
return true
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
func (store *Store) Push(op Event) {
|
||||
k := op.ID
|
||||
event, ok := store.Get(k)
|
||||
|
||||
Reference in New Issue
Block a user