aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/state
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-09 05:04:08 +0900
committerOphestra <cat@gensokyo.uk>2025-10-09 05:18:19 +0900
commit87b5c30ef6d5b7b8a10d6a5a8610054c403923e6 (patch)
tree805116c39a623bb30fc532af47ea3ed78b7304c0 /internal/app/state
parentdf9b77b077d967d35082adb8ab3b00dd67d7bc97 (diff)
message: relocate from container
This package is quite useful. This change allows it to be imported without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/state')
-rw-r--r--internal/app/state/multi.go6
-rw-r--r--internal/app/state/multi_test.go4
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/app/state/multi.go b/internal/app/state/multi.go
index 244b5c56..ca608f58 100644
--- a/internal/app/state/multi.go
+++ b/internal/app/state/multi.go
@@ -11,8 +11,8 @@ import (
"sync"
"syscall"
- "hakurei.app/container"
"hakurei.app/hst"
+ "hakurei.app/message"
)
// fine-grained locking and access
@@ -22,7 +22,7 @@ type multiStore struct {
// initialised backends
backends *sync.Map
- msg container.Msg
+ msg message.Msg
mu sync.RWMutex
}
@@ -280,7 +280,7 @@ func (b *multiBackend) close() error {
}
// NewMulti returns an instance of the multi-file store.
-func NewMulti(msg container.Msg, runDir string) Store {
+func NewMulti(msg message.Msg, runDir string) Store {
return &multiStore{
msg: msg,
base: path.Join(runDir, "state"),
diff --git a/internal/app/state/multi_test.go b/internal/app/state/multi_test.go
index b8e1db9b..fd994438 100644
--- a/internal/app/state/multi_test.go
+++ b/internal/app/state/multi_test.go
@@ -4,10 +4,10 @@ import (
"log"
"testing"
- "hakurei.app/container"
"hakurei.app/internal/app/state"
+ "hakurei.app/message"
)
func TestMulti(t *testing.T) {
- testStore(t, state.NewMulti(container.NewMsg(log.New(log.Writer(), "multi: ", 0)), t.TempDir()))
+ testStore(t, state.NewMulti(message.NewMsg(log.New(log.Writer(), "multi: ", 0)), t.TempDir()))
}