Beispiel #1
0
func FindObservations(c gossamer.Client) {
	ol, e := c.FindObservations()
	if e != nil {
		log.Fatal(e)
	}

	for _, v := range ol {
		o, err := c.GetObservation(v.GetId())
		if err != nil {
			log.Fatal(err)
		} else {
			log.Println("Got Observation Entity ", o.GetId())
		}
	}
}
Beispiel #2
0
func DeleteObservations(c gossamer.Client) {
	ol, e := c.FindObservations()
	if e != nil {
		log.Fatal(e)
	}

	for _, v := range ol {
		o, err := c.GetObservation(v.GetId())
		if err != nil {
			log.Fatal(err)
		} else {
			// Delete Observation
			e := c.DeleteObservation(o.GetId())
			if e != nil {
				log.Fatal(err)
			} else {
				log.Println("Deleted Observation ", o.GetId())
			}
		}
	}
}