nim-datastore/datastore/datastore.nim
Michael Bradley, Jr 0c5d805257
refactor base API to be async
and refactor Datastore impls and tests accordingly

Closes #7
2022-07-04 22:28:41 -05:00

45 lines
898 B
Nim

import pkg/chronos
import pkg/questionable
import pkg/questionable/results
import pkg/upraises
import ./key
export key
push: {.upraises: [].}
type
Datastore* = ref object of RootObj
method contains*(
self: Datastore,
key: Key): Future[?!bool] {.async, base, locks: "unknown".} =
raiseAssert("Not implemented!")
method delete*(
self: Datastore,
key: Key): Future[?!void] {.async, base, locks: "unknown".} =
raiseAssert("Not implemented!")
method get*(
self: Datastore,
key: Key): Future[?!(?seq[byte])] {.async, base, locks: "unknown".} =
raiseAssert("Not implemented!")
method put*(
self: Datastore,
key: Key,
data: seq[byte]): Future[?!void] {.async, base, locks: "unknown".} =
raiseAssert("Not implemented!")
# method query*(
# self: Datastore,
# query: ...): Future[?!(?...)] {.async, base, locks: "unknown".} =
#
# raiseAssert("Not implemented!")