@@ -22,9 +22,9 @@ type SystemPaths struct {
2222 // Home contains the path of the user's home directory.
2323 //
2424 // Example:
25- // - 🐧 Linux:
26- // - 🍎 Mac OS X:
27- // - 🪟 Windows:
25+ // - 🐧 Linux: /home/username
26+ // - 🍎 Mac OS X: /Users/username ($HOME)
27+ // - 🪟 Windows: C:\Users\Username (%USERPROFILE%)
2828 Home string
2929
3030 // DataHome defines the base directory relative to which user-specific
@@ -33,9 +33,9 @@ type SystemPaths struct {
3333 // a default equal to $HOME/.local/share should be used.
3434 //
3535 // Example:
36- // - 🐧 Linux:
37- // - 🍎 Mac OS X:
38- // - 🪟 Windows:
36+ // - 🐧 Linux: /home/user/.local/share
37+ // - 🍎 Mac OS X: /Users/username/Library/Application Support
38+ // - 🪟 Windows: C:\Users\Username\AppData\Local (%LOCALAPPDATA%)
3939 DataHome string
4040
4141 // DataDirs defines the preference-ordered set of base directories to
@@ -48,9 +48,9 @@ type SystemPaths struct {
4848 // written relative to the DataHome directory, if possible.
4949 //
5050 // Example:
51- // - 🐧 Linux:
52- // - 🍎 Mac OS X:
53- // - 🪟 Windows:
51+ // - 🐧 Linux: /usr/local/share and /usr/share
52+ // - 🍎 Mac OS X: /Library/Application Support and /System/Library/Application Support
53+ // - 🪟 Windows: C:\ProgramData
5454 DataDirs []string
5555
5656 // ConfigHome defines the base directory relative to which user-specific
@@ -59,9 +59,9 @@ type SystemPaths struct {
5959 // not set, a default equal to $HOME/.config should be used.
6060 //
6161 // Example:
62- // - 🐧 Linux:
63- // - 🍎 Mac OS X:
64- // - 🪟 Windows:
62+ // - 🐧 Linux: /home/username/.config
63+ // - 🍎 Mac OS X: /Users/username/Library/Preferences
64+ // - 🪟 Windows: C:\Users\Username\AppData\Roaming (%APPDATA%)
6565 ConfigHome string
6666
6767 // ConfigDirs defines the preference-ordered set of base directories to
@@ -74,9 +74,9 @@ type SystemPaths struct {
7474 // ConfigHome directory, if possible.
7575 //
7676 // Example:
77- // - 🐧 Linux:
78- // - 🍎 Mac OS X:
79- // - 🪟 Windows:
77+ // - 🐧 Linux: /etc/xdg and more
78+ // - 🍎 Mac OS X: /Library/Preferences
79+ // - 🪟 Windows: C:\ProgramData
8080 ConfigDirs []string
8181
8282 // StateHome defines the base directory relative to which user-specific
@@ -85,9 +85,9 @@ type SystemPaths struct {
8585 // a default equal to ~/.local/state should be used.
8686 //
8787 // Example:
88- // - 🐧 Linux:
89- // - 🍎 Mac OS X:
90- // - 🪟 Windows:
88+ // - 🐧 Linux: /home/username/.local/state
89+ // - 🍎 Mac OS X: /Users/username/Library/Application Support
90+ // - 🪟 Windows: C:\Users\Username\AppData\Local
9191 StateHome string
9292
9393 // CacheHome defines the base directory relative to which user-specific
@@ -96,9 +96,9 @@ type SystemPaths struct {
9696 // is not set, a default equal to $HOME/.cache should be used.
9797 //
9898 // Example:
99- // - 🐧 Linux:
100- // - 🍎 Mac OS X:
101- // - 🪟 Windows:
99+ // - 🐧 Linux: /home/username/.cache
100+ // - 🍎 Mac OS X: /Users/username/Library/Caches
101+ // - 🪟 Windows: C:\Users\Username\AppData\Local\cache
102102 CacheHome string
103103
104104 // RuntimeDir defines the base directory relative to which user-specific
@@ -112,9 +112,9 @@ type SystemPaths struct {
112112 // swapped out to disk.
113113 //
114114 // Example:
115- // - 🐧 Linux:
116- // - 🍎 Mac OS X:
117- // - 🪟 Windows:
115+ // - 🐧 Linux: /run/username/1000
116+ // - 🍎 Mac OS X: /var/folders/.../T (Temporary directory)
117+ // - 🪟 Windows: Usually not set (empty string)
118118 RuntimeDir string
119119
120120 // BinHome defines the base directory relative to which user-specific
@@ -123,19 +123,42 @@ type SystemPaths struct {
123123 // not set, a default equal to $HOME/.local/bin should be used.
124124 //
125125 // Example:
126- // - 🐧 Linux:
127- // - 🍎 Mac OS X:
128- // - 🪟 Windows:
126+ // - 🐧 Linux: /home/username/.local/bin
127+ // - 🍎 Mac OS X: /usr/local/bin, /Users/username/bin (if exists)
128+ // - 🪟 Windows: C:\Users\Username\AppData\Local\Microsoft\WindowsApps
129129 BinHome string
130130
131131 // UserDirs defines the locations of well known user directories.
132+ //
133+ // Example:
134+ // - 🐧 Linux: Uses ~/Documents, ~/Downloads, etc.
135+ // - 🍎 Mac OS X: Uses ~/Documents, ~/Downloads, etc.
136+ // - 🪟 Windows: Uses SHGetKnownFolderPath, e.g., C:\Users\Username\Documents, C:\Users\Username\Downloads
132137 UserDirs xdg.UserDirectories
133138
134139 // FontDirs defines the common locations where font files are stored.
140+ //
141+ // Example:
142+ // - 🐧 Linux:
143+ // - 🍎 Mac OS X: /Library/Fonts, ~/Library/Fonts
144+ // - 🪟 Windows: C:\Windows\Fonts, C:\Users\Username\AppData\Local\Microsoft\Windows\Fonts
135145 FontDirs []string
136146
137147 // ApplicationDirs defines the common locations of applications.
148+ //
149+ // Example:
150+ // - 🐧 Linux:
151+ // - 🍎 Mac OS X: /Applications, ~/Applications
152+ // - 🪟 Windows: C:\ProgramData\Microsoft\Windows\Start Menu\Programs
138153 ApplicationDirs []string
154+
155+ // UserApplicationsHome is a specific
156+ //
157+ // E.g.:
158+ // - 🐧 Linux: /home/username/.local/share/applications/
159+ // - 🍎 Mac OS X: None
160+ // - 🪟 Windows: None
161+ UserApplicationsHome string
139162}
140163
141164// AmadlaPaths contains all the amadla root paths since all the amadla
@@ -165,54 +188,54 @@ type ApplicationPaths struct {
165188 // DataHome User-specific data storage for applications.
166189 //
167190 // Example:
168- // - 🐧 Linux: /home/user /.local/share/{appName}/
191+ // - 🐧 Linux: /home/username /.local/share/{appName}
169192 // - 🍎 Mac OS X: /Users/username/Library/Application Support
170193 // - 🪟 Windows: C:\Users\Username\AppData\Local (%LOCALAPPDATA%)
171194 DataHome string
172195
173196 // ConfigHome User-specific configuration files directory
174197 //
175198 // E.g.:
176- // - 🐧 Linux: /home/user /.config/{appName}/
199+ // - 🐧 Linux: /home/username /.config/{appName}
177200 // - 🍎 Mac OS X: /Users/username/Library/Preferences
178201 // - 🪟 Windows: C:\Users\Username\AppData\Roaming (%APPDATA%)
179202 ConfigHome string
180203
181204 // StateHome User-specific state files (runtime data, logs, etc.)
182205 // E.g.:
183- // - 🐧 Linux: /home/user /.local/state/{appName}/
206+ // - 🐧 Linux: /home/username /.local/state/{appName}/
184207 // - 🍎 Mac OS X: /Users/username/Library/Application Support
185208 // - 🪟 Windows: C:\Users\Username\AppData\Local
186209 StateHome string
187210
188211 // CacheHome User-specific cache storage (temporary files)
189212 //
190213 // E.g.:
191- // - 🐧 Linux: /home/user /.cache/{appName}/
214+ // - 🐧 Linux: /home/username /.cache/{appName}/
192215 // - 🍎 Mac OS X: /Users/username/Library/Caches
193216 // - 🪟 Windows: C:\Users\Username\AppData\Local\cache
194217 CacheHome string
195218
196219 // RuntimeDir Temporary runtime files (e.g., sockets, PID files)
197220 //
198221 // E.g.:
199- // - 🐧 Linux: /run/user /1000/{appName}/
222+ // - 🐧 Linux: /run/username /1000/{appName}/
200223 // - 🍎 Mac OS X: /var/folders/.../T (Temporary directory)
201224 // - 🪟 Windows: Usually not set (empty string)
202225 RuntimeDir string
203226
204- // BinHome Directory for user-installed executable binaries
227+ // BinFile Directory for user-installed executable binaries
205228 //
206229 // E.g.:
207- // - 🐧 Linux: /home/user /.local/bin/{appName}
230+ // - 🐧 Linux: /home/username /.local/bin/{appName}
208231 // - 🍎 Mac OS X: /usr/local/bin, /Users/username/bin (if exists)
209232 // - 🪟 Windows: C:\Users\Username\AppData\Local\Microsoft\WindowsApps
210- BinHome string
233+ BinFile string
211234
212235 // ConfigFile User-specific configuration files directory
213236 //
214237 // E.g.:
215- // - 🐧 Linux: /home/user /.config/{appName}/{appName}.yml
238+ // - 🐧 Linux: /home/username /.config/{appName}/{appName}.yml
216239 // - 🍎 Mac OS X: /Users/username/Library/Preferences
217240 // - 🪟 Windows: C:\Users\Username\AppData\Roaming (%APPDATA%)
218241 ConfigFile string
@@ -221,31 +244,23 @@ type ApplicationPaths struct {
221244 // PluginsHome
222245 //
223246 // E.g.:
224- // - 🐧 Linux: /home/user /.config/{appName}/plugins.d/
247+ // - 🐧 Linux: /home/username /.config/{appName}/plugins.d/
225248 // - 🍎 Mac OS X:
226249 // - 🪟 Windows:
227250 PluginsHome string
228251
229252 // CacheFile is a SQLite3 file
230253 //
231254 // E.g.:
232- // - 🐧 Linux: /home/user /.config/{appName}/{appName}.cache
255+ // - 🐧 Linux: /home/username /.config/{appName}/{appName}.cache
233256 // - 🍎 Mac OS X:
234257 // - 🪟 Windows:
235258 CacheFile string
236259
237- // ApplicationsHome
238- //
239- // E.g.:
240- // - 🐧 Linux: /home/user/.local/share/applications/
241- // - 🍎 Mac OS X:
242- // - 🪟 Windows:
243- ApplicationsHome string
244-
245260 // ApplicationsDesktopFile
246261 //
247262 // E.g.:
248- // - 🐧 Linux: /home/user /.local/share/applications/{appName}.desktop
263+ // - 🐧 Linux: /home/username /.local/share/applications/{appName}.desktop
249264 // - 🍎 Mac OS X:
250265 // - 🪟 Windows:
251266 ApplicationsDesktopFile string
@@ -254,33 +269,79 @@ type ApplicationPaths struct {
254269 // Section: Secrets
255270 //
256271
272+ SecretsPaths * SecretsPaths
273+
274+ /*
275+ chmod 600 ~/.config/amadla/private/*.key ~/.config/amadla/mTLS/*.key
276+ chmod 644 ~/.config/amadla/certs/*.crt ~/.config/amadla/mTLS/*.crt
277+ */
278+
279+ //
280+ // Temporary
281+ //
282+
283+ // ln -s ~/.local/lib/amadla/amadla ~/.local/bin/amadla
284+
285+ }
286+
287+ // SecretsPaths
288+ type SecretsPaths struct {
257289 // SecretsHome contains the directories and the files for all the secrets the application might need
258290 // TODO: What about the tmp?
259291 // TODO: Is this the best place what about run directory for tmp secrets?
260292 // TODO: Is there other propositions for this?
261293 // E.g.:
262- // - 🐧 Linux: /home/user /.config/{appName}/secrets/
294+ // - 🐧 Linux: /home/username /.config/{appName}/secrets/
263295 // - 🍎 Mac OS X:
264296 // - 🪟 Windows:
265297 SecretsHome string
266298
267- /*
268- chmod 600 ~/.config/amadla/private/*.key ~/.config/amadla/mTLS/*.key
269- chmod 644 ~/.config/amadla/certs/*.crt ~/.config/amadla/mTLS/*.crt
270- */
271-
272299 // MTLSHome to be able to connect to `doorman` you need mTLS certification that are assigned temporally by `doorman`
273300 //
274301 // E.g.:
275302 // - 🐧 Linux: /home/user/.config/{appName}/secrets/mTLS/
276303 // - 🍎 Mac OS X:
277304 // - 🪟 Windows:
278305 MTLSHome string
306+ }
279307
280- //
281- // Temporary
282- //
308+ type PathName string
309+
310+ const (
311+ Home PathName = "Home"
312+ DataHome PathName = "DataHome"
313+ DataDirs PathName = "DataDirs"
314+ ConfigHome PathName = "ConfigHome"
315+ ConfigDirs PathName = "ConfigDirs"
316+ StateHome PathName = "StateHome"
317+ CacheHome PathName = "CacheHome"
318+ RuntimeDir PathName = "RuntimeDir"
319+ BinHome PathName = "BinHome"
320+ UserDirs PathName = "UserDirs"
321+ FontDirs PathName = "FontDirs"
322+ ApplicationDirs PathName = "ApplicationDirs"
323+ UserApplicationsHome PathName = "UserApplicationsHome"
324+ )
283325
284- // ln -s ~/.local/lib/amadla/amadla ~/.local/bin/amadla
326+ type AppPathName string
327+
328+ const (
329+ AppDataHome AppPathName = "AppDataHome"
330+ AppConfigHome AppPathName = "AppConfigHome"
331+ AppStateHome AppPathName = "AppStateHome"
332+ AppCacheHome AppPathName = "AppCacheHome"
333+ AppRuntimeDir AppPathName = "AppRuntimeDir"
334+ AppBinFile AppPathName = "AppBinFile"
335+ AppConfigFile AppPathName = "AppConfigFile"
336+ AppPluginsHome AppPathName = "AppPluginsHome"
337+ AppCacheFile AppPathName = "AppCacheFile"
338+ ApplicationsHome AppPathName = "ApplicationsHome"
339+ AppApplicationsDesktopFile AppPathName = "ApplicationsDesktopFile"
340+ )
285341
286- }
342+ type AppSecretsPathName string
343+
344+ const (
345+ AppSecretsHome AppSecretsPathName = "AppSecretsHome"
346+ MTLSHome AppSecretsPathName = "MTLSHome"
347+ )
0 commit comments