123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144(*
* Copyright (c) 2018-2022 Tarides <contact@tarides.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)typelength_header=[`Varint]optiontypeinode_child_order=[`Seeded_hash|`Hash_bits|`Customofdepth:int->bytes->int]moduletypeS=sigvalentries:intvalstable_hash:intvalcontents_length_header:length_headervalinode_child_order:inode_child_ordervalforbid_empty_dir_persistence:boolendmoduleDefault=structletfresh=falseletlru_size=100_000letlru_max_memory=Noneletindex_log_size=2_500_000letreadonly=falseletmerge_throttle=`Block_writesletindexing_strategy=Indexing_strategy.defaultletuse_fsync=falseletno_migrate=falseletlower_root=NoneendopenIrmin.Backend.Confletspec=Spec.v"pack"typemerge_throttle=[`Block_writes|`Overcommit_memory][@@derivingirmin]moduleKey=structletfresh=key~spec~doc:"Start with a fresh disk.""fresh"Irmin.Type.boolDefault.freshletlru_size=key~spec~doc:"Maximum size of the LRU cache for pack entries.""lru-size"Irmin.Type.intDefault.lru_sizeletlru_max_memory=key~spec~doc:"Maximum memory in bytes of the LRU cache for pack entries.""lru-max-memory"Irmin.Type.(optionint)Default.lru_max_memoryletindex_log_size=key~spec~doc:"Size of index logs.""index-log-size"Irmin.Type.intDefault.index_log_sizeletreadonly=key~spec~doc:"Start with a read-only disk.""readonly"Irmin.Type.boolDefault.readonlyletmerge_throttle=key~spec~doc:"Strategy to use for large writes when index caches are full.""merge-throttle"merge_throttle_tDefault.merge_throttleletroot=rootspecletlower_root=key~spec~doc:"Optional path for lower layer directory.""lower-root"Irmin.Type.(optionstring)Default.lower_rootletindexing_strategy=letserialisable_t=[%typ:[`Always|`Minimal]]inkey~spec~doc:"Strategy to use for adding objects to the index""indexing-strategy"(Irmin.Type.mapserialisable_t(function|`Always->Indexing_strategy.always|`Minimal->Indexing_strategy.minimal)(fun_->Fmt.failwith"Can't serialise indexing strategy"))Default.indexing_strategyletuse_fsync=key~spec~doc:"Whether fsync should be used to ensure persistence order of files""use-fsync"Irmin.Type.boolDefault.use_fsyncletno_migrate=key~spec~doc:"Prevent migration of V1 and V2 stores""no-migrate"Irmin.Type.boolDefault.no_migrateendletfreshconfig=getconfigKey.freshletlru_sizeconfig=getconfigKey.lru_sizeletlru_max_memoryconfig=getconfigKey.lru_max_memoryletreadonlyconfig=getconfigKey.readonlyletindex_log_sizeconfig=getconfigKey.index_log_sizeletmerge_throttleconfig=getconfigKey.merge_throttleletrootconfig=matchfind_rootconfigwith|None->failwith"unintialised root, call [Irmin_pack.Conf.init root] before opening \
the store"|Someroot->rootletlower_rootconfig=getconfigKey.lower_rootletindexing_strategyconfig=getconfigKey.indexing_strategyletuse_fsyncconfig=getconfigKey.use_fsyncletno_migrateconfig=getconfigKey.no_migrateletinit?(fresh=Default.fresh)?(readonly=Default.readonly)?(lru_size=Default.lru_size)?(lru_max_memory=Default.lru_max_memory)?(index_log_size=Default.index_log_size)?(merge_throttle=Default.merge_throttle)?(indexing_strategy=Default.indexing_strategy)?(use_fsync=Default.use_fsync)?(no_migrate=Default.no_migrate)?(lower_root=Default.lower_root)root=letconfig=emptyspecinletconfig=addconfigKey.rootrootinletconfig=addconfigKey.lower_rootlower_rootinletconfig=addconfigKey.freshfreshinletconfig=addconfigKey.lru_sizelru_sizeinletconfig=addconfigKey.lru_max_memorylru_max_memoryinletconfig=addconfigKey.index_log_sizeindex_log_sizeinletconfig=addconfigKey.readonlyreadonlyinletconfig=addconfigKey.merge_throttlemerge_throttleinletconfig=addconfigKey.indexing_strategyindexing_strategyinletconfig=addconfigKey.use_fsyncuse_fsyncinletconfig=addconfigKey.no_migrateno_migrateinverifyconfig