Compare commits

...

110 Commits

Author SHA1 Message Date
4e418c8969 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 13:41:53 -05:00
d664c6a884 fix winfsp rename
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 13:20:00 -05:00
430fc1a651 fix test 2025-04-17 11:26:12 -05:00
314ee5b664 enable all winfsp tests 2025-04-17 11:07:02 -05:00
9eb8b5e682 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 09:59:02 -05:00
bd386314a4 cleanup
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-17 09:38:49 -05:00
aee2413440 cleanup 2025-04-17 09:38:25 -05:00
307fcb3332 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations #48
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-17 09:28:32 -05:00
28fefca765 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations #48
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-17 09:21:28 -05:00
3e09adaba3 debug
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 08:35:26 -05:00
e01ed2c1b8 cleanup 2025-04-17 08:25:30 -05:00
ece42df528 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations #48
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-17 08:24:34 -05:00
45080aa32f debug
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 08:05:44 -05:00
fb9c8c8bb6 debug
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-17 07:54:19 -05:00
7a3ce13db0 debug
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-17 07:53:42 -05:00
6945a16f78 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-16 14:36:12 -05:00
1153598c62 fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-16 14:22:48 -05:00
2afa403c8c [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-16 14:19:39 -05:00
d09210d9c4 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47 2025-04-16 13:31:57 -05:00
2ca2002423 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-16 13:13:08 -05:00
011d32f9cf [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-16 11:22:03 -05:00
7487caca2a debug logging
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-16 11:07:23 -05:00
f921295dbd [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-16 10:56:10 -05:00
13b2ee6f7a [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-16 10:35:16 -05:00
144baf4371 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-16 09:42:17 -05:00
c6ade2e5f7 fix 2025-04-16 09:40:58 -05:00
fb89cc08ae fix
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-16 09:27:04 -05:00
f08870b03c fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-16 09:22:59 -05:00
711e3f73cf [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-16 09:18:40 -05:00
ebb620fdb2 debug
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-16 08:57:16 -05:00
fbf9c85d48 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-15 15:02:46 -05:00
d5e0252ed3 continue v2 error implementations
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-15 15:01:25 -05:00
06b79ffd2d fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-15 14:53:58 -05:00
690902b31d fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-15 14:48:40 -05:00
0bfe1e1ccd enable v2 errors
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-15 14:27:58 -05:00
a8723a6b02 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-15 14:05:14 -05:00
1d88d26d0a fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-15 14:04:26 -05:00
757c880616 debug logs
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-15 13:59:03 -05:00
d65bd6af35 refactor unit tests
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-15 10:29:19 -05:00
b285478cc5 refactor unit tests 2025-04-15 10:20:19 -05:00
31cd5acaee refactor 2025-04-15 09:45:36 -05:00
65036f2957 fix test 2025-04-15 09:43:41 -05:00
2362300bba [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-15 09:35:08 -05:00
f61f3d5fa4 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-15 09:27:33 -05:00
a2b8998f4a [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47 2025-04-15 09:27:00 -05:00
a4d53c1011 cleanup
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-14 12:30:49 -05:00
4b925c15c2 [bug] Changes to maximum cache size should be updated live #46
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-13 19:19:52 -05:00
bbd82e3f0f updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-13 12:25:41 -05:00
37f2cbc78d refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-11 22:02:05 -05:00
1ad3704fa0 refactor
Some checks are pending
BlockStorage/repertory/pipeline/head Build started...
2025-04-11 20:58:16 -05:00
a6e70d93cb cleanup 2025-04-11 20:56:41 -05:00
967324a368 updated build system dependencies 2025-04-11 20:49:42 -05:00
69b31bfde8 updated build system dependencies 2025-04-11 20:32:50 -05:00
8b4724a9c1 Merge branch 'v2.0.6-release-develop' of ssh://git.fifthgrid.com:3022/blockstorage/repertory into v2.0.6-release-develop
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 22:26:51 -05:00
6a0d50bc66 fix 2025-04-04 22:26:32 -05:00
69910bef4c fix test
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 22:10:30 -05:00
8c298c84c5 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 22:06:00 -05:00
47dea2cc38 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 21:47:42 -05:00
d8b476e80a fix test
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 21:34:24 -05:00
c86c6e2ec6 fix test
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-04 21:31:11 -05:00
c397497eb7 fix test
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 21:21:17 -05:00
f8803dfbf0 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 20:13:48 -05:00
5d5cacc482 [bug] Windows-to-Linux remote mount is not handling attempts to remove a non-empty directory properly 2025-04-04 20:07:07 -05:00
3ce4210d56 [bug] Windows-to-Linux remote mount is not handling attempts to remove a non-empty directory propery #45 2025-04-04 20:06:33 -05:00
d109344544 [bug] Windows-to-Linux remote mount ignores CREATE_NEW #44
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 17:35:00 -05:00
ff746a7bec [bug] Windows-to-Linux remote mount ignores CREATE_NEW #44 2025-04-04 17:33:51 -05:00
a613ec77ff debugging
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 13:23:45 -05:00
00d3dd95a8 update 2025-04-04 13:22:45 -05:00
28d1789f04 debugging
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-04 13:21:07 -05:00
0603463885 [bug] Windows-to-Linux remote mount ignores CREATE_NEW #44
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 13:05:02 -05:00
88398485e1 fix log
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 12:42:08 -05:00
908e75c696 debugging
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 12:37:33 -05:00
dab8c61f87 debugging
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-04 12:36:02 -05:00
e0cf58b01e debugging 2025-04-04 12:24:17 -05:00
281d3758e0 [bug] Windows-to-Linux remote mount ignores CREATE_NEW #44
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-04 10:55:01 -05:00
dfa170022a refactor
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-04 10:05:17 -05:00
52c2780283 [bug] Windows-to-Linux remote mount ignores CREATE_NEW #44 2025-04-04 10:02:37 -05:00
c2dbfc970a refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 21:18:37 -05:00
6f9b1f8f08 fix marker 2025-04-03 21:17:44 -05:00
078d603be9 refactor 2025-04-03 21:15:08 -05:00
983e47103b refactor
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-03 21:02:49 -05:00
8d2024d34b refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 19:34:42 -05:00
4f2ee2ad99 [bug] Directories are not importing properly for Sia #43 2025-04-03 19:27:46 -05:00
533938bcef [bug] Directories are not importing properly for Sia #43 2025-04-03 19:26:42 -05:00
98edf33be4 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 17:23:11 -05:00
a080c9ff86 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 17:20:03 -05:00
e6cdcd74a1 [bug] Directories are not importing properly for Sia #43
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 14:26:22 -05:00
573ae549be updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 13:01:48 -05:00
fca149f998 removed debugging 2025-04-03 12:57:40 -05:00
76e375c488 debugging
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 11:59:28 -05:00
3f9322f659 debugging
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 11:48:22 -05:00
c286d496c3 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-03 11:16:03 -05:00
56ba0fcb83 debugging
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-03 11:08:48 -05:00
dcafb104ea [Unit Test] Complete WinFSP unit tests #21
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
initial support for winfsp to linux remote testing
initial support for linx to winfsp remote testing
2025-04-02 14:18:35 -05:00
ab757dfd36 [Unit Test] Complete WinFSP unit tests #21
initial support for winfsp to linux remote testing
2025-04-02 14:11:37 -05:00
eec2d2e9a9 fix and refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-02 14:05:10 -05:00
8c1c91e02b fix
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-02 13:58:29 -05:00
bb85015733 [bug] Remote mount directory listing on Windows connected to Linux is failing #42
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-02 13:40:15 -05:00
883de836c6 fix missing function name
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-02 11:09:05 -05:00
bf2bdd1b5d [bug] Remote mount directory listing on Windows connected to Linux is failing #42
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-02 10:41:05 -05:00
f1e82d8f9f [bug] Remote mount directory listing on Windows connected to Linux is failing #42
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-02 10:21:29 -05:00
f5c4aebdac fix json names 2025-04-02 10:17:23 -05:00
f2f9e8fd15 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-03-27 10:01:18 -05:00
2a673915af updated CHANGELOG.md 2025-03-27 10:00:06 -05:00
df3db38ae7 letters should be lowercase 2025-03-27 09:58:11 -05:00
b0b69c6dd4 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-03-26 14:33:34 -05:00
11b118a30f updated version 2025-03-26 07:11:35 -05:00
62555e6125 v2.0.5-rc (#41)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
Reviewed-on: #41
2025-03-26 07:02:38 -05:00
24418ba03d v2.0.4-rc (#37)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
# Changelog

## v2.0.4-rc

### BREAKING CHANGES

* `renterd` v2.0.0+ is now required. Prior versions will fail to mount.

### Issues

* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
* \#36 [bug] Max cache size bytes is set to '0' by default

### Changes from v2.0.3-rc

* Added Sia API version check prior to mounting
* Added back `-cv` (check version) CLI option
* Continue documentation updates
* Fixed setting `ApiAuth` via `set_value_by_name`
* Fixed setting `HostConfig.ApiUser` via `set_value_by_name`
* Fixed setting `HostConfig.Path` via `set_value_by_name`
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
* Improved ring buffer read-ahead
* Integrated `renterd` version 2.0.0
* Prefer using local cache file when opening files
* Refactored `app_config` unit tests
* Refactored polling to be more accurate on scheduling tasks

Reviewed-on: #37
2025-02-22 09:48:00 -06:00
fa439c634f v2.0.3-rc (#32)
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
# Changelog

## v2.0.3-rc

### Issues

* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
* \#29 \[bug\] S3 error responses are not being logged
* \#30 \[bug\] Sia provider error responses are not logged
* \#31 \[bug\] S3 provider should limit max key size to 1024

### Changes from v2.0.2-rc

* Always use direct for read-only providers
* Fixed externally removed files not being processed during cleanup
* Fixed http headers not being added for requests
* Fixed incorrect `stat` values for remote mounts
* Fixed invalid directory nullptr error on remote mounts
* Fixed memory leak in event system
* Refactored application shutdown
* Refactored event system
* Updated build system to Alpine 3.21.0
* Updated build system to MinGW-w64 12.0.0
* Updated copyright to 2018-2025

Reviewed-on: #32
2025-02-11 17:26:24 -06:00
487 changed files with 19517 additions and 6629 deletions

View File

@ -3,6 +3,7 @@ _mkgmtime
_sh_denyno _sh_denyno
_sh_denyrd _sh_denyrd
_sh_denyrw _sh_denyrw
_spawnv
aarch64 aarch64
advapi32 advapi32
armv8 armv8
@ -26,6 +27,7 @@ cppvsdbg
create_notraverse create_notraverse
crypto_aead_xchacha20poly1305_ietf_npubbytes crypto_aead_xchacha20poly1305_ietf_npubbytes
cstdint cstdint
curlopt_aws_sigv4
cxxflags cxxflags
cxxstd cxxstd
d_largefile64_source d_largefile64_source
@ -113,6 +115,7 @@ googletest
gpath gpath
gtest_version gtest_version
has_setxattr has_setxattr
hkey
httpapi httpapi
httplib httplib
icudata icudata
@ -120,6 +123,7 @@ icui18n
icuuc icuuc
iostreams iostreams
iphlpapi iphlpapi
ipstream
jthread jthread
libbitcoin libbitcoin
libbitcoinsystem libbitcoinsystem
@ -127,6 +131,7 @@ libcurl
libdsm libdsm
libevent libevent
libexample libexample
libexpat
libfuse3 libfuse3
libgmock libgmock
libgtest libgtest
@ -139,10 +144,13 @@ libuuid
libuuid_include_dirs libuuid_include_dirs
libvlc libvlc
linkflags linkflags
localappdata
lpbyte
lptr lptr
lpwstr lpwstr
markdownlint markdownlint
mbig mbig
minio
msvc msvc
msvcr120 msvcr120
msys2 msys2
@ -150,14 +158,18 @@ mtune
musl-libc musl-libc
nana nana
ncrypt ncrypt
nlohmann
nlohmann_json nlohmann_json
nmakeprg nmakeprg
nohup
nominmax nominmax
ntstatus ntstatus
nullptr
nuspell_version nuspell_version
oleaut32 oleaut32
openal_version openal_version
openssldir openssldir
pistream
pkgconfig pkgconfig
plarge_integer plarge_integer
plex plex
@ -187,6 +199,7 @@ secp256k1
secur32 secur32
sfml_project sfml_project
shlwapi shlwapi
skynet
source_subdir source_subdir
spdlog spdlog
spdlog_project spdlog_project
@ -198,6 +211,7 @@ stduuid_project
strequal strequal
ularge_integer ularge_integer
uring uring
url
userenv userenv
utimens_impl utimens_impl
utimensat utimensat

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
*.tgz filter=lfs diff=lfs merge=lfs -text
*.tar.gz filter=lfs diff=lfs merge=lfs -text
*.tar.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

View File

@ -1,36 +0,0 @@
{
"configurations": {
"UnixDebug": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/repertory",
"args": ["-f", "/home/sgraves/mnt"],
"cwd": "${workspaceRoot}/build/debug",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
}
}
},
"UnixDebugTest": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/unittests",
"args": ["--gtest_filter=file_manager.can_close_after_download_timeout"],
"cwd": "${workspaceRoot}/build",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
}
}
}
}
}

View File

@ -1,14 +1,105 @@
# Changelog # Changelog
## v2.0.6-release
### Issues
* ~~\#12 [Unit Test] Complete all providers unit tests~~
* ~~\#21 [Unit Test] Complete WinFSP unit tests~~
* ~~\#22 [Unit Test] Complete FUSE unit tests~~
* ~~\#33 Complete initial v2.0 documentation~~
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
* \#43 [bug] Directories are not importing properly for Sia
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
* \#45 [bug] Windows-to-Linux remote mount is not handling attempts to remove a non-empty directory properly
* \#46 [bug] Changes to maximum cache size should be updated live
* \#47 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty
* \#48 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations
### Changes from v2.0.5-rc
* Drive letters in UI should always be lowercase
* Fixed WinFSP directory rename for non-empty directories
* Migrated to v2 error handling
## v2.0.5-rc
<!-- markdownlint-disable-next-line -->
### Issues
* \#39 Create management portal in Flutter
### Changes from v2.0.4-rc
* Continue documentation updates
* Fixed `-status` command erasing active mount information
* Fixed overlapping HTTP REST API port's
* Refactored/fixed instance locking
* Removed passwords and secret key values from API calls
* Renamed setting `ApiAuth` to `ApiPassword`
* Require `--name,-na` option for encryption provider
## v2.0.4-rc
### BREAKING CHANGES
* `renterd` v2.0.0+ is now required. Prior versions will fail to mount.
<!-- markdownlint-disable-next-line -->
### Issues
* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
* \#36 [bug] Max cache size bytes is set to '0' by default
### Changes from v2.0.3-rc
* Added Sia API version check prior to mounting
* Added back `-cv` (check version) CLI option
* Continue documentation updates
* Fixed setting `ApiAuth` via `set_value_by_name`
* Fixed setting `HostConfig.ApiUser` via `set_value_by_name`
* Fixed setting `HostConfig.Path` via `set_value_by_name`
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
* Improved ring buffer read-ahead
* Integrated `renterd` version 2.0.0
* Prefer using local cache file when opening files
* Refactored `app_config` unit tests
* Refactored polling to be more accurate on scheduling tasks
## v2.0.3-rc
<!-- markdownlint-disable-next-line -->
### Issues
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
* \#29 \[bug\] S3 error responses are not being logged
* \#30 \[bug\] Sia provider error responses are not logged
* \#31 \[bug\] S3 provider should limit max key size to 1024
### Changes from v2.0.2-rc
* Always use direct for read-only providers
* Fixed externally removed files not being processed during cleanup
* Fixed http headers not being added for requests
* Fixed incorrect `stat` values for remote mounts
* Fixed invalid directory nullptr error on remote mounts
* Fixed memory leak in event system
* Refactored application shutdown
* Refactored event system
* Updated build system to Alpine 3.21.0
* Updated build system to MinGW-w64 12.0.0
* Updated copyright to 2018-2025
## v2.0.2-rc ## v2.0.2-rc
<!-- markdownlint-disable-next-line -->
### BREAKING CHANGES ### BREAKING CHANGES
* Refactored `config.json` - will need to verify configuration settings prior to mounting * Refactored `config.json` - will need to verify configuration settings prior to mounting
<!-- markdownlint-disable-next-line -->
### Issues ### Issues
* \#12 \[Unit Test\] Complete all providers unit tests
* \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup * \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup
* \#16 Add support for bucket name in Sia provider * \#16 Add support for bucket name in Sia provider
* \#17 Update to common c++ build system * \#17 Update to common c++ build system

View File

@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.27)
cmake_policy(SET CMP0135 NEW) cmake_policy(SET CMP0135 NEW)
cmake_policy(SET CMP0144 NEW) cmake_policy(SET CMP0144 NEW)
if (NOT PROJECT_INTERFACE)
message(FATAL_ERROR "Project must be compiled via 'make_win32.cmd'/'make_win32.sh' or 'make_unix.sh' build scripts. Invoking 'cmake' directly is not supported.")
endif()
project(${PROJECT_NAME} project(${PROJECT_NAME}
DESCRIPTION ${PROJECT_DESC} DESCRIPTION ${PROJECT_DESC}
HOMEPAGE_URL ${PROJECT_URL} HOMEPAGE_URL ${PROJECT_URL}
@ -54,6 +58,10 @@ if(PROJECT_IS_MINGW)
endif() endif()
endif() endif()
if (PROJECT_ENABLE_V2_ERRORS)
add_definitions(-DPROJECT_ENABLE_V2_ERRORS)
endif()
include(cmake/settings.cmake) include(cmake/settings.cmake)
include(cmake/flags.cmake) include(cmake/flags.cmake)
@ -139,6 +147,7 @@ endif()
-DPROJECT_COPYRIGHT=${PROJECT_COPYRIGHT} -DPROJECT_COPYRIGHT=${PROJECT_COPYRIGHT}
-DPROJECT_DESC=${PROJECT_DESC} -DPROJECT_DESC=${PROJECT_DESC}
-DPROJECT_DIST_DIR=${PROJECT_DIST_DIR} -DPROJECT_DIST_DIR=${PROJECT_DIST_DIR}
-DPROJECT_ENABLE_V2_ERRORS=${PROJECT_ENABLE_V2_ERRORS}
-DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES=${PROJECT_ENABLE_WIN32_LONG_PATH_NAMES} -DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES=${PROJECT_ENABLE_WIN32_LONG_PATH_NAMES}
-DPROJECT_ENABLE_BOOST=${PROJECT_ENABLE_BOOST} -DPROJECT_ENABLE_BOOST=${PROJECT_ENABLE_BOOST}
-DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB} -DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB}
@ -158,6 +167,7 @@ endif()
-DPROJECT_FUSE=${PROJECT_FUSE} -DPROJECT_FUSE=${PROJECT_FUSE}
-DPROJECT_FUSE_INCLUDE_DIRS=${PROJECT_FUSE_INCLUDE_DIRS} -DPROJECT_FUSE_INCLUDE_DIRS=${PROJECT_FUSE_INCLUDE_DIRS}
-DPROJECT_GIT_REV=${PROJECT_GIT_REV} -DPROJECT_GIT_REV=${PROJECT_GIT_REV}
-DPROJECT_INTERFACE=1
-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE} -DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE}
-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64} -DPROJECT_IS_ARM64=${PROJECT_IS_ARM64}
-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW} -DPROJECT_IS_MINGW=${PROJECT_IS_MINGW}

View File

@ -1,5 +1,5 @@
# Repertory MIT License # Repertory MIT License
### Copyright <2018-2024> <scott.e.graves@protonmail.com> ### Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

462
README.md
View File

@ -1,110 +1,456 @@
# Repertory # Repertory
Repertory allows you to mount AWS S3 and Sia via FUSE on Linux ~~/OS X~~ or via WinFSP Repertory allows you to mount S3 and Sia via FUSE on Linux or via WinFSP
on Windows. on Windows.
## Contents
1. [Details and Features](#details-and-features)
2. [Minimum Requirements](#minimum-requirements)
1. [Supported Operating Systems](#supported-operating-systems)
3. [GUI](#gui)
4. [Usage](#usage)
1. [Important Options](#important-options)
2. [Sia](#sia)
* [Sia Initial Configuration](#sia-initial-configuration)
* [Sia Mounting](#sia-mounting)
* [Sia Configuration File](#sia-configuration-file)
3. [S3](#s3)
* [S3 Initial Configuration](#s3-initial-configuration)
* [S3 Mounting](#s3-mounting)
* [S3 Configuration File](#s3-configuration-file)
5. [Data Directories](#data-directories)
1. [Linux Directories](#linux-directories)
2. [Windows Directories](#windows-directories)
6. [Remote Mounting](#remote-mounting)
1. [Server Setup](#server-setup)
* [Remote Mount Configuration File Section](#remote-mount-configuration-file-section)
2. [Client Setup](#client-setup)
* [Client Remote Mounting](#client-remote-mounting)
* [Remote Mount Configuration File](#remote-mount-configuration-file)
7. [Compiling](#compiling)
1. [Linux Compilation](#linux-compilation)
2. [Windows Setup](#windows-compilation)
8. [Credits](#credits)
9. [Developer Public Key](#developer-public-key)
10. [Consult the Wiki for additional information](https://git.fifthgrid.com/BlockStorage/repertory/wiki)
## Details and Features ## Details and Features
* Optimized for [Plex Media Server](https://www.plex.tv/) * Optimized for [Plex Media Server](https://www.plex.tv/)
* Single application to mount AWS S3 and/or Sia * Remote mounting of `repertory` instances on Linux and Windows
* Remote mounting of Repertory instances on Linux ~~, OS X~~ and Windows * Securely share your mounts over TCP/IP via `XChaCha20-Poly1305` with other systems on your network or over the internet.
* Securely share your mounts over TCP/IP (`XChaCha20-Poly1305` stream cipher) * Cross-platform support (Linux 64-bit, Linux arm64/aarch64, Windows 64-bit)
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, ~~OS X,~~ Windows 64-bit) * Optionally encrypt file names and file data via `XChaCha20-Poly1305` in S3 mounts
## Minimum Requirements ## Minimum Requirements
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support * [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v2.0.0+ for Sia support
* Only 64-bit operating systems are supported * Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
* By default, Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support * Windows requires the following dependencies to be installed:
* ~~OS X requires the following dependency to be installed:~~ * [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
* ~~[FUSE for macOS v4.5.0](https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.5.0/macfuse-4.5.0.dmg)~~
* Windows requires the following dependencies to be installed:
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
## Supported Operating Systems ### Supported Operating Systems
Only 64-bit operating systems are supported
* Linux `arm64/aarch64` * Linux `arm64/aarch64`
* Linux `amd64` * Linux `amd64`
* ~~OS X Mojave and above~~
* Windows 64-bit 10, 11 * Windows 64-bit 10, 11
## GUI
As of `v2.0.5-rc`, mounts can be managed using the `Repertory Management Portal`.
To launch the portal, execute the following command:
* `repertory -ui`
* The default username is `repertory`
* The default password is `repertory`
After first launch, `ui.json` will be created in the appropriate data directory.
See [Data Directories](#data-directories).
You should modify this file directly or use the portal to change the default
username and password.
### Screenshot
<a href="https://ibb.co/fVyJqnbF"><img src="https://i.ibb.co/fVyJqnbF/repertory-portal.png" alt="repertory-portal" border="0"></a>
## Usage ## Usage
### Notable Options ### Important Options
* `-dc`
* Display mount configuration.
* For Sia, `--name` is optional
* For S3, the `-s3` option is required along with `--name`
* `--help` * `--help`
* Display all mount utility options. * Display all mount utility options
* `-f`
* Keep process in foreground on Linux.
* `--name, -na [name]` * `--name, -na [name]`
* Identifies a unique configuration name to support multiple mounts.
* The `--name` option can be set to any valid value allowed as a file name for your filesystem. * The `--name` option can be set to any valid value allowed as a file name for your filesystem.
* For Sia, the bucket name will be set to the same value if it is empty in the configuration file. * For Sia, the bucket name will be set to the same value if it is empty in the configuration file.
* If the `--name` option is not specified, `default` will be used. * If the `--name` option is not specified, `default` will be used.
* For S3, the `--name` option is required and does not affect the bucket name. * For S3, the `--name` option is required and does not affect the bucket name.
* `-set SiaConfig.Bucket`
* Set Sia bucket name for the mount. * `-dc`
* Can be used in combination with `--name` to target a unique configuration. * Display mount configuration
* `-set S3Config.Bucket` * For Sia, `--name` is optional
* S3 bucket name for the mount. * For S3, the `-s3` option is required along with `--name`
* Must be used in combination with `--name` to target a unique configuration.
* Must be used in combination with `-s3`.
### Sia ### Sia
* Linux #### Sia Initial Configuration
* Required steps:
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
* To use `default` as the bucket name and configuration name, you only need to set the `renterd` API password:
* `repertory -set HostConfig.ApiPassword '<my password>'`
* To specify a different bucket name while using `default` as the configuration name:
* `repertory -set HostConfig.ApiPassword '<my password>'`
* `repertory -set SiaConfig.Bucket '<my bucket>'`
* For all other configurations:
* `repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'`
* `repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'`
* Optional steps:
* Set a user name used during `renterd` basic authentication:
* `repertory -set HostConfig.ApiUser '<my user>'`
* `repertory --name '<my config name>' -set HostConfig.ApiUser '<my user>'`
* Set a custom agent string (default `Sia-Agent`):
* `repertory -set HostConfig.AgentString '<my agent>'`
* `repertory --name '<my config name>' -set HostConfig.AgentString '<my agent>'`
* Set the host name or IP of the `renterd` instance (default `localhost`):
* `repertory -set HostConfig.HostNameOrIp '<my host name>'`
* `repertory --name '<my config name>' -set HostConfig.HostNameOrIp '<my host name>'`
* Set the `renterd` API port (default `9980`):
* `repertory -set HostConfig.ApiPort 9981`
* `repertory --name '<my config name>' -set HostConfig.ApiPort 9981`
* To verify/view all configuration options:
* `repertory -dc`
* `repertory --name '<my config name>' -dc`
* Example:
* `repertory --name default -dc`
#### Sia Mounting
* Linux:
* `repertory /mnt/location` * `repertory /mnt/location`
* `repertory --name default /mnt/location` * `repertory --name '<my config name>' /mnt/location`
* Windows * Example:
* `repertory.exe t:` * `repertory --name default /mnt/location`
* `repertory.exe --name default t:`
* Windows:
* `repertory t:`
* `repertory --name '<my config name>' t:`
* Example:
* `repertory --name default t:`
#### Sia Configuration File
```json
{
"ApiPassword": "<random generated rpc password>",
"ApiPort": 10000,
"ApiUser": "repertory",
"DatabaseType": "rocksdb",
"DownloadTimeoutSeconds": 30,
"EnableDownloadTimeout": true,
"EnableDriveEvents": false,
"EventLevel": "info",
"EvictionDelayMinutes": 1,
"EvictionUseAccessedTime": false,
"HighFreqIntervalSeconds": 30,
"HostConfig": {
"AgentString": "Sia-Agent",
"ApiPassword": "<renterd api password>",
"ApiPort": 9980,
"ApiUser": "",
"HostNameOrIp": "localhost",
"Path": "",
"Protocol": "http",
"TimeoutMs": 60000
},
"LowFreqIntervalSeconds": 3600,
"MaxCacheSizeBytes": 21474836480,
"MaxUploadCount": 5,
"MedFreqIntervalSeconds": 120,
"OnlineCheckRetrySeconds": 60,
"PreferredDownloadType": "default",
"RemoteMount": {
"ApiPort": 20000,
"ClientPoolSize": 20,
"Enable": false,
"EncryptionToken": ""
},
"RetryReadCount": 6,
"RingBufferFileSize": 512,
"SiaConfig": {
"Bucket": "default"
},
"TaskWaitMs": 100,
"Version": 1
}
```
### S3 ### S3
* Linux #### S3 Initial Configuration
* `repertory --name storj -s3 /mnt/location`
* Windows * Required steps:
* `repertory.exe --name storj -s3 t:` * Set the appropriate base URL:
* `repertory -s3 --name '<my config name>' -set S3Config.URL '<my url>'`
* Example:
* `repertory -s3 --name minio -set S3Config.URL 'http://localhost:9000'`
* Set the appropriate bucket name:
* `repertory -s3 --name '<my config name>' -set S3Config.Bucket '<my bucket name>'`
* Set the appropriate access key:
* `repertory -s3 --name '<my config name>' -set S3Config.AccessKey '<my access key>'`
* Set the appropriate secret key:
* `repertory -s3 --name '<my config name>' -set S3Config.SecretKey '<my secret key>'`
* For Sia and most local S3 gateway instances, enable path style URL's:
* `repertory -s3 --name '<my config name>' -set S3Config.UsePathStyle true`
* Optional steps:
* Set an appropriate region. Default is set to `any`:
* `repertory -s3 --name '<my config name>' -set S3Config.Region '<my region>'`
* Enable encrypted file names and file data. Set a strong, random encryption token and be sure to store it in a secure backup location:
* `repertory -s3 --name '<my config name>' -set S3Config.EncryptionToken '<my strong password>'`
* To verify/view all configuration options:
* `repertory -s3 --name '<my config name>' -dc`
* Example:
* `repertory -s3 --name minio -dc`
#### S3 Mounting
* Linux:
* `repertory -s3 --name '<my config name>' /mnt/location`
* Example:
* `repertory -s3 --name minio /mnt/location`
* Windows:
* `repertory -s3 --name '<my config name>' t:`
* Example:
* `repertory -s3 --name minio t:`
#### S3 Configuration File
```json
{
"ApiPassword": "<random generated rpc password>",
"ApiPort": 10100,
"ApiUser": "repertory",
"DatabaseType": "rocksdb",
"DownloadTimeoutSeconds": 30,
"EnableDownloadTimeout": true,
"EnableDriveEvents": false,
"EventLevel": "info",
"EvictionDelayMinutes": 1,
"EvictionUseAccessedTime": false,
"HighFreqIntervalSeconds": 30,
"LowFreqIntervalSeconds": 3600,
"MaxCacheSizeBytes": 21474836480,
"MaxUploadCount": 5,
"MedFreqIntervalSeconds": 120,
"OnlineCheckRetrySeconds": 60,
"PreferredDownloadType": "default",
"RemoteMount": {
"ApiPort": 20100,
"ClientPoolSize": 20,
"Enable": false,
"EncryptionToken": ""
},
"RetryReadCount": 6,
"RingBufferFileSize": 512,
"S3Config": {
"AccessKey": "<my access key>",
"Bucket": "<my bucket name>",
"EncryptionToken": "",
"Region": "any",
"SecretKey": "<my secret key>",
"TimeoutMs": 60000,
"URL": "http://localhost:9000",
"UsePathStyle": true,
"UseRegionInURL": false
},
"TaskWaitMs": 100,
"Version": 1
}
```
### Data Directories
#### Linux Directories
* `~/.local/repertory2/s3`
* `~/.local/repertory2/sia`
#### Windows Directories
* `%LOCALAPPDATA%\repertory2\s3`
* `%LOCALAPPDATA%\repertory2\sia`
* Examples:
* `C:\Users\Tom\AppData\Local\repertory2\s3`
* `C:\Users\Tom\AppData\Local\repertory2\sia`
* IMPORTANT:
* It is highly recommended to exclude this folder from any anti-virus/anti-malware applications as severe performance issues may arise.
* Excluding the mounted drive letter is also highly recommended.
## Remote Mounting
`repertory` allows local mounts to be shared with other computers on your network
or over the internet. This option is referred to as remote mounting.
### Server Setup
The following steps must be performed on the mount you wish to share with
other systems. Changes to configuration will not take affect while a mount is
active, so it is recommended to unmount beforehand.
* Required steps:
* Enable remote mount:
* Sia
* `repertory -set RemoteMount.Enable true`
* `repertory --name '<my config name>' -set RemoteMount.Enable true`
* S3:
* `repertory -s3 --name '<my config name>' -set RemoteMount.Enable true`
* Set a secure encryption token:
* Sia:
* `repertory -set RemoteMount.EncryptionToken '<my secure password>'`
* `repertory --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'`
* S3:
* `repertory -s3 --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'`
* Optional steps:
* Change the port clients will use to connect to your mount:
* Sia:
* `repertory -set RemoteMount.ApiPort 20000`
* `repertory --name '<my config name>' -set RemoteMount.ApiPort 20000`
* S3:
* `repertory -s3 --name '<my config name>' -set RemoteMount.ApiPort 20000`
* IMPORTANT:
* Be sure to configure your firewall to allow incoming TCP connections on the port configured in `RemoteMount.ApiPort`.
#### Remote Mount Configuration File Section
```json
{
...
"RemoteMount": {
"ApiPort": 20000,
"ClientPoolSize": 20,
"Enable": true,
"EncryptionToken": "<my secure password>"
},
...
}
```
### Client Setup
Client configuration is provider agnostic, so there's no need to specify `-s3`
for S3 providers.
* Required steps:
* Set the encryption token to the same value configured during server setup:
* `repertory -rm <host name or IP>:<port> -set RemoteConfig.EncryptionToken '<my secure password>'`
* Replace `<host name or IP>` with the host name or IP of the server
* Replace `<port>` with the value of `RemoteMount.ApiPort` used in the server configuration
* Example:
* `repertory -rm 192.168.1.10:20000 -set RemoteConfig.EncryptionToken '<my secure password>'`
* `repertory -rm my.host.com:20000 -set RemoteConfig.EncryptionToken '<my secure password>'`
#### Client Remote Mounting
* Linux:
* `repertory -rm <host name or IP>:<port> /mnt/location`
* Example:
* `repertory -rm 192.168.1.10:20000 /mnt/location`
* Windows:
* `repertory -rm <host name or IP>:<port> t:`
* Example:
* `repertory -rm 192.168.1.10:20000 t:`
#### Remote Mount Configuration File
```json
{
"ApiPassword": "<random generated rpc password>",
"ApiPort": 10010,
"ApiUser": "repertory",
"EnableDriveEvents": false,
"EventLevel": "info",
"RemoteConfig": {
"ApiPort": 20000,
"EncryptionToken": "<my secure password>",
"HostNameOrIp": "192.168.1.10",
"MaxConnections": 20,
"ReceiveTimeoutMs": 120000,
"SendTimeoutMs": 30000
},
"TaskWaitMs": 100,
"Version": 1
}
```
## Compiling ## Compiling
* Successful compilation will result in all required files being placed in the `dist/` directory Successful compilation will result in all files required for execution to be placed
* Linux in the `dist/` directory
### Linux Compilation
* Ensure `docker` is installed
* For x86_64:
* RelWithDebInfo: `scripts/make_unix.sh`
* Release: `scripts/make_unix.sh x86_64 Release`
* Debug: `scripts/make_unix.sh x86_64 Debug`
* For aarch64:
* RelWithDebInfo: `scripts/make_unix.sh aarch64`
* Release: `scripts/make_unix.sh aarch64 Release`
* Debug: `scripts/make_unix.sh aarch64 Debug`
### Windows Compilation
* OFFICIAL: Cross-compiling on Linux
* Ensure `docker` is installed * Ensure `docker` is installed
* For x86_64: * RelWithDebInfo: `scripts/make_win32.sh`
* RelWithDebInfo: `scripts/make_unix.sh` * Release: `scripts/make_win32.sh x86_64 Release`
* Release: `scripts/make_unix.sh x86_64 Release` * Debug: `scripts/make_win32.sh x86_64 Debug`
* Debug: `scripts/make_unix.sh x86_64 Debug`
* For aarch64: * UNOFFICIAL: Compiling on Windows
* RelWithDebInfo: `scripts/make_unix.sh aarch64` * Ensure latest [MSYS2](https://www.msys2.org/) is installed
* Release: `scripts/make_unix.sh aarch64 Release` * RelWithDebInfo: `scripts\make_win32.cmd`
* Debug: `scripts/make_unix.sh aarch64 Debug` * Release: `scripts\make_win32.cmd x86_64 Release`
* Windows * Debug: `scripts\make_win32.cmd x86_64 Debug`
* OFFICIAL: Cross-compiling on Linux
* Ensure `docker` is installed
* RelWithDebInfo: `scripts/make_win32.sh`
* Release: `scripts/make_win32.sh x86_64 Release`
* Debug: `scripts/make_win32.sh x86_64 Debug`
* UNOFFICIAL: Compiling on Windows
* Ensure latest [MSYS2](https://www.msys2.org/) is installed
* RelWithDebInfo: `scripts\make_win32.cmd`
* Release: `scripts\make_win32.cmd x86_64 Release`
* Debug: `scripts\make_win32.cmd x86_64 Debug`
## Credits ## Credits
* [binutils](https://www.gnu.org/software/binutils/)
* [boost c++ libraries](https://www.boost.org/) * [boost c++ libraries](https://www.boost.org/)
* [cpp-httplib](https://github.com/yhirose/cpp-httplib) * [cpp-httplib](https://github.com/yhirose/cpp-httplib)
* [curl](https://curl.haxx.se/) * [curl](https://curl.haxx.se/)
* ~~[FUSE for macOS](https://osxfuse.github.io/)~~ * [docker](https://www.docker.com/)
* [Google Test](https://github.com/google/googletest) * [Google Test](https://github.com/google/googletest)
* [ICU](https://icu.unicode.org/)
* [JSON for Modern C++](https://github.com/nlohmann/json) * [JSON for Modern C++](https://github.com/nlohmann/json)
* [libexpat](https://github.com/libexpat/libexpat)
* [libfuse](https://github.com/libfuse/libfuse) * [libfuse](https://github.com/libfuse/libfuse)
* [libsodium](https://doc.libsodium.org/) * [libsodium](https://doc.libsodium.org/)
* [mingw-w64](https://www.mingw-w64.org/)
* [MSYS2](https://www.msys2.org)
* [OpenSSL](https://www.openssl.org/) * [OpenSSL](https://www.openssl.org/)
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
* [pugixml](https://pugixml.org/)
* [RocksDB](https://rocksdb.org)
* [ScPrime](https://scpri.me/) * [ScPrime](https://scpri.me/)
* [Sia Decentralized Cloud Storage](https://sia.tech/) * [Sia Decentralized Cloud Storage](https://sia.tech/)
* [spdlog](https://github.com/gabime/spdlog)
* [SQLite](https://www.sqlite.org) * [SQLite](https://www.sqlite.org)
* [stduuid](https://github.com/mariusbancila/stduuid) * [stduuid](https://github.com/mariusbancila/stduuid)
* [Storj](https://storj.io/) * [Storj](https://storj.io/)

View File

@ -1,20 +1,20 @@
set(BINUTILS_HASH ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450) set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca) set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
set(CPP_HTTPLIB_HASH 405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00) set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
set(CURL_HASH 5a231145114589491fc52da118f9c7ef8abee885d1cb1ced99c7290e9a352f07) set(CPP_HTTPLIB_HASH 18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866)
set(EXPAT_HASH 372b18f6527d162fa9658f1c74d22a37429b82d822f5a1e1fc7e00f6045a06a2) set(CURL_HASH ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699)
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293) set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
set(GTEST_HASH 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926) set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399)
set(ICU_HASH 925e6b4b8cf8856e0ac214f6f34e30dee63b7bb7a50460ab4603950eff48f89e) set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
set(JSON_HASH 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406) set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1) set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
set(MINGW_HASH 3f66bce069ee8bed7439a1a13da7cb91a5e67ea6170f21317ac7f5794625ee10) set(MINGW_HASH cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f)
set(OPENSSL_HASH e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf) set(OPENSSL_HASH 344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0)
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591) set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
set(PUGIXML_HASH 2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015) set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
set(ROCKSDB_HASH 9b810c81731835fda0d4bbdb51d3199d901fa4395733ab63752d297da84c5a47) set(ROCKSDB_HASH 3fdc9ca996971c4c039959866382c4a3a6c8ade4abf888f3b2ff77153e07bf28)
set(SPDLOG_HASH 9962648c9b4f1a7bbc76fd8d9172555bad1871fdb14ff4f842ef87949682caa5) set(SPDLOG_HASH 7a80896357f3e8e920e85e92633b14ba0f229c506e6f978578bdc35ba09e9a5d)
set(SQLITE_HASH 77823cb110929c2bcb0f5d48e4833b5c59a8a6e40cdea3936b99e199dbbe5784) set(SQLITE_HASH 6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3)
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3) set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c) set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)

View File

@ -120,11 +120,11 @@ if(PROJECT_ENABLE_BOOST)
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread --with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread
BUILD_COMMAND BUILD_COMMAND
./b2 ./b2
-j1 -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
${BOOST_BUILD_ARGS} ${BOOST_BUILD_ARGS}
INSTALL_COMMAND INSTALL_COMMAND
./b2 ./b2
-j1 -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
${BOOST_BUILD_ARGS} ${BOOST_BUILD_ARGS}
install install
) )

View File

@ -15,10 +15,13 @@ if(PROJECT_ENABLE_CPP_HTTPLIB)
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS} CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS} -DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON -DBUILD_STATIC_LIBS=ON
-DHTTPLIB_REQUIRE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DHTTPLIB_REQUIRE_ZLIB=ON
-DHTTPLIB_REQUIRE_BROTLI=OFF -DHTTPLIB_REQUIRE_BROTLI=OFF
-DHTTPLIB_REQUIRE_OPENSSL=ON
-DHTTPLIB_REQUIRE_ZLIB=ON
-DHTTPLIB_TEST=OFF -DHTTPLIB_TEST=OFF
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=ON
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS} -DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
) )

View File

@ -18,14 +18,18 @@ if(PROJECT_ENABLE_CURL)
URL ${PROJECT_3RD_PARTY_DIR}/curl-${CURL_VERSION}.tar.gz URL ${PROJECT_3RD_PARTY_DIR}/curl-${CURL_VERSION}.tar.gz
URL_HASH SHA256=${CURL_HASH} URL_HASH SHA256=${CURL_HASH}
LIST_SEPARATOR | LIST_SEPARATOR |
CMAKE_ARGS BUILD_COMMAND
${PROJECT_EXTERNAL_CMAKE_FLAGS} ${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS} CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_STATIC_LIBS=ON
-DBUILD_CURL_EXE=OFF -DBUILD_CURL_EXE=OFF
-DBUILD_LIBCURL_DOCS=OFF
-DBUILD_MISC_DOCS=OFF
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_CURL=ON -DBUILD_STATIC_CURL=ON
-DBUILD_STATIC_LIBS=ON -DBUILD_STATIC_LIBS=ON
-DBUILD_STATIC_LIBS=ON
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
-DCURL_BROTLI=OFF
-DCURL_CA_BUNDLE=./cacert.pem -DCURL_CA_BUNDLE=./cacert.pem
-DCURL_CA_FALLBACK=ON -DCURL_CA_FALLBACK=ON
-DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAP=ON
@ -33,6 +37,7 @@ if(PROJECT_ENABLE_CURL)
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH2=OFF
-DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL} -DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DCURL_ZLIB=ON -DCURL_ZLIB=ON
-DENABLE_CURL_MANUAL=OFF
-DENABLE_THREADED_RESOLVER=ON -DENABLE_THREADED_RESOLVER=ON
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS} -DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}

View File

@ -9,6 +9,8 @@ if(PROJECT_ENABLE_ROCKSDB)
URL ${PROJECT_3RD_PARTY_DIR}/rocksdb-${ROCKSDB_VERSION}.tar.gz URL ${PROJECT_3RD_PARTY_DIR}/rocksdb-${ROCKSDB_VERSION}.tar.gz
URL_HASH SHA256=${ROCKSDB_HASH} URL_HASH SHA256=${ROCKSDB_HASH}
LIST_SEPARATOR | LIST_SEPARATOR |
BUILD_COMMAND
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS} CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=ON -DBUILD_STATIC_LIBS=ON

View File

@ -2,7 +2,7 @@ if(PROJECT_ENABLE_SQLITE)
if(PROJECT_BUILD) if(PROJECT_BUILD)
add_definitions(-DPROJECT_ENABLE_SQLITE) add_definitions(-DPROJECT_ENABLE_SQLITE)
if (PROJECT_IS_MINGW AND NOT PROJECT_IS_MINGW_UNIX) if (PROJECT_IS_MINGW AND NOT PROJECT_IS_MINGW_UNIX)
pkg_check_modules(SQLITE3 REQUIRED sqlite3>=${SQLITE2_VERSION}) pkg_check_modules(SQLITE3 REQUIRED sqlite3)
include_directories(SYSTEM BEFORE ${SQLITE3_INCLUDE_DIRS}) include_directories(SYSTEM BEFORE ${SQLITE3_INCLUDE_DIRS})
link_libraries(${SQLITE3_LIBRARIES}) link_libraries(${SQLITE3_LIBRARIES})
else() else()

View File

@ -1,28 +1,28 @@
set(BINUTILS_VERSION 2.41) set(BINUTILS_VERSION 2.44)
set(BOOST2_MAJOR_VERSION 1) set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76) set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0) set(BOOST2_PATCH_VERSION 0)
set(BOOST_MAJOR_VERSION 1) set(BOOST_MAJOR_VERSION 1)
set(BOOST_MINOR_VERSION 87) set(BOOST_MINOR_VERSION 88)
set(BOOST_PATCH_VERSION 0) set(BOOST_PATCH_VERSION 0)
set(CPP_HTTPLIB_VERSION 0.18.1) set(CPP_HTTPLIB_VERSION 0.20.0)
set(CURL2_VERSION 8_11_0) set(CURL2_VERSION 8_13_0)
set(CURL_VERSION 8.11.0) set(CURL_VERSION 8.13.0)
set(EXPAT2_VERSION 2_6_4) set(EXPAT2_VERSION 2_7_1)
set(EXPAT_VERSION 2.6.4) set(EXPAT_VERSION 2.7.1)
set(GCC_VERSION 14.2.0) set(GCC_VERSION 14.2.0)
set(GTEST_VERSION 1.15.2) set(GTEST_VERSION 1.16.0)
set(ICU_VERSION 75-1) set(ICU_VERSION 76-1)
set(JSON_VERSION 3.11.3) set(JSON_VERSION 3.12.0)
set(LIBSODIUM_VERSION 1.0.20) set(LIBSODIUM_VERSION 1.0.20)
set(MESA_VERSION 23.3.3) set(MESA_VERSION 23.3.3)
set(MINGW_VERSION 11.0.1) set(MINGW_VERSION 12.0.0)
set(OPENSSL_VERSION 3.4.0) set(OPENSSL_VERSION 3.5.0)
set(PKG_CONFIG_VERSION 0.29.2) set(PKG_CONFIG_VERSION 0.29.2)
set(PUGIXML_VERSION 1.14) set(PUGIXML_VERSION 1.15)
set(ROCKSDB_VERSION 9.7.4) set(ROCKSDB_VERSION 10.0.1)
set(SPDLOG_VERSION 1.15.0) set(SPDLOG_VERSION 1.15.2)
set(SQLITE2_VERSION 3.46.1) set(SQLITE2_VERSION 3.49.1)
set(SQLITE_VERSION 3460100) set(SQLITE_VERSION 3490100)
set(STDUUID_VERSION 1.2.3) set(STDUUID_VERSION 1.2.3)
set(ZLIB_VERSION 1.3.1) set(ZLIB_VERSION 1.3.1)

View File

@ -5,12 +5,12 @@ PROJECT_NAME="repertory"
PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage" PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage"
PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory" PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory"
PROJECT_COPYRIGHT="Copyright <2018-2024> <MIT License> <${PROJECT_URL}>" PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
PROJECT_DESC="Mount utility for Sia and S3" PROJECT_DESC="Mount utility for Sia and S3"
PROJECT_MAJOR_VERSION=2 PROJECT_MAJOR_VERSION=2
PROJECT_MINOR_VERSION=0 PROJECT_MINOR_VERSION=0
PROJECT_REVISION_VERSION=2 PROJECT_REVISION_VERSION=6
PROJECT_RELEASE_NUM=0 PROJECT_RELEASE_NUM=0
PROJECT_RELEASE_ITER=rc PROJECT_RELEASE_ITER=rc
@ -19,6 +19,9 @@ PROJECT_APP_LIST=(${PROJECT_NAME})
PROJECT_PRIVATE_KEY=${DEVELOPER_PRIVATE_KEY} PROJECT_PRIVATE_KEY=${DEVELOPER_PRIVATE_KEY}
PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY} PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY}
PROJECT_FLUTTER_BASE_HREF="/ui/"
PROJECT_ENABLE_V2_ERRORS=ON
PROJECT_ENABLE_WIN32_LONG_PATH_NAMES=OFF PROJECT_ENABLE_WIN32_LONG_PATH_NAMES=OFF
PROJECT_ENABLE_BACKWARD_CPP=OFF PROJECT_ENABLE_BACKWARD_CPP=OFF

View File

@ -1,4 +1,5 @@
FROM arm64v8/alpine:3.20.3 #comment
FROM arm64v8/alpine:3.21.3
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com> MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
CMD bash CMD bash
@ -30,7 +31,7 @@ RUN apk add \
gflags \ gflags \
gflags-dev \ gflags-dev \
git \ git \
gtkmm3-dev \ git-lfs \
icu-dev \ icu-dev \
icu-libs \ icu-libs \
icu-static \ icu-static \
@ -69,7 +70,6 @@ RUN apk add \
tcl \ tcl \
tcl-dev \ tcl-dev \
texinfo \ texinfo \
vlc-dev \
wget \ wget \
xz \ xz \
xz-dev \ xz-dev \
@ -82,3 +82,6 @@ RUN apk add \
zstd-libs \ zstd-libs \
zstd-static \ zstd-static \
xz-static xz-static
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16

View File

@ -1,4 +1,5 @@
FROM alpine:3.20.3 #comment
FROM alpine:3.21.3
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com> MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
CMD bash CMD bash
@ -30,6 +31,7 @@ RUN apk add \
gflags \ gflags \
gflags-dev \ gflags-dev \
git \ git \
git-lfs \
icu-dev \ icu-dev \
icu-libs \ icu-libs \
icu-static \ icu-static \
@ -80,3 +82,6 @@ RUN apk add \
zstd-libs \ zstd-libs \
zstd-static \ zstd-static \
xz-static xz-static
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16

48
docker/x86_64/flutter Normal file
View File

@ -0,0 +1,48 @@
FROM debian:latest
ARG UID=0
ARG GID=0
RUN apt-get update
RUN apt-get install -y \
bash \
curl \
fonts-droid-fallback \
gdb \
git \
lib32stdc++6 \
libgconf-2-4 \
libglu1-mesa \
libstdc++6 \
python3 \
unzip \
wget
RUN apt-get clean
RUN git clone https://github.com/flutter/flutter.git /flutter
RUN git config --system --add safe.directory /flutter
ENV PATH="/flutter/bin:/flutter/bin/cache/dart-sdk/bin:${PATH}"
RUN flutter doctor -v
RUN flutter channel master
RUN flutter upgrade
RUN flutter --disable-analytics
RUN flutter config --no-analytics
RUN flutter config --enable-web
RUN flutter config --no-cli-animations
RUN mkdir /nonexistent
RUN chown -R $UID:$GID /nonexistent
RUN mkdir /.config
RUN chown -R $UID:$GID /.config
RUN mkdir /.dart-tool
RUN chown -R $UID:$GID /.dart-tool
RUN mkdir /.pub-cache
RUN chown -R $UID:$GID /.pub-cache
RUN chown -R $UID:$GID /flutter

View File

@ -1,5 +1,5 @@
#comment #comment
FROM alpine:3.20.3 FROM alpine:3.21.3
RUN apk update RUN apk update
RUN apk upgrade RUN apk upgrade
@ -18,6 +18,7 @@ RUN apk add \
gcc \ gcc \
gettext \ gettext \
git \ git \
git-lfs \
gmp \ gmp \
gmp-dev \ gmp-dev \
gperf \ gperf \
@ -350,9 +351,9 @@ RUN cd /3rd_party/mingw64 && sha256sum -c ./expat-${MY_EXPAT_VERSION}.tar.gz.sha
ARG FONTCONFIG_VERSION ARG FONTCONFIG_VERSION
ENV MY_FONTCONFIG_VERSION=${FONTCONFIG_VERSION} ENV MY_FONTCONFIG_VERSION=${FONTCONFIG_VERSION}
RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz" ]; then \ RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz" ]; then \
cd /3rd_party && sha256sum -c ./fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz.sha256 && cd - \ cd /3rd_party && sha256sum -c ./fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz.sha256 && cd - \
&& tar xvzf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz \ && tar xvJf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz \
&& cd fontconfig-${MY_FONTCONFIG_VERSION} \ && cd fontconfig-${MY_FONTCONFIG_VERSION} \
&& meson setup \ && meson setup \
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \ --cross-file ${MY_TOOLCHAIN_FILE_MESON} \
@ -671,12 +672,15 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
&& cd build \ && cd build \
&& cmake .. \ && cmake .. \
-DBUILD_CURL_EXE=ON \ -DBUILD_CURL_EXE=ON \
-DBUILD_LIBCURL_DOCS=OFF \
-DBUILD_MISC_DOCS=OFF \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=ON \ -DBUILD_STATIC_LIBS=ON \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \ -DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \ -DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \ -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCURL_BROTLI=OFF \
-DCURL_CA_BUNDLE=./cacert.pem \ -DCURL_CA_BUNDLE=./cacert.pem \
-DCURL_CA_FALLBACK=ON \ -DCURL_CA_FALLBACK=ON \
-DCURL_DISABLE_LDAP=ON \ -DCURL_DISABLE_LDAP=ON \
@ -684,6 +688,7 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
-DCURL_USE_LIBSSH2=OFF \ -DCURL_USE_LIBSSH2=OFF \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DCURL_ZLIB=ON \ -DCURL_ZLIB=ON \
-DENABLE_CURL_MANUAL=OFF \
-DENABLE_THREADED_RESOLVER=ON \ -DENABLE_THREADED_RESOLVER=ON \
-DOPENSSL_USE_STATIC_LIBS=ON \ -DOPENSSL_USE_STATIC_LIBS=ON \
-DUSE_LIBIDN2=OFF \ -DUSE_LIBIDN2=OFF \
@ -711,6 +716,9 @@ RUN if [ -f "/3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz" ]; then \
-DHTTPLIB_REQUIRE_OPENSSL=ON \ -DHTTPLIB_REQUIRE_OPENSSL=ON \
-DHTTPLIB_REQUIRE_ZLIB=ON \ -DHTTPLIB_REQUIRE_ZLIB=ON \
-DHTTPLIB_TEST=OFF \ -DHTTPLIB_TEST=OFF \
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF \
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=YES \
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON \
&& make -j${MY_NUM_JOBS} \ && make -j${MY_NUM_JOBS} \
&& make install \ && make install \
&& cd ${MY_WORKDIR} \ && cd ${MY_WORKDIR} \

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,33 +22,41 @@
#ifndef REPERTORY_INCLUDE_APP_CONFIG_HPP_ #ifndef REPERTORY_INCLUDE_APP_CONFIG_HPP_
#define REPERTORY_INCLUDE_APP_CONFIG_HPP_ #define REPERTORY_INCLUDE_APP_CONFIG_HPP_
#include "events/event.hpp"
#include "types/remote.hpp" #include "types/remote.hpp"
#include "types/repertory.hpp" #include "types/repertory.hpp"
namespace repertory { namespace repertory {
class app_config final { class app_config final {
private:
static stop_type stop_requested;
public: public:
[[nodiscard]] static auto [[nodiscard]] static auto default_agent_name(const provider_type &prov)
default_agent_name(const provider_type &prov) -> std::string; -> std::string;
[[nodiscard]] static auto [[nodiscard]] static auto default_api_port(const provider_type &prov)
default_api_port(const provider_type &prov) -> std::uint16_t; -> std::uint16_t;
[[nodiscard]] static auto [[nodiscard]] static auto default_data_directory(const provider_type &prov)
default_data_directory(const provider_type &prov) -> std::string; -> std::string;
[[nodiscard]] static auto [[nodiscard]] static auto default_remote_api_port(const provider_type &prov)
default_remote_api_port(const provider_type &prov) -> std::uint16_t; -> std::uint16_t;
[[nodiscard]] static auto [[nodiscard]] static auto default_rpc_port() -> std::uint16_t;
default_rpc_port(const provider_type &prov) -> std::uint16_t;
[[nodiscard]] static auto [[nodiscard]] static auto get_provider_display_name(const provider_type &prov)
get_provider_display_name(const provider_type &prov) -> std::string; -> std::string;
[[nodiscard]] static auto [[nodiscard]] static auto get_provider_name(const provider_type &prov)
get_provider_name(const provider_type &prov) -> std::string; -> std::string;
[[nodiscard]] static auto get_root_data_directory() -> std::string;
public:
[[nodiscard]] static auto get_stop_requested() -> bool;
static void set_stop_requested();
public: public:
app_config(const provider_type &prov, std::string_view data_directory = ""); app_config(const provider_type &prov, std::string_view data_directory = "");
@ -64,7 +72,7 @@ public:
private: private:
provider_type prov_; provider_type prov_;
atomic<std::string> api_auth_; atomic<std::string> api_password_;
std::atomic<std::uint16_t> api_port_; std::atomic<std::uint16_t> api_port_;
atomic<std::string> api_user_; atomic<std::string> api_user_;
std::atomic<bool> config_changed_; std::atomic<bool> config_changed_;
@ -84,7 +92,6 @@ private:
std::atomic<std::uint8_t> max_upload_count_; std::atomic<std::uint8_t> max_upload_count_;
std::atomic<std::uint16_t> med_freq_interval_secs_; std::atomic<std::uint16_t> med_freq_interval_secs_;
std::atomic<std::uint16_t> online_check_retry_secs_; std::atomic<std::uint16_t> online_check_retry_secs_;
std::atomic<std::uint16_t> orphaned_file_retention_days_;
std::atomic<download_type> preferred_download_type_; std::atomic<download_type> preferred_download_type_;
std::atomic<std::uint16_t> retry_read_count_; std::atomic<std::uint16_t> retry_read_count_;
std::atomic<std::uint16_t> ring_buffer_file_size_; std::atomic<std::uint16_t> ring_buffer_file_size_;
@ -115,7 +122,7 @@ private:
auto set_value(dest &dst, const source &src) -> bool; auto set_value(dest &dst, const source &src) -> bool;
public: public:
[[nodiscard]] auto get_api_auth() const -> std::string; [[nodiscard]] auto get_api_password() const -> std::string;
[[nodiscard]] auto get_api_port() const -> std::uint16_t; [[nodiscard]] auto get_api_port() const -> std::uint16_t;
@ -165,8 +172,6 @@ public:
[[nodiscard]] auto get_online_check_retry_secs() const -> std::uint16_t; [[nodiscard]] auto get_online_check_retry_secs() const -> std::uint16_t;
[[nodiscard]] auto get_orphaned_file_retention_days() const -> std::uint16_t;
[[nodiscard]] auto get_preferred_download_type() const -> download_type; [[nodiscard]] auto get_preferred_download_type() const -> download_type;
[[nodiscard]] auto get_provider_type() const -> provider_type; [[nodiscard]] auto get_provider_type() const -> provider_type;
@ -185,14 +190,17 @@ public:
[[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t; [[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t;
[[nodiscard]] auto [[nodiscard]] auto get_value_by_name(const std::string &name) const
get_value_by_name(const std::string &name) const -> std::string; -> std::string;
[[nodiscard]] auto get_raw_value_by_name(const std::string &name) const
-> std::string;
[[nodiscard]] auto get_version() const -> std::uint64_t; [[nodiscard]] auto get_version() const -> std::uint64_t;
void save(); void save();
void set_api_auth(const std::string &value); void set_api_password(const std::string &value);
void set_api_port(std::uint16_t value); void set_api_port(std::uint16_t value);
@ -232,8 +240,6 @@ public:
void set_online_check_retry_secs(std::uint16_t value); void set_online_check_retry_secs(std::uint16_t value);
void set_orphaned_file_retention_days(std::uint16_t value);
void set_preferred_download_type(const download_type &value); void set_preferred_download_type(const download_type &value);
void set_remote_config(remote::remote_config value); void set_remote_config(remote::remote_config value);

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,10 +22,11 @@
#ifndef REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_ #ifndef REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_ #define REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
#include "app_config.hpp"
#include "comm/curl/multi_request.hpp" #include "comm/curl/multi_request.hpp"
#include "comm/i_http_comm.hpp" #include "comm/i_http_comm.hpp"
#include "events/event_system.hpp" #include "events/event_system.hpp"
#include "events/events.hpp" #include "events/types/curl_error.hpp"
#include "utils/encryption.hpp" #include "utils/encryption.hpp"
namespace repertory { namespace repertory {
@ -42,7 +43,7 @@ private:
struct read_write_info final { struct read_write_info final {
data_buffer data{}; data_buffer data{};
stop_type &stop_requested; stop_type_callback stop_requested_cb;
}; };
static const write_callback write_data; static const write_callback write_data;
@ -61,13 +62,14 @@ public:
[[nodiscard]] static auto reset_curl(CURL *curl_handle) -> CURL *; [[nodiscard]] static auto reset_curl(CURL *curl_handle) -> CURL *;
public: public:
[[nodiscard]] static auto [[nodiscard]] static auto construct_url(CURL *curl,
construct_url(CURL *curl, const std::string &relative_path, const std::string &relative_path,
const host_config &cfg) -> std::string; const host_config &cfg)
-> std::string;
[[nodiscard]] static auto [[nodiscard]] static auto create_host_config(const s3_config &cfg,
create_host_config(const s3_config &cfg, bool use_s3_path_style)
bool use_s3_path_style) -> host_config; -> host_config;
[[nodiscard]] static auto url_encode(CURL *curl, const std::string &data, [[nodiscard]] static auto url_encode(CURL *curl, const std::string &data,
bool allow_slash) -> std::string; bool allow_slash) -> std::string;
@ -75,8 +77,8 @@ public:
template <typename request_type> template <typename request_type>
[[nodiscard]] static auto [[nodiscard]] static auto
make_encrypted_request(const host_config &cfg, const request_type &request, make_encrypted_request(const host_config &cfg, const request_type &request,
long &response_code, long &response_code, stop_type &stop_requested)
stop_type &stop_requested) -> bool { -> bool {
response_code = 0; response_code = 0;
if (not request.decryption_token.has_value() || if (not request.decryption_token.has_value() ||
@ -114,7 +116,7 @@ public:
return false; return false;
} }
if (response_code != 200) { if (response_code != http_error_codes::ok) {
return false; return false;
} }
@ -135,6 +137,8 @@ public:
[[nodiscard]] static auto [[nodiscard]] static auto
make_request(const host_config &cfg, const request_type &request, make_request(const host_config &cfg, const request_type &request,
long &response_code, stop_type &stop_requested) -> bool { long &response_code, stop_type &stop_requested) -> bool {
REPERTORY_USES_FUNCTION_NAME();
if (request.decryption_token.has_value() && if (request.decryption_token.has_value() &&
not request.decryption_token.value().empty()) { not request.decryption_token.value().empty()) {
return make_encrypted_request(cfg, request, response_code, return make_encrypted_request(cfg, request, response_code,
@ -169,7 +173,12 @@ public:
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_headers); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_headers);
} }
read_write_info write_info{{}, stop_requested}; read_write_info write_info{
{},
[&stop_requested]() -> bool {
return stop_requested || app_config::get_stop_requested();
},
};
if (request.response_handler.has_value()) { if (request.response_handler.has_value()) {
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_info); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_info);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
@ -193,6 +202,16 @@ public:
request.aws_service.value().c_str()); request.aws_service.value().c_str());
} }
curl_slist *header_list{nullptr};
if (not request.headers.empty()) {
for (const auto &header : request.headers) {
header_list = curl_slist_append(
header_list,
fmt::format("{}: {}", header.first, header.second).c_str());
}
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_list);
}
auto url = construct_url(curl, request.get_path(), cfg) + parameters; auto url = construct_url(curl, request.get_path(), cfg) + parameters;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
@ -200,8 +219,13 @@ public:
CURLcode curl_code{}; CURLcode curl_code{};
curl_request.get_result(curl_code, response_code); curl_request.get_result(curl_code, response_code);
if (header_list != nullptr) {
curl_slist_free_all(header_list);
}
if (curl_code != CURLE_OK) { if (curl_code != CURLE_OK) {
event_system::instance().raise<curl_error>(url, curl_code); event_system::instance().raise<curl_error>(curl_code, function_name, url);
return false; return false;
} }
@ -215,26 +239,30 @@ public:
public: public:
void enable_s3_path_style(bool enable) override; void enable_s3_path_style(bool enable) override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_delete &del,
make_request(const curl::requests::http_delete &del, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_get &get,
make_request(const curl::requests::http_get &get, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_head &head,
make_request(const curl::requests::http_head &head, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_post &post_file,
make_request(const curl::requests::http_post &post_file, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_put_file &put_file,
make_request(const curl::requests::http_put_file &put_file, long &response_code,
long &response_code, stop_type &stop_requested) const
stop_type &stop_requested) const -> bool override; -> bool override;
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -36,6 +36,9 @@ private:
stop_type &stop_requested_; stop_type &stop_requested_;
CURLM *multi_handle_; CURLM *multi_handle_;
private:
[[nodiscard]] auto get_stop_requested() const -> bool;
public: public:
void get_result(CURLcode &curl_code, long &http_code); void get_result(CURLcode &curl_code, long &http_code);
}; };

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -32,15 +32,15 @@ struct http_post final : http_request_base {
auto operator=(const http_post &) -> http_post & = default; auto operator=(const http_post &) -> http_post & = default;
auto operator=(http_post &&) -> http_post & = default; auto operator=(http_post &&) -> http_post & = default;
~http_post() override; ~http_post() override = default;
std::optional<nlohmann::json> json; std::optional<nlohmann::json> json;
[[nodiscard]] auto [[nodiscard]] auto set_method(CURL *curl,
set_method(CURL *curl, stop_type & /*stop_requested*/) const -> bool override; stop_type & /*stop_requested*/) const
-> bool override;
private: private:
mutable curl_slist *headers{nullptr};
mutable std::optional<std::string> json_str; mutable std::optional<std::string> json_str;
}; };
} // namespace repertory::curl::requests } // namespace repertory::curl::requests

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -51,7 +51,7 @@ struct http_request_base {
bool allow_timeout{}; bool allow_timeout{};
std::optional<std::string> aws_service; std::optional<std::string> aws_service;
std::optional<std::string> decryption_token{}; std::optional<std::string> decryption_token{};
http_headers headers{}; mutable http_headers headers{};
std::string path{}; std::string path{};
http_query_parameters query{}; http_query_parameters query{};
std::optional<http_range> range{}; std::optional<http_range> range{};

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -69,21 +69,21 @@ private:
void put_client(std::shared_ptr<client> &cli); void put_client(std::shared_ptr<client> &cli);
[[nodiscard]] auto read_packet(client &cli, packet &response) [[nodiscard]] auto read_packet(client &cli,
-> packet::error_type; packet &response) const -> packet::error_type;
void resolve(); void resolve();
public: public:
[[nodiscard]] auto send(std::string_view method, std::uint32_t &service_flags) [[nodiscard]] auto send(std::string_view method,
-> packet::error_type; std::uint32_t &service_flags) -> packet::error_type;
[[nodiscard]] auto send(std::string_view method, packet &request, [[nodiscard]] auto send(std::string_view method, packet &request,
std::uint32_t &service_flags) -> packet::error_type; std::uint32_t &service_flags) -> packet::error_type;
[[nodiscard]] auto send(std::string_view method, packet &request, [[nodiscard]] auto send(std::string_view method, packet &request,
packet &response, std::uint32_t &service_flags) packet &response,
-> packet::error_type; std::uint32_t &service_flags) -> packet::error_type;
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -54,12 +54,13 @@ REPERTORY_IGNORE_WARNINGS_DISABLE()
using namespace std::chrono_literals; using namespace std::chrono_literals;
using json = nlohmann::json; using json = nlohmann::json;
inline constexpr const std::string_view REPERTORY = "repertory"; inline constexpr const std::string_view REPERTORY{"repertory"};
inline constexpr const std::wstring_view REPERTORY_W = L"repertory"; inline constexpr const std::string_view REPERTORY_DATA_NAME{"repertory2"};
inline constexpr const std::wstring_view REPERTORY_W{L"repertory"};
inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION = 0ULL; inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION{2ULL};
inline constexpr const std::string_view REPERTORY_DATA_NAME = "repertory2"; inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"};
inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION = "2.0.0"; inline constexpr const std::string_view RENTERD_MIN_VERSION{"2.0.0"};
#define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE #define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE
@ -221,11 +222,11 @@ using WCHAR = wchar_t;
#define MAX_PATH 260 #define MAX_PATH 260
#define STATUS_SUCCESS std::uint32_t{0U}
#define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L} #define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L}
#define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L} #define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L}
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L} #define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L}
#define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L} #define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L}
#define STATUS_END_OF_FILE std::uint32_t{0xC0000011L}
#define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL} #define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL}
#define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L} #define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L}
#define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL} #define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL}
@ -234,11 +235,13 @@ using WCHAR = wchar_t;
#define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L} #define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L}
#define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL} #define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL}
#define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL} #define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL}
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L}
#define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L} #define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L}
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L}
#define STATUS_OBJECT_NAME_COLLISION std::uint32_t{0xC0000035L}
#define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L} #define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L}
#define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L} #define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L}
#define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L} #define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L}
#define STATUS_SUCCESS std::uint32_t{0U}
#define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L} #define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L}
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) \ #define CONVERT_STATUS_NOT_IMPLEMENTED(e) \

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -31,7 +31,7 @@ class i_file_db {
public: public:
struct file_info final { struct file_info final {
std::string api_path; std::string api_path;
bool directory; bool directory{};
std::string source_path; std::string source_path;
}; };
@ -56,6 +56,10 @@ public:
[[nodiscard]] virtual auto count() const -> std::uint64_t = 0; [[nodiscard]] virtual auto count() const -> std::uint64_t = 0;
virtual void enumerate_item_list(
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
stop_type_callback stop_requested_cb) const = 0;
[[nodiscard]] virtual auto get_api_path(const std::string &source_path, [[nodiscard]] virtual auto get_api_path(const std::string &source_path,
std::string &api_path) const std::string &api_path) const
-> api_error = 0; -> api_error = 0;
@ -80,7 +84,8 @@ public:
get_file_source_path(const std::string &api_path, get_file_source_path(const std::string &api_path,
std::string &source_path) const -> api_error = 0; std::string &source_path) const -> api_error = 0;
[[nodiscard]] virtual auto get_item_list() const [[nodiscard]] virtual auto
get_item_list(stop_type_callback stop_requested_cb) const
-> std::vector<file_info> = 0; -> std::vector<file_info> = 0;
[[nodiscard]] virtual auto get_source_path(const std::string &api_path, [[nodiscard]] virtual auto get_source_path(const std::string &api_path,

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -41,10 +41,7 @@ public:
std::string source_path; std::string source_path;
}; };
struct upload_entry final { using upload_entry = upload_active_entry;
std::string api_path;
std::string source_path;
};
public: public:
[[nodiscard]] virtual auto add_resume(const resume_entry &entry) -> bool = 0; [[nodiscard]] virtual auto add_resume(const resume_entry &entry) -> bool = 0;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -31,6 +31,10 @@ class i_meta_db {
public: public:
virtual void clear() = 0; virtual void clear() = 0;
virtual void enumerate_api_path_list(
std::function<void(const std::vector<std::string> &)> callback,
stop_type_callback stop_requested_cb) const = 0;
[[nodiscard]] virtual auto get_api_path(const std::string &source_path, [[nodiscard]] virtual auto get_api_path(const std::string &source_path,
std::string &api_path) const std::string &api_path) const
-> api_error = 0; -> api_error = 0;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -67,50 +67,54 @@ private:
rocksdb::Transaction *txn) -> rocksdb::Status; rocksdb::Transaction *txn) -> rocksdb::Status;
public: public:
[[nodiscard]] auto [[nodiscard]] auto add_directory(const std::string &api_path,
add_directory(const std::string &api_path, const std::string &source_path)
const std::string &source_path) -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto add_or_update_file(const i_file_db::file_data &data)
add_or_update_file(const i_file_db::file_data &data) -> api_error override; -> api_error override;
void clear() override; void clear() override;
[[nodiscard]] auto count() const -> std::uint64_t override; [[nodiscard]] auto count() const -> std::uint64_t override;
[[nodiscard]] auto void enumerate_item_list(
get_api_path(const std::string &source_path, std::function<void(const std::vector<i_file_db::file_info> &)> callback,
std::string &api_path) const -> api_error override; stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto [[nodiscard]] auto get_api_path(const std::string &source_path,
get_directory_api_path(const std::string &source_path, std::string &api_path) const
std::string &api_path) const -> api_error override; -> api_error override;
[[nodiscard]] auto get_directory_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_directory_source_path(const std::string &api_path, [[nodiscard]] auto get_directory_source_path(const std::string &api_path,
std::string &source_path) const std::string &source_path) const
-> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto get_file_api_path(const std::string &source_path,
get_file_api_path(const std::string &source_path, std::string &api_path) const
std::string &api_path) const -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto get_file_data(const std::string &api_path,
get_file_data(const std::string &api_path, i_file_db::file_data &data) const
i_file_db::file_data &data) const -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto get_file_source_path(const std::string &api_path,
get_file_source_path(const std::string &api_path, std::string &source_path) const
std::string &source_path) const -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const
get_item_list() const -> std::vector<i_file_db::file_info> override; -> std::vector<i_file_db::file_info> override;
[[nodiscard]] auto [[nodiscard]] auto get_source_path(const std::string &api_path,
get_source_path(const std::string &api_path, std::string &source_path) const
std::string &source_path) const -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto remove_item(const std::string &api_path)
remove_item(const std::string &api_path) -> api_error override; -> api_error override;
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -80,6 +80,10 @@ private:
public: public:
void clear() override; void clear() override;
void enumerate_api_path_list(
std::function<void(const std::vector<std::string> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path, [[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const std::string &api_path) const
-> api_error override; -> api_error override;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -53,6 +53,10 @@ public:
[[nodiscard]] auto count() const -> std::uint64_t override; [[nodiscard]] auto count() const -> std::uint64_t override;
void enumerate_item_list(
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path, [[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const std::string &api_path) const
-> api_error override; -> api_error override;
@ -77,7 +81,7 @@ public:
std::string &source_path) const std::string &source_path) const
-> api_error override; -> api_error override;
[[nodiscard]] auto get_item_list() const [[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const
-> std::vector<i_file_db::file_info> override; -> std::vector<i_file_db::file_info> override;
[[nodiscard]] auto get_source_path(const std::string &api_path, [[nodiscard]] auto get_source_path(const std::string &api_path,

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -50,6 +50,10 @@ private:
public: public:
void clear() override; void clear() override;
void enumerate_api_path_list(
std::function<void(const std::vector<std::string> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path, [[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const std::string &api_path) const
-> api_error override; -> api_error override;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,12 +22,10 @@
#ifndef REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_ #ifndef REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
#define REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_ #define REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
#include "utils/single_thread_service_base.hpp"
namespace repertory { namespace repertory {
class directory_iterator; class directory_iterator;
class directory_cache final : public single_thread_service_base { class directory_cache final {
public: public:
using execute_callback = std::function<void(directory_iterator &)>; using execute_callback = std::function<void(directory_iterator &)>;
@ -35,13 +33,11 @@ private:
struct open_directory final { struct open_directory final {
std::shared_ptr<directory_iterator> iterator; std::shared_ptr<directory_iterator> iterator;
std::vector<std::uint64_t> handles; std::vector<std::uint64_t> handles;
std::chrono::system_clock::time_point last_update{
std::chrono::system_clock::now()};
}; };
public: public:
directory_cache() : single_thread_service_base("directory_cache") {} directory_cache() = default;
~directory_cache() override = default; ~directory_cache() = default;
directory_cache(const directory_cache &) = delete; directory_cache(const directory_cache &) = delete;
directory_cache(directory_cache &&) = delete; directory_cache(directory_cache &&) = delete;
@ -51,10 +47,6 @@ public:
private: private:
std::unordered_map<std::string, open_directory> directory_lookup_; std::unordered_map<std::string, open_directory> directory_lookup_;
std::recursive_mutex directory_mutex_; std::recursive_mutex directory_mutex_;
std::unique_ptr<std::thread> refresh_thread_;
protected:
void service_function() override;
public: public:
void execute_action(const std::string &api_path, void execute_action(const std::string &api_path,
@ -63,7 +55,7 @@ public:
[[nodiscard]] auto get_directory(std::uint64_t handle) [[nodiscard]] auto get_directory(std::uint64_t handle)
-> std::shared_ptr<directory_iterator>; -> std::shared_ptr<directory_iterator>;
[[nodiscard]] auto remove_directory(const std::string &api_path) auto remove_directory(const std::string &api_path)
-> std::shared_ptr<directory_iterator>; -> std::shared_ptr<directory_iterator>;
void remove_directory(std::uint64_t handle); void remove_directory(std::uint64_t handle);

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -24,7 +24,7 @@
#if !defined(_WIN32) #if !defined(_WIN32)
#include "events/event_system.hpp" #include "events/event_system.hpp"
#include "utils/path.hpp" #include "types/repertory.hpp"
namespace repertory { namespace repertory {
class app_config; class app_config;
@ -51,8 +51,8 @@ private:
std::string mount_location_; std::string mount_location_;
protected: protected:
bool atime_enabled_ = true; bool atime_enabled_{true};
bool console_enabled_ = false; bool console_enabled_{false};
std::optional<gid_t> forced_gid_; std::optional<gid_t> forced_gid_;
std::optional<uid_t> forced_uid_; std::optional<uid_t> forced_uid_;
std::optional<mode_t> forced_umask_; std::optional<mode_t> forced_umask_;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -63,99 +63,105 @@ private:
std::shared_ptr<logging_consumer> logging_consumer_; std::shared_ptr<logging_consumer> logging_consumer_;
std::shared_ptr<remote_fuse::remote_server> remote_server_; std::shared_ptr<remote_fuse::remote_server> remote_server_;
std::shared_ptr<full_server> server_; std::shared_ptr<full_server> server_;
bool was_mounted_ = false; std::mutex stop_all_mtx_;
bool was_mounted_{false};
private: private:
void update_accessed_time(const std::string &api_path); void update_accessed_time(const std::string &api_path);
void stop_all();
protected: protected:
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto chflags_impl(std::string api_path, [[nodiscard]] auto chflags_impl(std::string api_path, uint32_t flags)
uint32_t flags) -> api_error override; -> api_error override;
#endif // __APPLE__ #endif // __APPLE__
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto [[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode,
chmod_impl(std::string api_path, mode_t mode, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto chmod_impl(std::string api_path, [[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode)
mode_t mode) -> api_error override; -> api_error override;
#endif #endif
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto [[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid,
chown_impl(std::string api_path, uid_t uid, gid_t gid, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, [[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid)
gid_t gid) -> api_error override; -> api_error override;
#endif #endif
[[nodiscard]] auto [[nodiscard]] auto create_impl(std::string api_path, mode_t mode,
create_impl(std::string api_path, mode_t mode, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
void destroy_impl(void *ptr) override; void destroy_impl(void *ptr) override;
[[nodiscard]] auto [[nodiscard]] auto fallocate_impl(std::string api_path, int mode,
fallocate_impl(std::string api_path, int mode, off_t offset, off_t length, off_t offset, off_t length,
struct fuse_file_info *file_info) -> api_error override; struct fuse_file_info *file_info)
-> api_error override;
[[nodiscard]] auto [[nodiscard]] auto fgetattr_impl(std::string api_path, struct stat *unix_st,
fgetattr_impl(std::string api_path, struct stat *unix_st, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto [[nodiscard]] auto fsetattr_x_impl(std::string api_path,
fsetattr_x_impl(std::string api_path, struct setattr_x *attr, struct setattr_x *attr,
struct fuse_file_info *file_info) -> api_error override; struct fuse_file_info *file_info)
-> api_error override;
#endif // __APPLE__ #endif // __APPLE__
[[nodiscard]] auto [[nodiscard]] auto fsync_impl(std::string api_path, int datasync,
fsync_impl(std::string api_path, int datasync, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#if FUSE_USE_VERSION < 30 #if FUSE_USE_VERSION < 30
[[nodiscard]] auto [[nodiscard]] auto ftruncate_impl(std::string api_path, off_t size,
ftruncate_impl(std::string api_path, off_t size, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#endif #endif
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto [[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st,
getattr_impl(std::string api_path, struct stat *unix_st, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto getattr_impl(std::string api_path, [[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st)
struct stat *unix_st) -> api_error override; -> api_error override;
#endif #endif
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto [[nodiscard]] auto getxtimes_impl(std::string api_path,
getxtimes_impl(std::string api_path, struct timespec *bkuptime, struct timespec *bkuptime,
struct timespec *crtime) -> api_error override; struct timespec *crtime)
-> api_error override;
#endif // __APPLE__ #endif // __APPLE__
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto init_impl(struct fuse_conn_info *conn, auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
struct fuse_config *cfg) -> void * override; -> void * override;
#else #else
auto init_impl(struct fuse_conn_info *conn) -> void * override; auto init_impl(struct fuse_conn_info *conn) -> void * override;
#endif #endif
[[nodiscard]] auto mkdir_impl(std::string api_path, [[nodiscard]] auto mkdir_impl(std::string api_path, mode_t mode)
mode_t mode) -> api_error override; -> api_error override;
void notify_fuse_main_exit(int &ret) override; void notify_fuse_main_exit(int &ret) override;
[[nodiscard]] auto [[nodiscard]] auto open_impl(std::string api_path,
open_impl(std::string api_path, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto opendir_impl(std::string api_path,
opendir_impl(std::string api_path, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
[[nodiscard]] auto read_impl(std::string api_path, char *buffer, [[nodiscard]] auto read_impl(std::string api_path, char *buffer,
size_t read_size, off_t read_offset, size_t read_size, off_t read_offset,
@ -163,29 +169,30 @@ protected:
std::size_t &bytes_read) -> api_error override; std::size_t &bytes_read) -> api_error override;
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto [[nodiscard]] auto readdir_impl(std::string api_path, void *buf,
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir, fuse_fill_dir_t fuse_fill_dir, off_t offset,
off_t offset, struct fuse_file_info *file_info, struct fuse_file_info *file_info,
fuse_readdir_flags flags) -> api_error override; fuse_readdir_flags flags)
-> api_error override;
#else #else
[[nodiscard]] auto [[nodiscard]] auto readdir_impl(std::string api_path, void *buf,
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir, fuse_fill_dir_t fuse_fill_dir, off_t offset,
off_t offset, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#endif #endif
[[nodiscard]] auto [[nodiscard]] auto release_impl(std::string api_path,
release_impl(std::string api_path, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto releasedir_impl(std::string api_path,
releasedir_impl(std::string api_path, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto rename_impl(std::string from_api_path, [[nodiscard]] auto rename_impl(std::string from_api_path,
std::string to_api_path, std::string to_api_path, unsigned int flags)
unsigned int flags) -> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto rename_impl(std::string from_api_path, [[nodiscard]] auto rename_impl(std::string from_api_path,
std::string to_api_path) -> api_error override; std::string to_api_path) -> api_error override;
@ -196,8 +203,8 @@ protected:
#if defined(HAS_SETXATTR) #if defined(HAS_SETXATTR)
[[nodiscard]] auto getxattr_common(std::string api_path, const char *name, [[nodiscard]] auto getxattr_common(std::string api_path, const char *name,
char *value, size_t size, char *value, size_t size,
int &attribute_size, int &attribute_size, uint32_t *position)
uint32_t *position) -> api_error; -> api_error;
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
@ -213,8 +220,8 @@ protected:
size_t size, int &required_size, size_t size, int &required_size,
bool &return_size) -> api_error override; bool &return_size) -> api_error override;
[[nodiscard]] auto removexattr_impl(std::string api_path, [[nodiscard]] auto removexattr_impl(std::string api_path, const char *name)
const char *name) -> api_error override; -> api_error override;
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
@ -222,62 +229,64 @@ protected:
uint32_t position) -> api_error override; uint32_t position) -> api_error override;
#else // __APPLE__ #else // __APPLE__
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
const char *value, size_t size, const char *value, size_t size, int flags)
int flags) -> api_error override; -> api_error override;
#endif // __APPLE__ #endif // __APPLE__
#endif // HAS_SETXATTR #endif // HAS_SETXATTR
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto [[nodiscard]] auto setattr_x_impl(std::string api_path,
setattr_x_impl(std::string api_path, struct setattr_x *attr)
struct setattr_x *attr) -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto setbkuptime_impl(std::string api_path,
setbkuptime_impl(std::string api_path, const struct timespec *bkuptime)
const struct timespec *bkuptime) -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto setchgtime_impl(std::string api_path,
setchgtime_impl(std::string api_path, const struct timespec *chgtime)
const struct timespec *chgtime) -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto setcrtime_impl(std::string api_path,
setcrtime_impl(std::string api_path, const struct timespec *crtime)
const struct timespec *crtime) -> api_error override; -> api_error override;
[[nodiscard]] auto setvolname_impl(const char *volname) -> api_error override; [[nodiscard]] auto setvolname_impl(const char *volname) -> api_error override;
[[nodiscard]] auto statfs_x_impl(std::string api_path, [[nodiscard]] auto statfs_x_impl(std::string api_path, struct statfs *stbuf)
struct statfs *stbuf) -> api_error override; -> api_error override;
#else // __APPLE__ #else // __APPLE__
[[nodiscard]] auto statfs_impl(std::string api_path, [[nodiscard]] auto statfs_impl(std::string api_path, struct statvfs *stbuf)
struct statvfs *stbuf) -> api_error override; -> api_error override;
#endif // __APPLE__ #endif // __APPLE__
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto [[nodiscard]] auto truncate_impl(std::string api_path, off_t size,
truncate_impl(std::string api_path, off_t size, struct fuse_file_info *file_info)
struct fuse_file_info *file_info) -> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto truncate_impl(std::string api_path, [[nodiscard]] auto truncate_impl(std::string api_path, off_t size)
off_t size) -> api_error override; -> api_error override;
#endif #endif
[[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override; [[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override;
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto [[nodiscard]] auto utimens_impl(std::string api_path,
utimens_impl(std::string api_path, const struct timespec tv[2], const struct timespec tv[2],
struct fuse_file_info *file_info) -> api_error override; struct fuse_file_info *file_info)
-> api_error override;
#else #else
[[nodiscard]] auto [[nodiscard]] auto utimens_impl(std::string api_path,
utimens_impl(std::string api_path, const struct timespec tv[2])
const struct timespec tv[2]) -> api_error override; -> api_error override;
#endif #endif
[[nodiscard]] auto [[nodiscard]] auto write_impl(std::string api_path, const char *buffer,
write_impl(std::string api_path, const char *buffer, size_t write_size, size_t write_size, off_t write_offset,
off_t write_offset, struct fuse_file_info *file_info, struct fuse_file_info *file_info,
std::size_t &bytes_written) -> api_error override; std::size_t &bytes_written)
-> api_error override;
public: public:
[[nodiscard]] auto get_directory_item_count(const std::string &api_path) const [[nodiscard]] auto get_directory_item_count(const std::string &api_path) const
@ -286,16 +295,17 @@ public:
[[nodiscard]] auto get_directory_items(const std::string &api_path) const [[nodiscard]] auto get_directory_items(const std::string &api_path) const
-> directory_item_list override; -> directory_item_list override;
[[nodiscard]] auto [[nodiscard]] auto get_file_size(const std::string &api_path) const
get_file_size(const std::string &api_path) const -> std::uint64_t override; -> std::uint64_t override;
[[nodiscard]] auto [[nodiscard]] auto get_item_meta(const std::string &api_path,
get_item_meta(const std::string &api_path, api_meta_map &meta) const
api_meta_map &meta) const -> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto get_item_meta(const std::string &api_path,
get_item_meta(const std::string &api_path, const std::string &name, const std::string &name,
std::string &value) const -> api_error override; std::string &value) const
-> api_error override;
[[nodiscard]] auto get_total_drive_space() const -> std::uint64_t override; [[nodiscard]] auto get_total_drive_space() const -> std::uint64_t override;
@ -306,19 +316,22 @@ public:
void get_volume_info(UINT64 &total_size, UINT64 &free_size, void get_volume_info(UINT64 &total_size, UINT64 &free_size,
std::string &volume_label) const override; std::string &volume_label) const override;
[[nodiscard]] auto [[nodiscard]] auto is_processing(const std::string &api_path) const
is_processing(const std::string &api_path) const -> bool override; -> bool override;
[[nodiscard]] auto [[nodiscard]] auto rename_directory(const std::string &from_api_path,
rename_directory(const std::string &from_api_path, const std::string &to_api_path)
const std::string &to_api_path) -> int override; -> int override;
[[nodiscard]] auto rename_file(const std::string &from_api_path, [[nodiscard]] auto rename_file(const std::string &from_api_path,
const std::string &to_api_path, const std::string &to_api_path, bool overwrite)
bool overwrite) -> int override; -> int override;
void set_item_meta(const std::string &api_path, const std::string &key, void set_item_meta(const std::string &api_path, const std::string &key,
const std::string &value) override; const std::string &value) override;
void set_item_meta(const std::string &api_path,
const api_meta_map &meta) override;
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -30,29 +30,32 @@ class i_fuse_drive {
INTERFACE_SETUP(i_fuse_drive); INTERFACE_SETUP(i_fuse_drive);
public: public:
[[nodiscard]] virtual auto [[nodiscard]] virtual auto check_owner(const std::string &api_path) const
check_owner(const std::string &api_path) const -> api_error = 0; -> api_error = 0;
[[nodiscard]] virtual auto check_parent_access(const std::string &api_path,
int mask) const
-> api_error = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
check_parent_access(const std::string &api_path, get_directory_item_count(const std::string &api_path) const
int mask) const -> api_error = 0; -> std::uint64_t = 0;
[[nodiscard]] virtual auto get_directory_item_count(
const std::string &api_path) const -> std::uint64_t = 0;
[[nodiscard]] virtual auto get_directory_items(
const std::string &api_path) const -> directory_item_list = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
get_file_size(const std::string &api_path) const -> std::uint64_t = 0; get_directory_items(const std::string &api_path) const
-> directory_item_list = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto get_file_size(const std::string &api_path) const
get_item_meta(const std::string &api_path, -> std::uint64_t = 0;
api_meta_map &meta) const -> api_error = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
get_item_meta(const std::string &api_path, const std::string &name, api_meta_map &meta) const
std::string &value) const -> api_error = 0; -> api_error = 0;
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
const std::string &name,
std::string &value) const
-> api_error = 0;
[[nodiscard]] virtual auto get_total_drive_space() const -> std::uint64_t = 0; [[nodiscard]] virtual auto get_total_drive_space() const -> std::uint64_t = 0;
@ -63,12 +66,12 @@ public:
virtual void get_volume_info(UINT64 &total_size, UINT64 &free_size, virtual void get_volume_info(UINT64 &total_size, UINT64 &free_size,
std::string &volume_label) const = 0; std::string &volume_label) const = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto is_processing(const std::string &api_path) const
is_processing(const std::string &api_path) const -> bool = 0; -> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto rename_directory(const std::string &from_api_path,
rename_directory(const std::string &from_api_path, const std::string &to_api_path)
const std::string &to_api_path) -> int = 0; -> int = 0;
[[nodiscard]] virtual auto rename_file(const std::string &from_api_path, [[nodiscard]] virtual auto rename_file(const std::string &from_api_path,
const std::string &to_api_path, const std::string &to_api_path,
@ -77,6 +80,9 @@ public:
virtual void set_item_meta(const std::string &api_path, virtual void set_item_meta(const std::string &api_path,
const std::string &key, const std::string &key,
const std::string &value) = 0; const std::string &value) = 0;
virtual void set_item_meta(const std::string &api_path,
const api_meta_map &meta) = 0;
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -53,8 +53,8 @@ private:
bool was_mounted_ = false; bool was_mounted_ = false;
private: private:
void populate_stat(const remote::stat &r_stat, bool directory, static void populate_stat(const remote::stat &r_stat, bool directory,
struct stat &unix_st); struct stat &unix_st);
protected: protected:
[[nodiscard]] auto access_impl(std::string api_path, [[nodiscard]] auto access_impl(std::string api_path,

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -59,7 +59,8 @@ private:
static void populate_stat(const struct stat64 &unix_st, remote::stat &r_stat); static void populate_stat(const struct stat64 &unix_st, remote::stat &r_stat);
[[nodiscard]] auto update_to_windows_format(json &item) -> json &; [[nodiscard]] auto update_to_windows_format(const std::string &root_api_path,
json &item) -> json &;
public: public:
// FUSE Layer // FUSE Layer

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -30,7 +30,10 @@
#include "drives/remote/remote_open_file_table.hpp" #include "drives/remote/remote_open_file_table.hpp"
#include "drives/winfsp/remotewinfsp/i_remote_instance.hpp" #include "drives/winfsp/remotewinfsp/i_remote_instance.hpp"
#include "events/event_system.hpp" #include "events/event_system.hpp"
#include "events/events.hpp" #include "events/types/service_start_begin.hpp"
#include "events/types/service_start_end.hpp"
#include "events/types/service_stop_begin.hpp"
#include "events/types/service_stop_end.hpp"
#include "types/remote.hpp" #include "types/remote.hpp"
#include "types/repertory.hpp" #include "types/repertory.hpp"
#include "utils/base64.hpp" #include "utils/base64.hpp"
@ -55,7 +58,10 @@ public:
drive_(drv), drive_(drv),
mount_location_(std::move(mount_location)), mount_location_(std::move(mount_location)),
client_pool_(config.get_remote_mount().client_pool_size) { client_pool_(config.get_remote_mount().client_pool_size) {
event_system::instance().raise<service_started>("remote_server_base"); REPERTORY_USES_FUNCTION_NAME();
event_system::instance().raise<service_start_begin>(function_name,
"remote_server_base");
handler_lookup_.insert( handler_lookup_.insert(
{"::winfsp_can_delete", {"::winfsp_can_delete",
[this](std::uint32_t, const std::string &, std::uint64_t, [this](std::uint32_t, const std::string &, std::uint64_t,
@ -137,14 +143,17 @@ public:
allocation_size, &file_desc, &file_info, allocation_size, &file_desc, &file_info,
normalized_name, exists); normalized_name, exists);
if (ret == STATUS_SUCCESS) { if (ret == STATUS_SUCCESS) {
if (exists == 0U) {
#if defined(_WIN32) #if defined(_WIN32)
this->set_client_id(file_desc, client_id); this->set_client_id(file_desc, client_id);
#else // !defined(_WIN32) #else // !defined(_WIN32)
this->set_client_id( this->set_client_id(
static_cast<native_handle>( static_cast<native_handle>(
reinterpret_cast<std::uintptr_t>(file_desc)), reinterpret_cast<std::uintptr_t>(file_desc)),
client_id); client_id);
#endif // defined(_WIN32) #endif // defined(_WIN32)
}
response.encode(file_desc); response.encode(file_desc);
response.encode(file_info); response.encode(file_info);
response.encode(normalized_name); response.encode(normalized_name);
@ -337,15 +346,16 @@ public:
DECODE_OR_RETURN(request, length); DECODE_OR_RETURN(request, length);
data_buffer buffer(length); data_buffer buffer(length);
UINT32 bytes_transferred{0}; UINT32 bytes_transferred{0U};
ret = this->winfsp_read(file_desc, buffer.data(), offset, length, ret = this->winfsp_read(file_desc, buffer.data(), offset, length,
&bytes_transferred); &bytes_transferred);
if (ret == STATUS_SUCCESS) { response.encode(bytes_transferred);
response.encode(bytes_transferred); buffer.resize(bytes_transferred);
if (bytes_transferred != 0U) {
response.encode(buffer.data(), bytes_transferred); if ((ret == STATUS_SUCCESS) && (bytes_transferred != 0U)) {
} response.encode(buffer.data(), bytes_transferred);
} }
return ret; return ret;
}}); }});
handler_lookup_.insert( handler_lookup_.insert(
@ -583,8 +593,9 @@ public:
DECODE_OR_RETURN(request, flags); DECODE_OR_RETURN(request, flags);
remote::file_handle handle{}; remote::file_handle handle{};
if ((ret = this->fuse_create(path.data(), mode, flags, handle)) >=
0) { ret = this->fuse_create(path.data(), mode, flags, handle);
if (ret >= 0) {
#if defined(_WIN32) #if defined(_WIN32)
this->set_compat_client_id(handle, client_id); this->set_compat_client_id(handle, client_id);
#else // !defined(_WIN32) #else // !defined(_WIN32)
@ -840,7 +851,8 @@ public:
DECODE_OR_RETURN(request, flags); DECODE_OR_RETURN(request, flags);
remote::file_handle handle; remote::file_handle handle;
if ((ret = this->fuse_open(path.c_str(), flags, handle)) >= 0) { ret = this->fuse_open(path.c_str(), flags, handle);
if (ret >= 0) {
#if defined(_WIN32) #if defined(_WIN32)
this->set_compat_client_id(handle, client_id); this->set_compat_client_id(handle, client_id);
#else // !defined(_WIN32) #else // !defined(_WIN32)
@ -861,7 +873,8 @@ public:
DECODE_OR_RETURN(request, path); DECODE_OR_RETURN(request, path);
remote::file_handle handle{0}; remote::file_handle handle{0};
if ((ret = this->fuse_opendir(path.c_str(), handle)) >= 0) { ret = this->fuse_opendir(path.c_str(), handle);
if (ret >= 0) {
this->add_directory(client_id, handle); this->add_directory(client_id, handle);
response.encode(handle); response.encode(handle);
} }
@ -1372,14 +1385,19 @@ public:
method, request, response, method, request, response,
message_complete); message_complete);
}); });
event_system::instance().raise<service_start_end>(function_name,
"remote_server_base");
} }
~remote_server_base() override { ~remote_server_base() override {
event_system::instance().raise<service_shutdown_begin>( REPERTORY_USES_FUNCTION_NAME();
"remote_server_base");
event_system::instance().raise<service_stop_begin>(function_name,
"remote_server_base");
client_pool_.shutdown(); client_pool_.shutdown();
packet_server_.reset(); packet_server_.reset();
event_system::instance().raise<service_shutdown_end>("remote_server_base"); event_system::instance().raise<service_stop_end>(function_name,
"remote_server_base");
} }
public: public:

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -26,6 +26,7 @@
#include "comm/packet/packet_client.hpp" #include "comm/packet/packet_client.hpp"
#include "drives/remote/remote_open_file_table.hpp" #include "drives/remote/remote_open_file_table.hpp"
#include "drives/winfsp/remotewinfsp/i_remote_instance.hpp" #include "drives/winfsp/remotewinfsp/i_remote_instance.hpp"
#include "types/remote.hpp"
namespace repertory { namespace repertory {
class app_config; class app_config;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -73,6 +73,7 @@ private:
std::unique_ptr<file_manager> fm_; std::unique_ptr<file_manager> fm_;
std::unique_ptr<eviction> eviction_; std::unique_ptr<eviction> eviction_;
std::unique_ptr<remote_winfsp::remote_server> remote_server_; std::unique_ptr<remote_winfsp::remote_server> remote_server_;
std::mutex stop_all_mtx_;
private: private:
[[nodiscard]] auto handle_error(std::string_view function_name, [[nodiscard]] auto handle_error(std::string_view function_name,
@ -94,6 +95,8 @@ private:
static void set_file_info(remote::file_info &dest, static void set_file_info(remote::file_info &dest,
const FSP_FSCTL_FILE_INFO &src); const FSP_FSCTL_FILE_INFO &src);
void stop_all();
public: public:
auto CanDelete(PVOID file_node, PVOID file_desc, PWSTR file_name) auto CanDelete(PVOID file_node, PVOID file_desc, PWSTR file_name)
-> NTSTATUS override; -> NTSTATUS override;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -23,6 +23,7 @@
#define REPERTORY_INCLUDE_EVENTS_CONSUMERS_CONSOLE_CONSUMER_HPP_ #define REPERTORY_INCLUDE_EVENTS_CONSUMERS_CONSOLE_CONSUMER_HPP_
#include "events/event_system.hpp" #include "events/event_system.hpp"
#include "types/repertory.hpp"
namespace repertory { namespace repertory {
class console_consumer final { class console_consumer final {
@ -36,7 +37,7 @@ public:
~console_consumer(); ~console_consumer();
private: private:
void process_event(const event &e) const; static void process_event(const i_event &evt);
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -23,9 +23,10 @@
#define REPERTORY_INCLUDE_EVENTS_CONSUMERS_LOGGING_CONSUMER_HPP_ #define REPERTORY_INCLUDE_EVENTS_CONSUMERS_LOGGING_CONSUMER_HPP_
#include "events/event_system.hpp" #include "events/event_system.hpp"
#include "types/repertory.hpp"
namespace repertory { namespace repertory {
class logging_consumer { class logging_consumer final {
E_CONSUMER(); E_CONSUMER();
public: public:
@ -39,7 +40,7 @@ private:
5ULL}; 5ULL};
private: private:
void process_event(const event &event) const; static void process_event(const i_event &evt);
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,92 +0,0 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_EVENT_HPP_
#define REPERTORY_INCLUDE_EVENTS_EVENT_HPP_
namespace repertory {
enum class event_level {
critical,
error,
warn,
info,
debug,
trace,
};
[[nodiscard]] auto
event_level_from_string(std::string level,
event_level default_level = event_level::info)
-> event_level;
[[nodiscard]] auto event_level_to_string(event_level level) -> std::string;
class event {
protected:
explicit event(bool allow_async) : allow_async_(allow_async) {}
event(const std::stringstream &ss, json j, bool allow_async)
: allow_async_(allow_async), ss_(ss.str()), j_(std::move(j)) {}
public:
event(const event &) = delete;
event(event &&) = delete;
auto operator=(const event &) -> event & = delete;
auto operator=(event &&) -> event & = delete;
virtual ~event() = default;
private:
bool allow_async_;
protected:
std::stringstream ss_;
json j_;
public:
[[nodiscard]] virtual auto clone() const -> std::shared_ptr<event> = 0;
[[nodiscard]] auto get_allow_async() const -> bool { return allow_async_; }
[[nodiscard]] virtual auto get_event_level() const -> event_level = 0;
[[nodiscard]] auto get_json() const -> json { return j_; }
[[nodiscard]] virtual auto get_name() const -> std::string = 0;
[[nodiscard]] virtual auto get_single_line() const -> std::string = 0;
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<std::atomic<repertory::event_level>> {
static void to_json(json &data,
const std::atomic<repertory::event_level> &value) {
data = repertory::event_level_to_string(value.load());
}
static void from_json(const json &data,
std::atomic<repertory::event_level> &value) {
value.store(repertory::event_level_from_string(data.get<std::string>()));
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_EVENT_HPP_

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,200 +22,104 @@
#ifndef REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_ #ifndef REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_
#define REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_ #define REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_
#include "events/event.hpp"
#include "events/t_event_system.hpp"
namespace repertory { namespace repertory {
using event_system = t_event_system<event>; class i_event;
using event_consumer = event_system::event_consumer;
#define E_FROM_API_FILE_ERROR(e) api_error_to_string(e) class event_system final {
#define E_FROM_BOOL(t) std::to_string(t) private:
#define E_FROM_CURL_CODE(t) std::string(curl_easy_strerror(t)) static constexpr const std::uint8_t max_queue_retry{
#define E_FROM_DOUBLE(d) std::to_string(d) 30U,
#define E_FROM_DOUBLE_PRECISE(dbl_val) \ };
([](const double &d) -> std::string { \
std::stringstream ss; \
ss << std::fixed << std::setprecision(2) << d; \
return ss.str(); \
})(dbl_val)
#define E_FROM_INT32(t) std::to_string(t)
#define E_FROM_SIZE_T(t) std::to_string(t)
#define E_FROM_STRING(t) t
#define E_FROM_UINT16(t) std::to_string(t)
#define E_FROM_UINT64(t) std::to_string(t)
#define E_FROM_DOWNLOAD_TYPE(t) download_type_to_string(t)
#define E_PROP(type, name, short_name, ts) \ const std::uint32_t max_queue_size{
private: \ std::thread::hardware_concurrency() * 4U,
void init_##short_name(const type &val) { \ };
auto ts_val = ts(val); \
ss_ << "|" << #short_name << "|" << ts_val; \
j_[#name] = ts_val; \
} \
\
public: \
[[nodiscard]] auto get_##name() const->json { return j_[#name]; }
#define E_BEGIN(name, el) \ static constexpr const std::chrono::seconds queue_wait_secs{
class name final : public virtual event { \ 5s,
private: \ };
name(const std::stringstream &ss, const json &j, bool allow_async) \
: event(ss, j, allow_async) {} \ public:
\ event_system(const event_system &) = delete;
public: \ event_system(event_system &&) = delete;
~name() override = default; \ auto operator=(const event_system &) -> event_system & = delete;
\ auto operator=(event_system &&) -> event_system & = delete;
public: \
static const event_level level = event_level::el; \ protected:
\ event_system() = default;
public: \
[[nodiscard]] auto get_name() const -> std::string override { \ ~event_system() { stop(); }
return #name; \
} \ public:
\ class event_consumer final {
[[nodiscard]] auto get_event_level() const -> event_level override { \ public:
return name::level; \ explicit event_consumer(std::function<void(const i_event &)> callback)
} \ : callback_(std::move(callback)) {
\ event_system::instance().attach(this);
[[nodiscard]] auto get_single_line() const -> std::string override { \
const auto s = ss_.str(); \
return get_name() + (s.empty() ? "" : s); \
} \
\
[[nodiscard]] auto clone() const -> std::shared_ptr<event> override { \
return std::shared_ptr<name>(new name(ss_, j_, get_allow_async())); \
} }
#define E_END() }
#define E_SIMPLE(event_name, el, allow_async) \ event_consumer(std::string_view event_name,
E_BEGIN(event_name, el) \ std::function<void(const i_event &)> callback)
public: \ : callback_(std::move(callback)) {
event_name() : event(allow_async) {} \ event_system::instance().attach(event_name, this);
E_END() }
#define E_SIMPLE1(event_name, el, allow_async, type, name, short_name, tc) \ ~event_consumer() { event_system::instance().release(this); }
E_BEGIN(event_name, el) \
explicit event_name(const type &tv) : event(allow_async) { \
init_##short_name(tv); \
} \
E_PROP(type, name, short_name, tc) \
E_END()
#define E_SIMPLE2(event_name, el, allow_async, type, name, short_name, tc, \ public:
type2, name2, short_name2, tc2) \ event_consumer(const event_consumer &) = delete;
E_BEGIN(event_name, el) \ event_consumer(event_consumer &&) = delete;
explicit event_name(const type &tv, const type2 &tv2) : event(allow_async) { \ auto operator=(const event_consumer &) -> event_consumer & = delete;
init_##short_name(tv); \ auto operator=(event_consumer &&) -> event_consumer & = delete;
init_##short_name2(tv2); \
} \
E_PROP(type, name, short_name, tc) \
E_PROP(type2, name2, short_name2, tc2) \
E_END()
#define E_SIMPLE3(event_name, el, allow_async, type, name, short_name, tc, \ private:
type2, name2, short_name2, tc2, type3, name3, short_name3, \ std::function<void(const i_event &)> callback_;
tc3) \
E_BEGIN(event_name, el) \
explicit event_name(const type &tv, const type2 &tv2, const type3 &tv3) \
: event(allow_async) { \
init_##short_name(tv); \
init_##short_name2(tv2); \
init_##short_name3(tv3); \
} \
E_PROP(type, name, short_name, tc) \
E_PROP(type2, name2, short_name2, tc2) \
E_PROP(type3, name3, short_name3, tc3) \
E_END()
#define E_SIMPLE4(event_name, el, allow_async, type, name, short_name, tc, \ public:
type2, name2, short_name2, tc2, type3, name3, short_name3, \ void notify_event(const i_event &event) { callback_(event); }
tc3, type4, name4, short_name4, tc4) \ };
E_BEGIN(event_name, el) \
explicit event_name(const type &tv, const type2 &tv2, const type3 &tv3, \
const type4 &tv4) \
: event(allow_async) { \
init_##short_name(tv); \
init_##short_name2(tv2); \
init_##short_name3(tv3); \
init_##short_name4(tv4); \
} \
E_PROP(type, name, short_name, tc) \
E_PROP(type2, name2, short_name2, tc2) \
E_PROP(type3, name3, short_name3, tc3) \
E_PROP(type4, name4, short_name4, tc4) \
E_END()
#define E_SIMPLE5(event_name, el, allow_async, type, name, short_name, tc, \ private:
type2, name2, short_name2, tc2, type3, name3, short_name3, \ static event_system instance_;
tc3, type4, name4, short_name4, tc4, type5, name5, \
short_name5, tc5) \
E_BEGIN(event_name, el) \
explicit event_name(const type &tv, const type2 &tv2, const type3 &tv3, \
const type4 &tv4, const type5 &tv5) \
: event(allow_async) { \
init_##short_name(tv); \
init_##short_name2(tv2); \
init_##short_name3(tv3); \
init_##short_name4(tv4); \
init_##short_name5(tv5); \
} \
E_PROP(type, name, short_name, tc) \
E_PROP(type2, name2, short_name2, tc2) \
E_PROP(type3, name3, short_name3, tc3) \
E_PROP(type4, name4, short_name4, tc4) \
E_PROP(type5, name5, short_name5, tc5) \
E_END()
#define E_SIMPLE6(event_name, el, allow_async, type, name, short_name, tc, \ public:
type2, name2, short_name2, tc2, type3, name3, short_name3, \ [[nodiscard]] static auto instance() -> event_system &;
tc3, type4, name4, short_name4, tc4, type5, name5, \
short_name5, tc5, type6, name6, short_name6, tc6) \
E_BEGIN(event_name, el) \
explicit event_name(const type &tv, const type2 &tv2, const type3 &tv3, \
const type4 &tv4, const type5 &tv5, const type6 &tv6) \
: event(allow_async) { \
init_##short_name(tv); \
init_##short_name2(tv2); \
init_##short_name3(tv3); \
init_##short_name4(tv4); \
init_##short_name5(tv5); \
init_##short_name6(tv6); \
} \
E_PROP(type, name, short_name, tc) \
E_PROP(type2, name2, short_name2, tc2) \
E_PROP(type3, name3, short_name3, tc3) \
E_PROP(type4, name4, short_name4, tc4) \
E_PROP(type5, name5, short_name5, tc5) \
E_PROP(type6, name6, short_name6, tc6) \
E_END()
#define E_SIMPLE7(event_name, el, allow_async, type, name, short_name, tc, \ private:
type2, name2, short_name2, tc2, type3, name3, short_name3, \ std::unordered_map<std::string, std::deque<event_consumer *>>
tc3, type4, name4, short_name4, tc4, type5, name5, \ event_consumers_;
short_name5, tc5, type6, name6, short_name6, tc6, type7, \ std::recursive_mutex consumer_mutex_;
name7, short_name7, tc7) \ std::vector<std::shared_ptr<i_event>> event_list_;
E_BEGIN(event_name, el) \ std::condition_variable event_notify_;
explicit event_name(const type &tv, const type2 &tv2, const type3 &tv3, \ std::mutex event_mutex_;
const type4 &tv4, const type5 &tv5, const type6 &tv6, \ std::unique_ptr<std::thread> event_thread_;
const type7 &tv7) \ std::mutex run_mutex_;
: event(allow_async) { \ stop_type stop_requested_{false};
init_##short_name(tv); \
init_##short_name2(tv2); \ private:
init_##short_name3(tv3); \ [[nodiscard]] auto get_stop_requested() const -> bool;
init_##short_name4(tv4); \
init_##short_name5(tv5); \ void process_events();
init_##short_name6(tv6); \
init_##short_name7(tv7); \ void queue_event(std::shared_ptr<i_event> evt);
} \
E_PROP(type, name, short_name, tc) \ public:
E_PROP(type2, name2, short_name2, tc2) \ void attach(event_consumer *consumer);
E_PROP(type3, name3, short_name3, tc3) \
E_PROP(type4, name4, short_name4, tc4) \ void attach(std::string_view event_name, event_consumer *consumer);
E_PROP(type5, name5, short_name5, tc5) \
E_PROP(type6, name6, short_name6, tc6) \ template <typename evt_t, typename... arg_t> void raise(arg_t &&...args) {
E_PROP(type7, name7, short_name7, tc7) \ queue_event(std::make_shared<evt_t>(std::forward<arg_t>(args)...));
E_END() }
void release(event_consumer *consumer);
void start();
void stop();
};
using event_consumer = event_system::event_consumer;
#define E_CONSUMER() \ #define E_CONSUMER() \
private: \ private: \
@ -223,19 +127,15 @@ private: \
#define E_CONSUMER_RELEASE() event_consumers_.clear() #define E_CONSUMER_RELEASE() event_consumers_.clear()
#define E_SUBSCRIBE(name, callback) \ #define E_SUBSCRIBE(event, callback) \
event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \ event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \
#name, [this](const event &evt) { callback(evt); })) event::name, [this](const i_event &evt) { \
callback(dynamic_cast<const event &>(evt)); \
#define E_SUBSCRIBE_EXACT(name, callback) \
event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \
#name, [this](const event &evt) { \
callback(dynamic_cast<const name &>(evt)); \
})) }))
#define E_SUBSCRIBE_ALL(callback) \ #define E_SUBSCRIBE_ALL(callback) \
event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \ event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \
[this](const event &evt) { callback(evt); })) [this](const i_event &evt) { callback(evt); }))
} // namespace repertory } // namespace repertory
#endif // REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_ #endif // REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_

View File

@ -1,295 +0,0 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_EVENTS_HPP_
#define REPERTORY_INCLUDE_EVENTS_EVENTS_HPP_
#include "events/event_system.hpp"
#include "types/repertory.hpp"
#include "utils/utils.hpp"
namespace repertory {
// clang-format off
E_SIMPLE2(curl_error, error, true,
std::string, url, url, E_FROM_STRING,
CURLcode, res, res, E_FROM_CURL_CODE
);
E_SIMPLE3(debug_log, debug, true,
std::string, function, func, E_FROM_STRING,
std::string, api_path, ap, E_FROM_STRING,
std::string, data, data, E_FROM_STRING
);
E_SIMPLE1(directory_removed, info, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE2(directory_removed_externally, warn, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE2(directory_remove_failed, error, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE2(drive_mount_failed, error, true,
std::string, location, loc, E_FROM_STRING,
std::string, result, res, E_FROM_STRING
);
E_SIMPLE1(drive_mounted, info, true,
std::string, location, loc, E_FROM_STRING
);
E_SIMPLE1(drive_mount_result, info, true,
std::string, result, res, E_FROM_STRING
);
E_SIMPLE1(drive_unmount_pending, info, true,
std::string, location, loc, E_FROM_STRING
);
E_SIMPLE1(drive_unmounted, info, true,
std::string, location, loc, E_FROM_STRING
);
E_SIMPLE1(event_level_changed, info, true,
std::string, new_event_level, level, E_FROM_STRING
);
E_SIMPLE1(failed_upload_queued, error, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE1(failed_upload_removed, warn, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE1(failed_upload_retry, info, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE2(file_get_failed, error, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE1(file_get_api_list_failed, error, true,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE1(file_pinned, info, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE3(file_read_bytes_failed, error, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, error, err, E_FROM_STRING,
std::size_t, retry, retry, E_FROM_SIZE_T
);
E_SIMPLE1(file_removed, debug, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE2(file_removed_externally, warn, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE2(file_remove_failed, error, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE3(file_rename_failed, error, true,
std::string, from_api_path, FROM, E_FROM_STRING,
std::string, to_api_path, TO, E_FROM_STRING,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE2(file_get_size_failed, error, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE3(filesystem_item_added, debug, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, parent, parent, E_FROM_STRING,
bool, directory, dir, E_FROM_BOOL
);
E_SIMPLE4(filesystem_item_closed, trace, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING,
bool, directory, dir, E_FROM_BOOL,
bool, changed, changed, E_FROM_BOOL
);
E_SIMPLE5(filesystem_item_handle_closed, trace, true,
std::string, api_path, ap, E_FROM_STRING,
std::uint64_t, handle, handle, E_FROM_UINT64,
std::string, source, src, E_FROM_STRING,
bool, directory, dir, E_FROM_BOOL,
bool, changed, changed, E_FROM_BOOL
);
E_SIMPLE4(filesystem_item_handle_opened, trace, true,
std::string, api_path, ap, E_FROM_STRING,
std::uint64_t, handle, handle, E_FROM_UINT64,
std::string, source, src, E_FROM_STRING,
bool, directory, dir, E_FROM_BOOL
);
E_SIMPLE2(filesystem_item_evicted, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE3(filesystem_item_opened, trace, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING,
bool, directory, dir, E_FROM_BOOL
);
E_SIMPLE1(file_unpinned, info, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE4(file_upload_completed, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING,
api_error, result, res, E_FROM_API_FILE_ERROR,
bool, cancelled, cancel, E_FROM_BOOL
);
E_SIMPLE3(file_upload_failed, error, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING,
std::string, error, err, E_FROM_STRING
);
E_SIMPLE2(file_upload_not_found, warn, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE2(file_upload_queued, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE1(file_upload_removed, debug, true,
std::string, api_path, ap, E_FROM_STRING
);
E_SIMPLE3(file_upload_retry, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING,
api_error, result, res, E_FROM_API_FILE_ERROR
);
E_SIMPLE2(file_upload_started, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE1(orphaned_file_deleted, warn, true,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE1(orphaned_file_detected, warn, true,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE3(orphaned_file_processing_failed, error, true,
std::string, source, src, E_FROM_STRING,
std::string, dest, dest, E_FROM_STRING,
std::string, result, res, E_FROM_STRING
);
E_SIMPLE1(orphaned_source_file_detected, info, true,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE1(orphaned_source_file_removed, info, true,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE1(polling_item_begin, debug, true,
std::string, item_name, item, E_FROM_STRING
);
E_SIMPLE1(polling_item_end, debug, true,
std::string, item_name, item, E_FROM_STRING
);
E_SIMPLE2(provider_offline, error, true,
std::string, host_name_or_ip, host, E_FROM_STRING,
std::uint16_t, port, port, E_FROM_UINT16
);
E_SIMPLE2(provider_upload_begin, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING
);
E_SIMPLE3(provider_upload_end, info, true,
std::string, api_path, ap, E_FROM_STRING,
std::string, source, src, E_FROM_STRING,
api_error, result, res, E_FROM_API_FILE_ERROR
);
E_SIMPLE2(repertory_exception, error, true,
std::string, function, func, E_FROM_STRING,
std::string, message, msg, E_FROM_STRING
);
E_SIMPLE1(rpc_server_exception, error, true,
std::string, exception, exception, E_FROM_STRING
);
E_SIMPLE1(service_shutdown_begin, debug, true,
std::string, service, svc, E_FROM_STRING
);
E_SIMPLE1(service_shutdown_end, debug, true,
std::string, service, svc, E_FROM_STRING
);
E_SIMPLE1(service_started, debug, true,
std::string, service, svc, E_FROM_STRING
);
E_SIMPLE(unmount_requested, info, true);
#if !defined(_WIN32)
E_SIMPLE2(unmount_result, info, true,
std::string, location, loc, E_FROM_STRING,
std::string, result, res, E_FROM_STRING
);
#endif
// clang-format on
} // namespace repertory
#endif // REPERTORY_INCLUDE_EVENTS_EVENTS_HPP_

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -19,23 +19,22 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#ifndef REPERTORY_INCLUDE_DRIVES_FUSE_EVENTS_HPP_ #ifndef REPERTORY_INCLUDE_EVENTS_I_EVENT_HPP_
#define REPERTORY_INCLUDE_DRIVES_FUSE_EVENTS_HPP_ #define REPERTORY_INCLUDE_EVENTS_I_EVENT_HPP_
#include "events/event_system.hpp" #include "types/repertory.hpp"
namespace repertory { namespace repertory {
// clang-format off class i_event {
E_SIMPLE3(fuse_event, debug, true, INTERFACE_SETUP(i_event);
std::string, function, func, E_FROM_STRING,
std::string, api_path, ap, E_FROM_STRING,
int, result, res, E_FROM_INT32
);
E_SIMPLE1(fuse_args_parsed, info, true, public:
std::string, arguments, args, E_FROM_STRING [[nodiscard]] virtual auto get_event_level() const -> event_level = 0;
);
// clang-format on [[nodiscard]] virtual auto get_name() const -> std::string_view = 0;
[[nodiscard]] virtual auto get_single_line() const -> std::string = 0;
};
} // namespace repertory } // namespace repertory
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_EVENTS_HPP_ #endif // REPERTORY_INCLUDE_EVENTS_EVENT_HPP_

View File

@ -1,193 +0,0 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_T_EVENT_SYSTEM_HPP_
#define REPERTORY_INCLUDE_EVENTS_T_EVENT_SYSTEM_HPP_
#include "events/event.hpp"
#include "utils/collection.hpp"
#include "utils/utils.hpp"
namespace repertory {
template <typename event_type> class t_event_system final {
public:
t_event_system(const t_event_system &) = delete;
t_event_system(t_event_system &&) = delete;
auto operator=(const t_event_system &) -> t_event_system & = delete;
auto operator=(t_event_system &&) -> t_event_system & = delete;
protected:
t_event_system() = default;
~t_event_system() { stop(); }
public:
class event_consumer final {
public:
explicit event_consumer(std::function<void(const event &)> callback)
: callback_(std::move(callback)) {
t_event_system::instance().attach(this);
}
event_consumer(const std::string &event_name,
std::function<void(const event &)> callback)
: callback_(std::move(callback)) {
t_event_system::instance().attach(event_name, this);
}
~event_consumer() { t_event_system::instance().release(this); }
public:
event_consumer(const event_consumer &) = delete;
event_consumer(event_consumer &&) = delete;
auto operator=(const event_consumer &) -> event_consumer & = delete;
auto operator=(event_consumer &&) -> event_consumer & = delete;
private:
std::function<void(const event &)> callback_;
public:
void notify_event(const event &event) { callback_(event); }
};
private:
static t_event_system event_system_;
public:
static auto instance() -> t_event_system &;
private:
std::unordered_map<std::string, std::deque<event_consumer *>>
event_consumers_;
std::recursive_mutex consumer_mutex_;
std::vector<std::shared_ptr<event_type>> event_list_;
std::condition_variable event_notify_;
std::mutex event_mutex_;
std::unique_ptr<std::thread> event_thread_;
std::mutex run_mutex_;
stop_type stop_requested_ = false;
private:
void process_events() {
std::vector<std::shared_ptr<event_type>> events;
{
unique_mutex_lock lock(event_mutex_);
if (not stop_requested_ && event_list_.empty()) {
event_notify_.wait_for(lock, 1s);
}
if (not event_list_.empty()) {
events.insert(events.end(), event_list_.begin(), event_list_.end());
event_list_.clear();
}
}
const auto notify_events = [this](const std::string &name,
const event_type &event) {
std::deque<std::future<void>> futures;
recur_mutex_lock lock(consumer_mutex_);
if (event_consumers_.find(name) != event_consumers_.end()) {
for (auto *consumer : event_consumers_[name]) {
if (event.get_allow_async()) {
futures.emplace_back(
std::async(std::launch::async, [consumer, &event]() {
consumer->notify_event(event);
}));
} else {
consumer->notify_event(event);
}
}
}
while (not futures.empty()) {
futures.front().get();
futures.pop_front();
}
};
for (const auto &evt : events) {
notify_events("", *evt.get());
notify_events(evt->get_name(), *evt.get());
}
}
void queue_event(std::shared_ptr<event_type> evt) {
mutex_lock lock(event_mutex_);
event_list_.push_back(std::move(evt));
event_notify_.notify_all();
}
public:
void attach(event_consumer *consumer) {
recur_mutex_lock lock(consumer_mutex_);
event_consumers_[""].push_back(consumer);
}
void attach(const std::string &event_name, event_consumer *consumer) {
recur_mutex_lock lock(consumer_mutex_);
event_consumers_[event_name].push_back(consumer);
}
template <typename event_t, typename... arg_t> void raise(arg_t &&...args) {
queue_event(std::make_shared<event_t>(std::forward<arg_t>(args)...));
}
void release(event_consumer *consumer) {
recur_mutex_lock lock(consumer_mutex_);
auto iter = std::find_if(event_consumers_.begin(), event_consumers_.end(),
[&](const auto &item) -> bool {
return utils::collection::includes(item.second,
consumer);
});
if (iter != event_consumers_.end()) {
utils::collection::remove_element((*iter).second, consumer);
}
}
void start() {
mutex_lock lock(run_mutex_);
if (not event_thread_) {
stop_requested_ = false;
event_thread_ = std::make_unique<std::thread>([this]() {
while (not stop_requested_) {
process_events();
}
});
}
}
void stop() {
mutex_lock lock(run_mutex_);
if (event_thread_) {
stop_requested_ = true;
event_notify_.notify_all();
event_thread_->join();
event_thread_.reset();
process_events();
}
}
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_EVENTS_T_EVENT_SYSTEM_HPP_

View File

@ -0,0 +1,74 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_CURL_ERROR_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_CURL_ERROR_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct curl_error final : public i_event {
curl_error() = default;
curl_error(CURLcode code_, std::string_view function_name_, std::string url_)
: code(code_),
function_name(std::string{function_name_}),
url(std::move(url_)) {}
static constexpr const event_level level{event_level::error};
static constexpr const std::string_view name{"curl_error"};
CURLcode code{};
std::string function_name;
std::string url;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|url|{}|code|{}", name, function_name, url,
static_cast<int>(code));
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::curl_error> {
static void to_json(json &data, const repertory::curl_error &value) {
data["code"] = value.code;
data["function_name"] = value.function_name;
data["url"] = value.url;
}
static void from_json(const json &data, repertory::curl_error &value) {
data.at("code").get_to<CURLcode>(value.code);
data.at("function_name").get_to<std::string>(value.function_name);
data.at("url").get_to<std::string>(value.url);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_CURL_ERROR_HPP_

View File

@ -0,0 +1,68 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DEBUG_LOG_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DEBUG_LOG_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct debug_log final : public i_event {
debug_log() = default;
debug_log(std::string_view function_name_, std::string msg_)
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::debug};
static constexpr const std::string_view name{"debug_log"};
std::string function_name;
std::string msg;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|msg|{}", name, function_name, msg);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::debug_log> {
static void to_json(json &data, const repertory::debug_log &value) {
data["function_name"] = value.function_name;
data["msg"] = value.msg;
}
static void from_json(const json &data, repertory::debug_log &value) {
data.at("function_name").get_to<std::string>(value.function_name);
data.at("msg").get_to<std::string>(value.msg);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DEBUG_LOG_HPP_

View File

@ -0,0 +1,78 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVE_FAILED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVE_FAILED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct directory_remove_failed final : public i_event {
directory_remove_failed() = default;
directory_remove_failed(std::string api_path_, api_error error_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
error(error_),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error};
static constexpr const std::string_view name{"directory_remove_failed"};
std::string api_path;
api_error error{};
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|error|{}", name, function_name,
api_path, api_error_to_string(error));
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::directory_remove_failed> {
static void to_json(json &data,
const repertory::directory_remove_failed &value) {
data["api_path"] = value.api_path;
data["error"] = repertory::api_error_to_string(value.error);
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::directory_remove_failed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
value.error =
repertory::api_error_from_string(data.at("error").get<std::string>());
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVE_FAILED_HPP_

View File

@ -0,0 +1,69 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct directory_removed final : public i_event {
directory_removed() = default;
directory_removed(std::string api_path_, std::string_view function_name_)
: api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug};
static constexpr const std::string_view name{"directory_removed"};
std::string api_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::directory_removed> {
static void to_json(json &data, const repertory::directory_removed &value) {
data["api_path"] = value.api_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::directory_removed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_HPP_

View File

@ -0,0 +1,78 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_EXTERNALLY_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_EXTERNALLY_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct directory_removed_externally final : public i_event {
directory_removed_externally() = default;
directory_removed_externally(std::string api_path_,
std::string_view function_name_,
std::string source_path_)
: api_path(std::move(api_path_)),
function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn};
static constexpr const std::string_view name{"directory_removed_externally"};
std::string api_path;
std::string function_name;
std::string source_path;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|src|{}", name, function_name, api_path,
source_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::directory_removed_externally> {
static void to_json(json &data,
const repertory::directory_removed_externally &value) {
data["api_path"] = value.api_path;
data["function_name"] = value.function_name;
data["source_path"] = value.source_path;
}
static void from_json(const json &data,
repertory::directory_removed_externally &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("function_name").get_to<std::string>(value.function_name);
data.at("source_path").get_to<std::string>(value.source_path);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_EXTERNALLY_HPP_

View File

@ -0,0 +1,75 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_BEGIN_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_BEGIN_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_begin final : public i_event {
download_begin() = default;
download_begin(std::string api_path_, std::string dest_path_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"download_begin"};
std::string api_path;
std::string dest_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
dest_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_begin> {
static void to_json(json &data, const repertory::download_begin &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::download_begin &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_BEGIN_HPP_

View File

@ -0,0 +1,80 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_END_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_END_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_end final : public i_event {
download_end() = default;
download_end(std::string api_path_, std::string dest_path_, api_error error_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
error(error_),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"download_end"};
std::string api_path;
std::string dest_path;
api_error error{};
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}|error|{}", name, function_name,
api_path, dest_path, api_error_to_string(error));
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_end> {
static void to_json(json &data, const repertory::download_end &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["error"] = repertory::api_error_to_string(value.error);
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::download_end &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
value.error =
repertory::api_error_from_string(data.at("error").get<std::string>());
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_END_HPP_

View File

@ -0,0 +1,79 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_PROGRESS_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_PROGRESS_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_progress final : public i_event {
download_progress() = default;
download_progress(std::string api_path_, std::string dest_path_,
std::string_view function_name_, double progress_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)),
progress(progress_) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"download_progress"};
std::string api_path;
std::string dest_path;
std::string function_name;
double progress{};
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}|prog|{}", name, function_name,
api_path, dest_path, progress);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_progress> {
static void to_json(json &data, const repertory::download_progress &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["function_name"] = value.function_name;
data["progress"] = value.progress;
}
static void from_json(const json &data, repertory::download_progress &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("function_name").get_to<std::string>(value.function_name);
data.at("progress").get_to<double>(value.progress);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_PROGRESS_HPP_

View File

@ -0,0 +1,81 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORE_FAILED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORE_FAILED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_restore_failed final : public i_event {
download_restore_failed() = default;
download_restore_failed(std::string api_path_, std::string dest_path_,
std::string error_, std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
error(std::move(error_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error};
static constexpr const std::string_view name{"download_restore_failed"};
std::string api_path;
std::string dest_path;
std::string error;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}|error|{}", name, function_name,
api_path, dest_path, error);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_restore_failed> {
static void to_json(json &data,
const repertory::download_restore_failed &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["error"] = value.error;
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::download_restore_failed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("error").get_to<std::string>(value.error);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORE_FAILED_HPP_

View File

@ -0,0 +1,75 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_restored final : public i_event {
download_restored() = default;
download_restored(std::string api_path_, std::string dest_path_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"download_restored"};
std::string api_path;
std::string dest_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
dest_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_restored> {
static void to_json(json &data, const repertory::download_restored &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::download_restored &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORED_HPP_

View File

@ -0,0 +1,82 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADD_FAILED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADD_FAILED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_resume_add_failed final : public i_event {
download_resume_add_failed() = default;
download_resume_add_failed(std::string api_path_, std::string dest_path_,
std::string error_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
error(std::move(error_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error};
static constexpr const std::string_view name{"download_resume_add_failed"};
std::string api_path;
std::string dest_path;
std::string error;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}|error|{}", name, function_name,
api_path, dest_path, error);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_resume_add_failed> {
static void to_json(json &data,
const repertory::download_resume_add_failed &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["error"] = value.error;
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::download_resume_add_failed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("error").get_to<std::string>(value.error);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADD_FAILED_HPP_

View File

@ -0,0 +1,77 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADDED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADDED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_resume_added final : public i_event {
download_resume_added() = default;
download_resume_added(std::string api_path_, std::string dest_path_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug};
static constexpr const std::string_view name{"download_resume_added"};
std::string api_path;
std::string dest_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
dest_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_resume_added> {
static void to_json(json &data,
const repertory::download_resume_added &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::download_resume_added &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADDED_HPP_

View File

@ -0,0 +1,77 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_REMOVED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_REMOVED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_resume_removed final : public i_event {
download_resume_removed() = default;
download_resume_removed(std::string api_path_, std::string dest_path_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug};
static constexpr const std::string_view name{"download_resume_removed"};
std::string api_path;
std::string dest_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
dest_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_resume_removed> {
static void to_json(json &data,
const repertory::download_resume_removed &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::download_resume_removed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_REMOVED_HPP_

View File

@ -0,0 +1,82 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_TYPE_SELECTED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_TYPE_SELECTED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct download_type_selected final : public i_event {
download_type_selected() = default;
download_type_selected(std::string api_path_, std::string dest_path_,
std::string_view function_name_, download_type type_)
: api_path(std::move(api_path_)),
dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)),
type(type_) {}
static constexpr const event_level level{event_level::debug};
static constexpr const std::string_view name{"download_type_selected"};
std::string api_path;
std::string dest_path;
std::string function_name;
download_type type{};
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|dp|{}|type|{}", name, function_name,
api_path, dest_path, download_type_to_string(type));
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::download_type_selected> {
static void to_json(json &data,
const repertory::download_type_selected &value) {
data["api_path"] = value.api_path;
data["dest_path"] = value.dest_path;
data["function_name"] = value.function_name;
data["type"] = repertory::download_type_to_string(value.type);
}
static void from_json(const json &data,
repertory::download_type_selected &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("dest_path").get_to<std::string>(value.dest_path);
data.at("function_name").get_to<std::string>(value.function_name);
value.type = repertory::download_type_from_string(
data.at("type").get<std::string>());
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_TYPE_SELECTED_HPP_

View File

@ -0,0 +1,78 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_FAILED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_FAILED_HPP_
#if defined(_WIN32)
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct drive_mount_failed final : public i_event {
drive_mount_failed() = default;
drive_mount_failed(NTSTATUS error_, std::string_view function_name_,
std::string mount_location_)
: error(error_),
function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::error};
static constexpr const std::string_view name{"drive_mount_failed"};
NTSTATUS error{};
std::string function_name;
std::string mount_location;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|location|{}|status|{}", name, function_name,
mount_location, error);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::drive_mount_failed> {
static void to_json(json &data, const repertory::drive_mount_failed &value) {
data["error"] = value.error;
data["function_name"] = value.function_name;
data["mount_location"] = value.mount_location;
}
static void from_json(const json &data,
repertory::drive_mount_failed &value) {
data.at("error").get_to<NTSTATUS>(value.error);
data.at("function_name").get_to<std::string>(value.function_name);
data.at("mount_location").get_to<std::string>(value.mount_location);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // defined(_WIN32)
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_FAILED_HPP_

View File

@ -0,0 +1,76 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_RESULT_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_RESULT_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct drive_mount_result final : public i_event {
drive_mount_result() = default;
drive_mount_result(std::string_view function_name_,
std::string mount_location_, std::string result_)
: function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)),
result(std::move(result_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"drive_mount_result"};
std::string function_name;
std::string mount_location;
std::string result;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|location|{}|result|{}", name, function_name,
mount_location, result);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::drive_mount_result> {
static void to_json(json &data, const repertory::drive_mount_result &value) {
data["function_name"] = value.function_name;
data["mount_location"] = value.mount_location;
data["result"] = value.result;
}
static void from_json(const json &data,
repertory::drive_mount_result &value) {
data.at("function_name").get_to<std::string>(value.function_name);
data.at("mount_location").get_to<std::string>(value.mount_location);
data.at("result").get_to<std::string>(value.result);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_RESULT_HPP_

View File

@ -0,0 +1,70 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNTED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNTED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct drive_mounted final : public i_event {
drive_mounted() = default;
drive_mounted(std::string_view function_name_, std::string mount_location_)
: function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"drive_mounted"};
std::string function_name;
std::string mount_location;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|location|{}", name, function_name,
mount_location);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::drive_mounted> {
static void to_json(json &data, const repertory::drive_mounted &value) {
data["function_name"] = value.function_name;
data["mount_location"] = value.mount_location;
}
static void from_json(const json &data, repertory::drive_mounted &value) {
data.at("function_name").get_to<std::string>(value.function_name);
data.at("mount_location").get_to<std::string>(value.mount_location);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNTED_HPP_

View File

@ -0,0 +1,67 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_STOP_TIMED_OUT_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_STOP_TIMED_OUT_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct drive_stop_timed_out final : public i_event {
drive_stop_timed_out() = default;
drive_stop_timed_out(std::string_view function_name_)
: function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::warn};
static constexpr const std::string_view name{"drive_stop_timed_out"};
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}", name, function_name);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::drive_stop_timed_out> {
static void to_json(json &data,
const repertory::drive_stop_timed_out &value) {
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::drive_stop_timed_out &value) {
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_STOP_TIMED_OUT_HPP_

View File

@ -0,0 +1,73 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNT_PENDING_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNT_PENDING_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct drive_unmount_pending final : public i_event {
drive_unmount_pending() = default;
drive_unmount_pending(std::string_view function_name_,
std::string mount_location_)
: function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"drive_unmount_pending"};
std::string function_name;
std::string mount_location;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|location|{}", name, function_name,
mount_location);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::drive_unmount_pending> {
static void to_json(json &data,
const repertory::drive_unmount_pending &value) {
data["function_name"] = value.function_name;
data["mount_location"] = value.mount_location;
}
static void from_json(const json &data,
repertory::drive_unmount_pending &value) {
data.at("function_name").get_to<std::string>(value.function_name);
data.at("mount_location").get_to<std::string>(value.mount_location);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNT_PENDING_HPP_

View File

@ -0,0 +1,70 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNTED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNTED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct drive_unmounted final : public i_event {
drive_unmounted() = default;
drive_unmounted(std::string_view function_name_, std::string mount_location_)
: function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"drive_unmounted"};
std::string function_name;
std::string mount_location;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|location|{}", name, function_name,
mount_location);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::drive_unmounted> {
static void to_json(json &data, const repertory::drive_unmounted &value) {
data["function_name"] = value.function_name;
data["mount_location"] = value.mount_location;
}
static void from_json(const json &data, repertory::drive_unmounted &value) {
data.at("function_name").get_to<std::string>(value.function_name);
data.at("mount_location").get_to<std::string>(value.mount_location);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNTED_HPP_

View File

@ -0,0 +1,71 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_EVENT_LEVEL_CHANGED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_EVENT_LEVEL_CHANGED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct event_level_changed final : public i_event {
event_level_changed() = default;
event_level_changed(std::string_view function_name_, event_level new_level_)
: function_name(std::string(function_name_)), new_level(new_level_) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"event_level_changed"};
std::string function_name;
event_level new_level{};
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|level|{}", name, function_name,
event_level_to_string(new_level));
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::event_level_changed> {
static void to_json(json &data, const repertory::event_level_changed &value) {
data["new_level"] = repertory::event_level_to_string(value.new_level);
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::event_level_changed &value) {
value.new_level = repertory::event_level_from_string(
data.at("new_level").get<std::string>());
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_EVENT_LEVEL_CHANGED_HPP_

View File

@ -0,0 +1,69 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_PINNED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_PINNED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct file_pinned final : public i_event {
file_pinned() = default;
file_pinned(std::string api_path_, std::string_view function_name_)
: api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"file_pinned"};
std::string api_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::file_pinned> {
static void to_json(json &data, const repertory::file_pinned &value) {
data["api_path"] = value.api_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::file_pinned &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_PINNED_HPP_

View File

@ -0,0 +1,77 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVE_FAILED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVE_FAILED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct file_remove_failed final : public i_event {
file_remove_failed() = default;
file_remove_failed(std::string api_path_, api_error error_,
std::string_view function_name_)
: api_path(std::move(api_path_)),
error(error_),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error};
static constexpr const std::string_view name{"file_remove_failed"};
std::string api_path;
api_error error{};
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|error|{}", name, function_name,
api_path, api_error_to_string(error));
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::file_remove_failed> {
static void to_json(json &data, const repertory::file_remove_failed &value) {
data["api_path"] = value.api_path;
data["error"] = repertory::api_error_to_string(value.error);
data["function_name"] = value.function_name;
}
static void from_json(const json &data,
repertory::file_remove_failed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
value.error =
repertory::api_error_from_string(data.at("error").get<std::string>());
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVE_FAILED_HPP_

View File

@ -0,0 +1,69 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct file_removed final : public i_event {
file_removed() = default;
file_removed(std::string api_path_, std::string_view function_name_)
: api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug};
static constexpr const std::string_view name{"file_removed"};
std::string api_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::file_removed> {
static void to_json(json &data, const repertory::file_removed &value) {
data["api_path"] = value.api_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::file_removed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_HPP_

View File

@ -0,0 +1,78 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_EXTERNALLY_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_EXTERNALLY_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct file_removed_externally final : public i_event {
file_removed_externally() = default;
file_removed_externally(std::string api_path_,
std::string_view function_name_,
std::string source_path_)
: api_path(std::move(api_path_)),
function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn};
static constexpr const std::string_view name{"file_removed_externally"};
std::string api_path;
std::string function_name;
std::string source_path;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|src|{}", name, function_name, api_path,
source_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::file_removed_externally> {
static void to_json(json &data,
const repertory::file_removed_externally &value) {
data["api_path"] = value.api_path;
data["function_name"] = value.function_name;
data["source_path"] = value.source_path;
}
static void from_json(const json &data,
repertory::file_removed_externally &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("function_name").get_to<std::string>(value.function_name);
data.at("source_path").get_to<std::string>(value.source_path);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_EXTERNALLY_HPP_

View File

@ -0,0 +1,69 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UNPINNED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UNPINNED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct file_unpinned final : public i_event {
file_unpinned() = default;
file_unpinned(std::string api_path_, std::string_view function_name_)
: api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"file_unpinned"};
std::string api_path;
std::string function_name;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::file_unpinned> {
static void to_json(json &data, const repertory::file_unpinned &value) {
data["api_path"] = value.api_path;
data["function_name"] = value.function_name;
}
static void from_json(const json &data, repertory::file_unpinned &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("function_name").get_to<std::string>(value.function_name);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UNPINNED_HPP_

View File

@ -0,0 +1,88 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_COMPLETED_HPP_
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_COMPLETED_HPP_
#include "events/i_event.hpp"
#include "types/repertory.hpp"
namespace repertory {
struct file_upload_completed final : public i_event {
file_upload_completed() = default;
file_upload_completed(std::string api_path_, bool cancelled_,
api_error error_, std::string_view function_name_,
std::string source_path_)
: api_path(std::move(api_path_)),
cancelled(cancelled_),
error(error_),
function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::info};
static constexpr const std::string_view name{"file_upload_completed"};
std::string api_path;
bool cancelled{};
api_error error{};
std::string function_name;
std::string source_path;
[[nodiscard]] auto get_event_level() const -> event_level override {
return level;
}
[[nodiscard]] auto get_name() const -> std::string_view override {
return name;
}
[[nodiscard]] auto get_single_line() const -> std::string override {
return fmt::format("{}|func|{}|ap|{}|cancelled|{}|error|{}|sp|{}", name,
function_name, api_path, cancelled,
api_error_to_string(error), source_path);
}
};
} // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN
template <> struct adl_serializer<repertory::file_upload_completed> {
static void to_json(json &data,
const repertory::file_upload_completed &value) {
data["api_path"] = value.api_path;
data["cancelled"] = value.cancelled;
data["error"] = repertory::api_error_to_string(value.error);
data["function_name"] = value.function_name;
data["source_path"] = value.source_path;
}
static void from_json(const json &data,
repertory::file_upload_completed &value) {
data.at("api_path").get_to<std::string>(value.api_path);
data.at("cancelled").get_to<bool>(value.cancelled);
value.error =
repertory::api_error_from_string(data.at("error").get<std::string>());
data.at("function_name").get_to<std::string>(value.function_name);
data.at("source_path").get_to<std::string>(value.source_path);
}
};
NLOHMANN_JSON_NAMESPACE_END
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_COMPLETED_HPP_

Some files were not shown because too many files have changed in this diff Show More