From 9b12e4fe6f3c95986f1f3ec791636c58ca7e7583 Mon Sep 17 00:00:00 2001 From: Jake Champlin Date: Fri, 9 Jun 2017 17:54:32 +0000 Subject: Transfer of provider code --- .../terraform/helper/structure/expand_json.go | 11 ---------- .../terraform/helper/structure/flatten_json.go | 16 --------------- .../terraform/helper/structure/normalize_json.go | 24 ---------------------- .../helper/structure/suppress_json_diff.go | 21 ------------------- 4 files changed, 72 deletions(-) delete mode 100644 vendor/github.com/hashicorp/terraform/helper/structure/expand_json.go delete mode 100644 vendor/github.com/hashicorp/terraform/helper/structure/flatten_json.go delete mode 100644 vendor/github.com/hashicorp/terraform/helper/structure/normalize_json.go delete mode 100644 vendor/github.com/hashicorp/terraform/helper/structure/suppress_json_diff.go (limited to 'vendor/github.com/hashicorp/terraform/helper/structure') diff --git a/vendor/github.com/hashicorp/terraform/helper/structure/expand_json.go b/vendor/github.com/hashicorp/terraform/helper/structure/expand_json.go deleted file mode 100644 index b3eb90f..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/structure/expand_json.go +++ /dev/null @@ -1,11 +0,0 @@ -package structure - -import "encoding/json" - -func ExpandJsonFromString(jsonString string) (map[string]interface{}, error) { - var result map[string]interface{} - - err := json.Unmarshal([]byte(jsonString), &result) - - return result, err -} diff --git a/vendor/github.com/hashicorp/terraform/helper/structure/flatten_json.go b/vendor/github.com/hashicorp/terraform/helper/structure/flatten_json.go deleted file mode 100644 index 578ad2e..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/structure/flatten_json.go +++ /dev/null @@ -1,16 +0,0 @@ -package structure - -import "encoding/json" - -func FlattenJsonToString(input map[string]interface{}) (string, error) { - if len(input) == 0 { - return "", nil - } - - result, err := json.Marshal(input) - if err != nil { - return "", err - } - - return string(result), nil -} diff --git a/vendor/github.com/hashicorp/terraform/helper/structure/normalize_json.go b/vendor/github.com/hashicorp/terraform/helper/structure/normalize_json.go deleted file mode 100644 index 3256b47..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/structure/normalize_json.go +++ /dev/null @@ -1,24 +0,0 @@ -package structure - -import "encoding/json" - -// Takes a value containing JSON string and passes it through -// the JSON parser to normalize it, returns either a parsing -// error or normalized JSON string. -func NormalizeJsonString(jsonString interface{}) (string, error) { - var j interface{} - - if jsonString == nil || jsonString.(string) == "" { - return "", nil - } - - s := jsonString.(string) - - err := json.Unmarshal([]byte(s), &j) - if err != nil { - return s, err - } - - bytes, _ := json.Marshal(j) - return string(bytes[:]), nil -} diff --git a/vendor/github.com/hashicorp/terraform/helper/structure/suppress_json_diff.go b/vendor/github.com/hashicorp/terraform/helper/structure/suppress_json_diff.go deleted file mode 100644 index 46f794a..0000000 --- a/vendor/github.com/hashicorp/terraform/helper/structure/suppress_json_diff.go +++ /dev/null @@ -1,21 +0,0 @@ -package structure - -import ( - "reflect" - - "github.com/hashicorp/terraform/helper/schema" -) - -func SuppressJsonDiff(k, old, new string, d *schema.ResourceData) bool { - oldMap, err := ExpandJsonFromString(old) - if err != nil { - return false - } - - newMap, err := ExpandJsonFromString(new) - if err != nil { - return false - } - - return reflect.DeepEqual(oldMap, newMap) -} -- cgit v1.2.3