diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-23 22:51:10 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-23 22:59:02 +0900 |
| commit | dd94818f20c7a37bdd7c6129551759db1b09b65e (patch) | |
| tree | 1ea7c94b3f6aec92f037a3e58dc343c3b00cd5a2 /internal/app/state/join.go | |
| parent | 0fd357e7f64ec029489bbbcc7935005a26cb9a13 (diff) | |
hst/instance: define instance state
This is now part of the hst API. This change also improves identifier generation and serialisation.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/state/join.go')
| -rw-r--r-- | internal/app/state/join.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/internal/app/state/join.go b/internal/app/state/join.go index 2b4011fe..43a19b1d 100644 --- a/internal/app/state/join.go +++ b/internal/app/state/join.go @@ -3,6 +3,8 @@ package state import ( "errors" "maps" + + "hakurei.app/hst" ) var ( @@ -14,20 +16,22 @@ Joiner is the interface that wraps the Join method. The Join function uses Joiner if available. */ -type Joiner interface{ Join() (Entries, error) } +type Joiner interface { + Join() (map[hst.ID]*hst.State, error) +} -// Join returns joined state entries of all active aids. -func Join(s Store) (Entries, error) { +// Join returns joined state entries of all active identities. +func Join(s Store) (map[hst.ID]*hst.State, error) { if j, ok := s.(Joiner); ok { return j.Join() } var ( aids []int - entries = make(Entries) + entries = make(map[hst.ID]*hst.State) el int - res Entries + res map[hst.ID]*hst.State loadErr error ) |
