func (t *serviceTable) LookupAll() (e *piazza.ServiceList) { list := new(piazza.ServiceList) for service := range t.table.Iterator() { list.Add(service) } return list }
// returns a list of size 0 or 1 func (t *serviceTable) LookupById(id piazza.PiazzaId) (e *piazza.ServiceList, ok bool) { service, ok := t.table.Get(id) if !ok { return nil, false } list := new(piazza.ServiceList) list.Add(service) return list, true }
func (t *serviceTable) LookupByType(stype piazza.ServiceType) (e *piazza.ServiceList, ok bool) { list := new(piazza.ServiceList) for service := range t.table.Iterator() { if service.Type == stype { list.Add(service) } } return list, true }