From dd94818f20c7a37bdd7c6129551759db1b09b65e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 23 Oct 2025 22:51:10 +0900 Subject: 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 --- internal/app/state/join.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'internal/app/state/join.go') 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 ) -- cgit v1.3.1