aboutsummaryrefslogtreecommitdiffstats
path: root/util/datamanager.lua
Commit message (Collapse)AuthorAgeFilesLines
* util.datamanager: Halve size of list indexKim Alvefur2021-05-141-11/+15
| | | | | Instead of storing (start, length) tuples, store the offset to the end of items and derive length using the previous entry.
* util.datamanager: Add O(1) list indexing with on-disk indexKim Alvefur2021-05-111-0/+191
| | | | | | | | | | | | Index file contains offsets and lengths of each item() which allows seeking directly to each item and reading it without parsing the entire file. Also allows tricks like binary search, assuming items have some defined order. We take advantage of the 1-based indexing in tables to store a magic header in the 0 position, so that table index 1 ends up at file index 1.
* util: Prefix module imports with prosody namespaceKim Alvefur2023-03-171-4/+4
|
* spelling: non-existing mistakes (thanks timeless)0.12.0Kim Alvefur2022-03-071-2/+2
|
* Spelling: Fix various spelling mistakes (thanks timeless)Kim Alvefur2022-03-071-2/+2
| | | | | | Words, sometimes I wonder how they even work Maybe I missed something.
* util.datamanager: Support iterating over any file extensionKim Alvefur2021-02-071-4/+3
| | | | | | | | The 'typ' argument to all other functions is the actual file extension, but not here for some reason. May need this for iterating over the .bin files created by mod_http_file_share in the future.
* util.datamanager: Fix not passing variables as format string to logger ↵Kim Alvefur2021-01-161-1/+1
| | | | | | | (thanks semgrep) Passing error messages as format string could lead to errors, although not a problem anymore since util.format sanitizes this.
* Merge 0.11->trunkKim Alvefur2020-02-241-1/+1
|\
| * util.datamanager: Fix iterating over "users" (thanks marc0s)Kim Alvefur2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | The 'store' path componend used to be unescaped until 756a2a00e7e7 added escaping to address issues with characters like '/' used in PEP, but with a special case for '_' which was already in common use in 'store' path components. Missed adding this escaping here.
* | util.datamanager: Ignore unused 'errno' variable [luacheck]Kim Alvefur2019-12-231-1/+2
| |
* | Fix various spelling mistakes [codespell]Kim Alvefur2019-05-031-1/+1
|/
* vairious: Add annotation when an empty environment is set [luacheck]Kim Alvefur2018-02-281-0/+1
|
* util.datamanager: Encode the 'store' path component, preserving underscoresKim Alvefur2017-10-081-1/+8
|
* util.datamanager: Use already known index instead of measuring length each ↵Kim Alvefur2017-04-171-2/+2
| | | | iteration
* util.datamanager: Log where the error came fromKim Alvefur2017-03-281-3/+4
|
* util.datamanager: Rearrange localsKim Alvefur2017-03-281-3/+2
|
* util.datamanager: Use pposix.atomic_appendKim Alvefur2017-02-281-23/+17
|
* util.datamanager: Remove check for file non-existence since ENOENT tells us ↵Kim Alvefur2017-03-221-18/+4
| | | | that already
* util.datamanager: Split long line [luacheck]Kim Alvefur2017-03-221-1/+3
|
* util.datamanager: Expose atomic_store as store_rawKim Alvefur2017-03-011-0/+1
|
* util.datamanager: Use atomic store function when writing the first entry of ↵Kim Alvefur2017-03-011-4/+1
| | | | a list
* util.datamanager: Import value of ENOENT from util.pposix (if available)Kim Alvefur2017-03-011-0/+1
|
* util.datamanager: Ignore ENOENT (no such file) when loading dataKim Alvefur2017-03-011-4/+13
|
* util.datamanager: Shorter patternKim Alvefur2016-11-201-1/+1
|
* util.datamanager: Remove extraneous decoding of + to space, which we never ↵Kim Alvefur2016-11-201-1/+1
| | | | never encode to
* util.datamanager: Use the 'base' argument to tonumber() to indicate hexadecimalKim Alvefur2016-11-201-1/+1
|
* util.datamanager: Add annotations to ignore name clashes [luacheck]Kim Alvefur2016-09-241-5/+5
|
* util.datamanager: Rename variables to avoid name clashes [luacheck]Kim Alvefur2016-09-241-12/+12
|
* util.datamanager: Import tostring and type (fix global access)Kim Alvefur2016-05-221-0/+2
|
* util.datamanager: Explicit handling of each error condition (see #632)Kim Alvefur2016-02-271-14/+16
|
* Merge 0.9->0.10Kim Alvefur2016-02-251-0/+1
|\
| * util.datamanager: Unreference file handle after closing it to prevent trying ↵Kim Alvefur2016-02-251-0/+1
| | | | | | | | to close it again (fixes #632)
* | util.datamanager: Add append to public apiKim Alvefur2015-12-111-0/+1
| |
* | util.datamanager: Return extra location infoKim Alvefur2015-12-111-3/+3
| |
* | util.datamanager: Make sure only strings are passed as data to append()Kim Alvefur2015-12-111-0/+1
| |
* | util.datamanager: Add some comments about the append functionKim Alvefur2015-12-111-0/+3
| |
* | util.datamanager: Handle potential error from :write() callKim Alvefur2015-12-111-3/+3
| |
* | util.datamanager: Handle potential issues from fallocateKim Alvefur2015-12-111-1/+10
| |
* | util.datamanager: No shadowing of variable [luacheck]Kim Alvefur2015-12-111-1/+3
| |
* | util.datamanager: Skip past second check if first attemtp to open file succeedsKim Alvefur2015-12-111-3/+3
| |
* | util.datamanager: In append() collect status when closing file handle as it ↵Kim Alvefur2015-12-111-3/+9
| | | | | | | | may fail (eg the implied flush)
* | util.datamanager: Overwrite 'data' variable instead of shadownig it [luacheck]Kim Alvefur2015-12-111-1/+1
| |
* | util.datamanager: Factor out code for appending bytes to a fileKim Alvefur2015-12-111-10/+18
| |
* | util.*: Remove use of module() function, make all module functions local and ↵Kim Alvefur2015-02-211-16/+29
|/ | | | return them in a table at the end
* util.datamanager: Fix traceback from trying to purge when storage is empty ↵Kim Alvefur2015-05-131-1/+5
| | | | or otherwise unaccessible (fixes #496)
* util.datamanager: Fix traceback due to %s in log messageKim Alvefur2015-04-031-1/+1
|
* util.datamanager: Check that the global 'prosody' exists before using it ↵Kim Alvefur2015-02-201-1/+1
| | | | (fixes nil indexing in use outside of prosody)
* util.datamanager: Clear the cache of created directories on storage failure, ↵Matthew Wild2013-04-071-11/+19
| | | | and retry
* util.datamanager: expose path decode and encode functions.Marco Cirillo2013-04-071-0/+2
|
* util.datamanager: Don't escape the name of a storeKim Alvefur2012-12-161-1/+1
|