예제 #1
0
func (t *serviceTable) LookupAll() (e *piazza.ServiceList) {

	list := new(piazza.ServiceList)
	for service := range t.table.Iterator() {
		list.Add(service)
	}
	return list
}
예제 #2
0
// 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
}
예제 #3
0
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
}