landed AmSearchPosts and the "Find Posts" functionality on the main Find page

This commit is contained in:
2026-01-31 22:32:40 -07:00
parent d621eb07c0
commit 38ed57d207
5 changed files with 272 additions and 16 deletions
+18
View File
@@ -12,6 +12,7 @@ package database
import (
"context"
_ "embed"
"errors"
"slices"
"sync"
@@ -123,6 +124,23 @@ func init() {
}
}
/* AmGetServiceIndex returns the service index for the given service by domain and identifier.
* Parameters:
* domain - The domain of the service to look for.
* id - The identifier of the service.
* Returns:
* The service index, if the service is found.
* Standard Go error status.
*/
func AmGetServiceIndex(domain, id string) (int16, error) {
if d, ok := serviceRoot.byName[domain]; ok {
if svc, ok2 := d.byId[id]; ok2 {
return svc.Index, nil
}
}
return -1, errors.New("service not found")
}
/* AmGetCommunityServices returns all the community service definitions for a community.
* Parameters:
* ctx - Standard Go context value.