landed AmSearchPosts and the "Find Posts" functionality on the main Find page
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user