aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst/paths.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-11 02:52:32 +0900
committerOphestra <cat@gensokyo.uk>2025-08-11 04:56:42 +0900
commite99d7affb0c128fa82722f9b3d79c99b5e5918cd (patch)
tree387e08d6c4363d8b9e0462f069c140fbdb15c917 /hst/paths.go
parent41ac2be9658b49c68cb793f3a6f0c5932d82e1c2 (diff)
container: use absolute for pathname
This is simultaneously more efficient and less error-prone. This change caused minor API changes in multiple other packages. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/paths.go')
-rw-r--r--hst/paths.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/hst/paths.go b/hst/paths.go
index 31c14df2..7410d7a0 100644
--- a/hst/paths.go
+++ b/hst/paths.go
@@ -1,11 +1,15 @@
package hst
+import "hakurei.app/container"
+
// Paths contains environment-dependent paths used by hakurei.
type Paths struct {
+ // temporary directory returned by [os.TempDir] (usually `/tmp`)
+ TempDir *container.Absolute `json:"temp_dir"`
// path to shared directory (usually `/tmp/hakurei.%d`)
- SharePath string `json:"share_path"`
+ SharePath *container.Absolute `json:"share_path"`
// XDG_RUNTIME_DIR value (usually `/run/user/%d`)
- RuntimePath string `json:"runtime_path"`
+ RuntimePath *container.Absolute `json:"runtime_path"`
// application runtime directory (usually `/run/user/%d/hakurei`)
- RunDirPath string `json:"run_dir_path"`
+ RunDirPath *container.Absolute `json:"run_dir_path"`
}