From d35c78e933c6eaccdf78b259fd9ea2af5a5fb489 Mon Sep 17 00:00:00 2001 From: palkan Date: Sat, 17 Oct 2015 13:59:48 +0300 Subject: [PATCH] Rename Tags to TagKeys --- plugins/httpjson/httpjson.go | 12 ++++++------ plugins/httpjson/httpjson_test.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/httpjson/httpjson.go b/plugins/httpjson/httpjson.go index 23eda0d5f..5c9bee02a 100644 --- a/plugins/httpjson/httpjson.go +++ b/plugins/httpjson/httpjson.go @@ -22,7 +22,7 @@ type Service struct { Name string Servers []string Method string - Tags []string + TagKeys []string Parameters map[string]string } @@ -63,10 +63,10 @@ var sampleConfig = ` method = "GET" # List of tag names to extract from server response - tags = [ - "my_tag_1", - "my_tag_2" - ] + # tagKeys = [ + # "my_tag_1", + # "my_tag_2" + # ] # HTTP parameters (all values must be strings) [httpjson.services.parameters] @@ -142,7 +142,7 @@ func (h *HttpJson) gatherServer(acc plugins.Accumulator, service Service, server "server": serverURL, } - for _, tag := range service.Tags { + for _, tag := range service.TagKeys { switch v := jsonOut[tag].(type) { case string: tags[tag] = v diff --git a/plugins/httpjson/httpjson_test.go b/plugins/httpjson/httpjson_test.go index c0f62613e..335568724 100644 --- a/plugins/httpjson/httpjson_test.go +++ b/plugins/httpjson/httpjson_test.go @@ -104,7 +104,7 @@ func genMockHttpJson(response string, statusCode int) *HttpJson { "httpParam1": "12", "httpParam2": "the second parameter", }, - Tags: []string{ + TagKeys: []string{ "role", "build", },