;dev: journalTransform notes

This commit is contained in:
Simon Michael 2025-09-11 09:58:02 +01:00
parent a4692a4a38
commit 2c18614e7b
2 changed files with 4 additions and 2 deletions

View File

@ -218,8 +218,8 @@ journalFilePathFromOptsOrDefault defaultJournalOverride cliopts = do
Nothing -> return defaultFiles -- use the journal(s) given to the "run" itself Nothing -> return defaultFiles -- use the journal(s) given to the "run" itself
Just journalpaths -> return journalpaths Just journalpaths -> return journalpaths
-- | Similar to `withJournal`, but uses caches all the journals it reads. -- | Similar to `withJournal`, but caches all the journals it reads.
-- When reading from stdin, caches the stdin contents so that we could reprocess -- When reading from stdin, also caches the stdin contents so that we could reprocess
-- it if a read with different InputOptions is requested. -- it if a read with different InputOptions is requested.
withJournalCached :: Maybe DefaultRunJournal -> CliOpts -> ((Journal, DefaultRunJournal) -> IO ()) -> IO () withJournalCached :: Maybe DefaultRunJournal -> CliOpts -> ((Journal, DefaultRunJournal) -> IO ()) -> IO ()
withJournalCached defaultJournalOverride cliopts cmd = do withJournalCached defaultJournalOverride cliopts cmd = do

View File

@ -89,6 +89,8 @@ journalTransform opts =
pivotByOpts opts pivotByOpts opts
<&> anonymiseByOpts opts <&> anonymiseByOpts opts
<&> maybeObfuscate opts <&> maybeObfuscate opts
-- XXX Called by withJournalDo, journalReload, uiReloadJournal, withJournalCached.
-- Could it be moved down into journalFinalise ? These steps only depend on InputOpts.
-- | Apply the pivot transformation on a journal (replacing account names by a different field's value), if option is present. -- | Apply the pivot transformation on a journal (replacing account names by a different field's value), if option is present.
pivotByOpts :: CliOpts -> Journal -> Journal pivotByOpts :: CliOpts -> Journal -> Journal