logarion/lib/store.ml

17 lines
698 B
OCaml
Raw Normal View History

module KV = Map.Make (String)
module type T = sig
type t
type item_t
type archive_t = { id: Id.t; name: string; archivists: Person.Set.t; kv: string KV.t; store: t }
type record_t = Text.t * item_t
val of_path: string -> (archive_t, string) result
val newest: record_t -> record_t -> int
val oldest: record_t -> record_t -> int
val with_text: archive_t -> Text.t -> (string * Text.t, string) result
val iter: ?predicate:(Text.t -> bool) -> ?order:(record_t -> record_t -> int) -> ?number:int
-> (record_t -> unit) -> archive_t -> unit
val fold: ?predicate:(Text.t -> bool) -> ?order:(record_t -> record_t -> int) -> ?number:int
-> ('a -> record_t -> 'a) -> 'a -> archive_t -> 'a
end