code: func (c *kregistry) ListServices() ([]*registry.Service, error) {
  	pods, err := c.client.ListPods(podSelector)
  	if err != nil {
  		return nil, err
  	}
  
  	// svcs mapped by name
  	svcs := make(map[string]bool)
  
  	for _, pod := range pods.Items {
  		if pod.Status.Phase != podRunning {
  			continue
  		}
  		for k, v := range pod.Metadata.Annotations {
  			if !strings.HasPrefix(k, annotationServiceKeyPrefix) {
  				continue
  			}
  
  			// we have to unmarshal the annotation itself since the
  			// key is encoded to match the regex restriction.
  			var svc registry.Service
  			if err := json.Unmarshal([]byte(*v), &svc); err != nil {
  				continue
  			}
  			svcs[svc.Name] = true
  		}
  	}
  
  	var list []*registry.Service
  	for val := range svcs {
  		list = append(list, &registry.Service{Name: val})
  	}
  	return list, nil
  }
docs: // ListServices will list all the service names