1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
type file_entry = { file_relto_cachedir : Fpath.t; contents_in : in_channel }
type dir_entry = { dir_relto_cachedir : Fpath.t }
module type S = sig
val cache_file :
category:string ->
key:string ->
cache_hit:
(file_for_upsert:Fpath.t ->
file_entry ->
([ `Upsert | `Keep ], [ `ErrorCaptured ]) result) ->
cache_miss:
(file_for_upsert:Fpath.t -> ([ `Upsert ], [ `ErrorCaptured ]) result) ->
unit ->
(Fpath.t, [ `ErrorCaptured ]) result
val cache_dir :
category:string ->
key:string ->
cache_hit:
(dir_for_upsert:Fpath.t ->
dir_entry ->
([ `Upsert | `Keep ], [ `ErrorCaptured ]) result) ->
cache_miss:
(dir_for_upsert:Fpath.t -> ([ `Upsert ], [ `ErrorCaptured ]) result) ->
unit ->
(Fpath.t, [ `ErrorCaptured ]) result
val cache_delete :
category:string -> key:string -> unit -> (unit, [ `ErrorCaptured ]) result
end