From 2eb0a778e0c1a7b829f2477e3a2b339c11a1a440 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 20 Apr 2018 11:37:07 +0900 Subject: [PATCH] ing --- sensorconfig/model/Keys.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sensorconfig/model/Keys.go b/sensorconfig/model/Keys.go index 36e3534..7a1ad70 100644 --- a/sensorconfig/model/Keys.go +++ b/sensorconfig/model/Keys.go @@ -4,3 +4,14 @@ type Keys struct { Metric string `json:"metric,omitempty"` Key string `json:"key,omitempty"` } + +func KeysToMap(keys []Keys) map[string]string { + + m := make(map[string]string) + + for _, key := range keys { + m[key.Key] = key.Metric + } + + return m +}