diff --git a/hst/config.go b/hst/config.go index c694606..34100e4 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 similarity index 85% rename from hst/template.go rename to hst/hst.go index b06e323..92769a2 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 similarity index 100% rename from hst/template_test.go rename to hst/hst_test.go diff --git a/hst/info.go b/hst/info.go deleted file mode 100644 index e52f746..0000000 --- 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 7410d7a..0000000 --- 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"` -}