aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst/hst.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-12 05:03:14 +0900
committerOphestra <cat@gensokyo.uk>2025-10-12 05:03:14 +0900
commit8a91234cb4d8cbf6e1d5b909bc11f630d78a93e5 (patch)
tree2a8997564266ff2c2815d67ba5261fbd9e29ed05 /hst/hst.go
parentdb7051a36814a5c9e02e22c2e8d1df42c5f4b8f0 (diff)
hst: reword and improve doc comments
This corrects minor mistakes in doc comments and adds them for undocumented constants. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/hst.go')
-rw-r--r--hst/hst.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/hst/hst.go b/hst/hst.go
index 208b395a..11e91e7b 100644
--- a/hst/hst.go
+++ b/hst/hst.go
@@ -12,9 +12,12 @@ import (
// An AppError is returned while starting an app according to [hst.Config].
type AppError struct {
- Step string
- Err error
- Msg string
+ // A user-facing description of where the error occurred.
+ Step string `json:"step"`
+ // The underlying error value.
+ Err error
+ // An arbitrary error message, overriding the return value of Message if not empty.
+ Msg string `json:"message,omitempty"`
}
func (e *AppError) Error() string { return e.Err.Error() }
@@ -38,13 +41,13 @@ func (e *AppError) Message() string {
// Paths contains environment-dependent paths used by hakurei.
type Paths struct {
- // temporary directory returned by [os.TempDir] (usually `/tmp`)
+ // Temporary directory returned by [os.TempDir], usually equivalent to [fhs.AbsTmp].
TempDir *check.Absolute `json:"temp_dir"`
- // path to shared directory (usually `/tmp/hakurei.%d`, [Info.User])
+ // Shared directory specific to the hsu userid, usually (`/tmp/hakurei.%d`, [Info.User]).
SharePath *check.Absolute `json:"share_path"`
- // XDG_RUNTIME_DIR value (usually `/run/user/%d`, uid)
+ // Checked XDG_RUNTIME_DIR value, usually (`/run/user/%d`, uid).
RuntimePath *check.Absolute `json:"runtime_path"`
- // application runtime directory (usually `/run/user/%d/hakurei`)
+ // Shared directory specific to the hsu userid located in RuntimePath, usually (`/run/user/%d/hakurei`, uid).
RunDirPath *check.Absolute `json:"run_dir_path"`
}