示例#1
0
func PatchObservations(c gossamer.Client) {
	l, err := c.QueryObservations().Top(1).All()
	if err != nil {
		log.Fatal(err)
	}

	var o gossamer.Observation
	if len(l) > 0 {
		o = l[0].(gossamer.Observation)

		n := gossamer.CloneObservationEntity(o)
		n.ResultQuality = "Value was changed"
		n.ResultTime = gossamer.NewTimeInstant(time.Now())

		c.PatchObservation(n)
	}
}