2018-04-26 07:37:59 +00:00
|
|
|
package sensorconfig
|
2018-04-12 09:38:04 +00:00
|
|
|
|
|
|
|
type Keys struct {
|
|
|
|
Metric string `json:"metric,omitempty"`
|
|
|
|
Key string `json:"key,omitempty"`
|
|
|
|
}
|
2018-04-20 02:37:07 +00:00
|
|
|
|
|
|
|
func KeysToMap(keys []Keys) map[string]string {
|
|
|
|
|
|
|
|
m := make(map[string]string)
|
|
|
|
|
|
|
|
for _, key := range keys {
|
|
|
|
m[key.Key] = key.Metric
|
|
|
|
}
|
|
|
|
|
|
|
|
return m
|
|
|
|
}
|