Module B00_ui.File_cache

B000.File_cache interaction.

High-level commands.

These commands act on a cache directory. They avoid to create it via B00.File_cache.create if it doesn't exists and mostly return Ok () in these cases.

val delete : dir:B0_std.Fpath.t -> [ `All | `Keys of B000.File_cache.key list ] -> (unit, string) Stdlib.result

delete dir keys deletes keys in dirs if an explicit key does not exist in dir a Log.warn is issued. If `All is specified dir is deleted and recreated.

val gc : dir:B0_std.Fpath.t -> (unit, string) Stdlib.result

gc dir deletes unused keys via B00.File_cache.delete_unused.

val size : dir:B0_std.Fpath.t -> (unit, string) Stdlib.result

size dir shows statistics about the file cache on stdout via B00.File_cache.Stats.pp.

val trim : dir:B0_std.Fpath.t -> max_byte_size:int -> pct:int -> (unit, string) Stdlib.result

trim dir ~max_byte_size ~pct trims the cache using B00.File_cache.trim_size.

Cli fragments

val key_arg : B000.File_cache.key Cmdliner.Arg.conv

key_arg is an argument converter for cache keys.

val keys_none_is_all : ?⁠pos_right:int -> unit -> [ `All | `Keys of B000.File_cache.key list ] Cmdliner.Term.t

keys_none_is_all ~pos_right () are the keys at the right of position pos_right (defaults is all positional arguments). If none is specified this is `All.