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

	for _, v := range ol {
		o, err := c.GetLocation(v.GetId())
		if err != nil {
			log.Fatal(err)
		} else {
			log.Println("Got Location Entity ", o.GetId())
		}
	}
}
예제 #2
0
func DeleteLocations(c gossamer.Client) {
	ol, e := c.FindLocations()
	if e != nil {
		log.Fatal(e)
	}

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