Search Index Build

This commit is contained in:
Simon Martens
2025-02-17 21:42:20 +01:00
parent d109f7a040
commit fd2fa157b2
18 changed files with 611 additions and 16 deletions

View File

@@ -3,6 +3,11 @@ package xmlmodels
import (
"encoding/json"
"encoding/xml"
"strings"
)
const (
AGENT_TYPE = "agent"
)
type Agent struct {
@@ -24,3 +29,21 @@ func (a Agent) String() string {
data, _ := json.MarshalIndent(a, "", " ")
return string(data)
}
func (a Agent) Readable(_ *Library) map[string]interface{} {
ret := map[string]interface{}{
"ID": a.ID,
"Names": strings.Join(a.Names, "; "),
"Life": a.Life,
}
for k, v := range a.AnnotationNote.Readable() {
ret[k] = v
}
return ret
}
func (a Agent) Type() string {
return AGENT_TYPE
}