code: func (k *k8sWatcher) handleEvent(event watch.Event) {
  	var pod client.Pod
  	if err := json.Unmarshal([]byte(event.Object), &pod); err != nil {
  		log.Log("K8s Watcher: Couldnt unmarshal event object from pod")
  		return
  	}
  
  	switch event.Type {
  	case watch.Modified:
  		// Pod was modified
  
  		k.RLock()
  		cache := k.pods[pod.Metadata.Name]
  		k.RUnlock()
  
  		// service could have been added, edited or removed.
  		var results []*registry.Result
  
  		if pod.Status.Phase == podRunning {
  			results = k.buildPodResults(&pod, cache)
  		} else {
  			// passing in cache might not return all results
  			results = k.buildPodResults(&pod, nil)
  		}
  
  		for _, result := range results {
  			// pod isnt running
  			if pod.Status.Phase != podRunning {
  				result.Action = "delete"
  			}
  			k.next <- result
  		}
  
  		k.Lock()
  		k.pods[pod.Metadata.Name] = &pod
  		k.Unlock()
  		return
  
  	case watch.Deleted:
  		// Pod was deleted
  		// passing in cache might not return all results
  		results := k.buildPodResults(&pod, nil)
  
  		for _, result := range results {
  			result.Action = "delete"
  			k.next <- result
  		}
  
  		k.Lock()
  		delete(k.pods, pod.Metadata.Name)
  		k.Unlock()
  		return
  	}
  
  }
docs: // handleEvent will taken an event from the k8s pods API and do the correct
  // things with the result, based on the local cache.