aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-16 02:32:57 +0900
committerOphestra <cat@gensokyo.uk>2025-08-16 02:32:57 +0900
commitf9edec7e4169ecda63ba15762f12e64803b9984d (patch)
treebc3682c185dc32bfb941b68578ead2c85449d60b /hst
parent305c600cf5b69e16538e0142cf3d10844a671577 (diff)
hst: merge miscellaneous files
These structs were going to be bigger at some point. They turned out not to be. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst')
-rw-r--r--hst/config.go1
-rw-r--r--hst/hst.go (renamed from hst/template.go)18
-rw-r--r--hst/hst_test.go (renamed from hst/template_test.go)0
-rw-r--r--hst/info.go6
-rw-r--r--hst/paths.go15
5 files changed, 18 insertions, 22 deletions
diff --git a/hst/config.go b/hst/config.go
index c6946069..34100e4f 100644
--- a/hst/config.go
+++ b/hst/config.go
@@ -1,4 +1,3 @@
-// Package hst exports shared types for invoking hakurei.
package hst
import (
diff --git a/hst/template.go b/hst/hst.go
index b06e3239..92769a23 100644
--- a/hst/template.go
+++ b/hst/hst.go
@@ -1,3 +1,4 @@
+// Package hst exports stable shared types for interacting with hakurei.
package hst
import (
@@ -7,6 +8,23 @@ import (
"hakurei.app/system/dbus"
)
+// 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 *container.Absolute `json:"share_path"`
+ // XDG_RUNTIME_DIR value (usually `/run/user/%d`)
+ RuntimePath *container.Absolute `json:"runtime_path"`
+ // application runtime directory (usually `/run/user/%d/hakurei`)
+ RunDirPath *container.Absolute `json:"run_dir_path"`
+}
+
+type Info struct {
+ User int `json:"user"`
+ Paths
+}
+
// Template returns a fully populated instance of Config.
func Template() *Config {
return &Config{
diff --git a/hst/template_test.go b/hst/hst_test.go
index 31b9013e..31b9013e 100644
--- a/hst/template_test.go
+++ b/hst/hst_test.go
diff --git a/hst/info.go b/hst/info.go
deleted file mode 100644
index e52f7465..00000000
--- a/hst/info.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package hst
-
-type Info struct {
- User int `json:"user"`
- Paths
-}
diff --git a/hst/paths.go b/hst/paths.go
deleted file mode 100644
index 7410d7a0..00000000
--- a/hst/paths.go
+++ /dev/null
@@ -1,15 +0,0 @@
-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 *container.Absolute `json:"share_path"`
- // XDG_RUNTIME_DIR value (usually `/run/user/%d`)
- RuntimePath *container.Absolute `json:"runtime_path"`
- // application runtime directory (usually `/run/user/%d/hakurei`)
- RunDirPath *container.Absolute `json:"run_dir_path"`
-}