Extend for Human Readable

This commit is contained in:
mr
2026-04-21 14:30:45 +02:00
parent 50a5e90f33
commit d57ee0b5e7
11 changed files with 140 additions and 7 deletions

View File

@@ -100,6 +100,20 @@ type Peer struct {
LastHeartbeat *time.Time `json:"last_heartbeat,omitempty" bson:"-"`
}
func (ri *Peer) Extend(typ ...string) map[string][]tools.DataType {
ext := ri.AbstractObject.Extend(typ...)
for _, t := range typ {
switch t {
case "peer":
if _, ok := ext[t]; !ok {
ext[t] = []tools.DataType{}
}
ext[t] = append(ext[t], tools.PEER)
}
}
return ext
}
func (ao *Peer) VerifyAuth(callName string, request *tools.APIRequest) bool {
return true
}