mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-05 23:43:07 +00:00
* enables pagination based on sender timestamp * uncomments a test * bumps up version number * updates migration script * clean up * unpdates changelog * undo removal of receiver timestamp * updates message_storage * uses epochTime() * minor * removes a comment * removes receiver timestamp deletion migration script * fixes formatting issues * fixes a bad field name * fixes field issue * adjusts spacing
21 lines
730 B
Nim
21 lines
730 B
Nim
import
|
|
stew/results,
|
|
../../../protocol/waku_message,
|
|
../../../utils/pagination
|
|
|
|
## This module defines a message store interface. Implementations of
|
|
## MessageStore are used by the `WakuStore` protocol to store and
|
|
## retrieve historical messages
|
|
|
|
type
|
|
DataProc* = proc(receiverTimestamp: float64, msg: WakuMessage, pubsubTopic: string) {.closure.}
|
|
|
|
MessageStoreResult*[T] = Result[T, string]
|
|
|
|
MessageStore* = ref object of RootObj
|
|
|
|
# MessageStore interface
|
|
method put*(db: MessageStore, cursor: Index, message: WakuMessage, pubsubTopic: string): MessageStoreResult[void] {.base.} = discard
|
|
method getAll*(db: MessageStore, onData: DataProc): MessageStoreResult[bool] {.base, raises: [Defect, Exception].} = discard
|
|
|