-- Generated by scripts/generate.mjs. Do not edit. module Dagger.EngineCache ( entrySet , entrySetWith , EntrySetOpts , defaultEntrySetOpts , id , maxUsedSpace , minFreeSpace , prune , pruneWith , PruneOpts , defaultPruneOpts , reservedSpace , targetSpace ) where import Data.Maybe (Maybe(..)) import Effect.Aff (Aff) import Dagger.Internal.Runtime as R import Dagger.Types as T type EntrySetOpts = { key :: Maybe String } defaultEntrySetOpts :: EntrySetOpts defaultEntrySetOpts = { key: Nothing } -- | The current set of entries in the cache entrySet :: T.EngineCache -> T.EngineCacheEntrySet entrySet = entrySetWith defaultEntrySetOpts -- | The current set of entries in the cache entrySetWith :: EntrySetOpts -> T.EngineCache -> T.EngineCacheEntrySet entrySetWith opts = R.select "entrySet" [R.optional (R.argument "key" "String") opts.key] -- | A unique identifier for this EngineCache. id :: T.EngineCache -> Aff T.ID id = R.scalar "id" [] -- | The maximum bytes to keep in the cache without pruning. maxUsedSpace :: T.EngineCache -> Aff Int maxUsedSpace = R.scalar "maxUsedSpace" [] -- | The target amount of free disk space the garbage collector will attempt to leave. minFreeSpace :: T.EngineCache -> Aff Int minFreeSpace = R.scalar "minFreeSpace" [] type PruneOpts = { useDefaultPolicy :: Maybe Boolean , maxUsedSpace :: Maybe String , reservedSpace :: Maybe String , minFreeSpace :: Maybe String , targetSpace :: Maybe String , maxEstimatedBytes :: Maybe Int , targetEstimatedBytes :: Maybe Int } defaultPruneOpts :: PruneOpts defaultPruneOpts = { useDefaultPolicy: Nothing , maxUsedSpace: Nothing , reservedSpace: Nothing , minFreeSpace: Nothing , targetSpace: Nothing , maxEstimatedBytes: Nothing , targetEstimatedBytes: Nothing } -- | Prune the cache of releaseable entries prune :: T.EngineCache -> Aff (Maybe T.Void) prune = pruneWith defaultPruneOpts -- | Prune the cache of releaseable entries pruneWith :: PruneOpts -> T.EngineCache -> Aff (Maybe T.Void) pruneWith opts = R.scalar "prune" [R.optional (R.argument "useDefaultPolicy" "Boolean") opts.useDefaultPolicy, R.optional (R.argument "maxUsedSpace" "String") opts.maxUsedSpace, R.optional (R.argument "reservedSpace" "String") opts.reservedSpace, R.optional (R.argument "minFreeSpace" "String") opts.minFreeSpace, R.optional (R.argument "targetSpace" "String") opts.targetSpace, R.optional (R.argument "maxEstimatedBytes" "Int") opts.maxEstimatedBytes, R.optional (R.argument "targetEstimatedBytes" "Int") opts.targetEstimatedBytes] -- | The minimum amount of disk space this policy is guaranteed to retain. reservedSpace :: T.EngineCache -> Aff Int reservedSpace = R.scalar "reservedSpace" [] -- | The target number of bytes to keep when pruning. targetSpace :: T.EngineCache -> Aff Int targetSpace = R.scalar "targetSpace" []