http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token.go b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token.go deleted file mode 100644 index 95a0c3e..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token.go +++ /dev/null @@ -1,118 +0,0 @@ -package token - -import ( - "fmt" - "strconv" - - hcltoken "github.com/hashicorp/hcl/hcl/token" -) - -// Token defines a single HCL token which can be obtained via the Scanner -type Token struct { - Type Type - Pos Pos - Text string -} - -// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) -type Type int - -const ( - // Special tokens - ILLEGAL Type = iota - EOF - - identifier_beg - literal_beg - NUMBER // 12345 - FLOAT // 123.45 - BOOL // true,false - STRING // "abc" - NULL // null - literal_end - identifier_end - - operator_beg - LBRACK // [ - LBRACE // { - COMMA // , - PERIOD // . - COLON // : - - RBRACK // ] - RBRACE // } - - operator_end -) - -var tokens = [...]string{ - ILLEGAL: "ILLEGAL", - - EOF: "EOF", - - NUMBER: "NUMBER", - FLOAT: "FLOAT", - BOOL: "BOOL", - STRING: "STRING", - NULL: "NULL", - - LBRACK: "LBRACK", - LBRACE: "LBRACE", - COMMA: "COMMA", - PERIOD: "PERIOD", - COLON: "COLON", - - RBRACK: "RBRACK", - RBRACE: "RBRACE", -} - -// String returns the string corresponding to the token tok. -func (t Type) String() string { - s := "" - if 0 <= t && t < Type(len(tokens)) { - s = tokens[t] - } - if s == "" { - s = "token(" + strconv.Itoa(int(t)) + ")" - } - return s -} - -// IsIdentifier returns true for tokens corresponding to identifiers and basic -// type literals; it returns false otherwise. -func (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end } - -// IsLiteral returns true for tokens corresponding to basic type literals; it -// returns false otherwise. -func (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end } - -// IsOperator returns true for tokens corresponding to operators and -// delimiters; it returns false otherwise. -func (t Type) IsOperator() bool { return operator_beg < t && t < operator_end } - -// String returns the token's literal text. Note that this is only -// applicable for certain token types, such as token.IDENT, -// token.STRING, etc.. -func (t Token) String() string { - return fmt.Sprintf("%s %s %s", t.Pos.String(), t.Type.String(), t.Text) -} - -// HCLToken converts this token to an HCL token. -// -// The token type must be a literal type or this will panic. -func (t Token) HCLToken() hcltoken.Token { - switch t.Type { - case BOOL: - return hcltoken.Token{Type: hcltoken.BOOL, Text: t.Text} - case FLOAT: - return hcltoken.Token{Type: hcltoken.FLOAT, Text: t.Text} - case NULL: - return hcltoken.Token{Type: hcltoken.STRING, Text: ""} - case NUMBER: - return hcltoken.Token{Type: hcltoken.NUMBER, Text: t.Text} - case STRING: - return hcltoken.Token{Type: hcltoken.STRING, Text: t.Text, JSON: true} - default: - panic(fmt.Sprintf("unimplemented HCLToken for type: %s", t.Type)) - } -}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token_test.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token_test.go b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token_test.go deleted file mode 100644 index a83fdd5..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/json/token/token_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package token - -import ( - "testing" -) - -func TestTypeString(t *testing.T) { - var tokens = []struct { - tt Type - str string - }{ - {ILLEGAL, "ILLEGAL"}, - {EOF, "EOF"}, - {NUMBER, "NUMBER"}, - {FLOAT, "FLOAT"}, - {BOOL, "BOOL"}, - {STRING, "STRING"}, - {NULL, "NULL"}, - {LBRACK, "LBRACK"}, - {LBRACE, "LBRACE"}, - {COMMA, "COMMA"}, - {PERIOD, "PERIOD"}, - {RBRACK, "RBRACK"}, - {RBRACE, "RBRACE"}, - } - - for _, token := range tokens { - if token.tt.String() != token.str { - t.Errorf("want: %q got:%q\n", token.str, token.tt) - - } - } - -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex.go b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex.go deleted file mode 100644 index 2e38ecb..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex.go +++ /dev/null @@ -1,31 +0,0 @@ -package hcl - -import ( - "unicode" -) - -type lexModeValue byte - -const ( - lexModeUnknown lexModeValue = iota - lexModeHcl - lexModeJson -) - -// lexMode returns whether we're going to be parsing in JSON -// mode or HCL mode. -func lexMode(v string) lexModeValue { - for _, r := range v { - if unicode.IsSpace(r) { - continue - } - - if r == '{' { - return lexModeJson - } else { - return lexModeHcl - } - } - - return lexModeHcl -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex_test.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex_test.go b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex_test.go deleted file mode 100644 index f7ee378..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/lex_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package hcl - -import ( - "testing" -) - -func TestLexMode(t *testing.T) { - cases := []struct { - Input string - Mode lexModeValue - }{ - { - "", - lexModeHcl, - }, - { - "foo", - lexModeHcl, - }, - { - "{}", - lexModeJson, - }, - { - " {}", - lexModeJson, - }, - } - - for i, tc := range cases { - actual := lexMode(tc.Input) - - if actual != tc.Mode { - t.Fatalf("%d: %#v", i, actual) - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/parse.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/parse.go b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/parse.go deleted file mode 100644 index d0719c2..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/parse.go +++ /dev/null @@ -1,23 +0,0 @@ -package hcl - -import ( - "fmt" - - "github.com/hashicorp/hcl/hcl/ast" - hclParser "github.com/hashicorp/hcl/hcl/parser" - jsonParser "github.com/hashicorp/hcl/json/parser" -) - -// Parse parses the given input and returns the root object. -// -// The input format can be either HCL or JSON. -func Parse(input string) (*ast.File, error) { - switch lexMode(input) { - case lexModeHcl: - return hclParser.Parse([]byte(input)) - case lexModeJson: - return jsonParser.Parse([]byte(input)) - } - - return nil, fmt.Errorf("unknown config format") -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.hcl deleted file mode 100644 index 9499944..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -bar = "${file("bing/bong.txt")}" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.json deleted file mode 100644 index 7bdddc8..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl deleted file mode 100644 index 4e415da..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl +++ /dev/null @@ -1 +0,0 @@ -count = "3" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl deleted file mode 100644 index 363697b..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl +++ /dev/null @@ -1,3 +0,0 @@ -foo="bar" -bar="${file("bing/bong.txt")}" -foo-bar="baz" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl deleted file mode 100644 index 5b185cc..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl +++ /dev/null @@ -1,15 +0,0 @@ -key "" { - policy = "read" -} - -key "foo/" { - policy = "write" -} - -key "foo/bar/" { - policy = "read" -} - -key "foo/bar/baz" { - policy = "deny" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.json deleted file mode 100644 index 151864e..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_policy.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "key": { - "": { - "policy": "read" - }, - - "foo/": { - "policy": "write" - }, - - "foo/bar/": { - "policy": "read" - }, - - "foo/bar/baz": { - "policy": "deny" - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl deleted file mode 100644 index 52dcaa1..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl +++ /dev/null @@ -1,10 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -variable "amis" { - default = { - east = "foo" - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json deleted file mode 100644 index 49f921e..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "variable": { - "foo": { - "default": "bar", - "description": "bar" - }, - - "amis": { - "default": { - "east": "foo" - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/empty.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/empty.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/empty.hcl deleted file mode 100644 index 5be1b23..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" {} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/escape.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/escape.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/escape.hcl deleted file mode 100644 index ead1b8b..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/escape.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = "bar\"baz\\n" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/flat.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/flat.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/flat.hcl deleted file mode 100644 index 9bca551..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/flat.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -Key = 7 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.hcl deleted file mode 100644 index eed44e5..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.hcl +++ /dev/null @@ -1 +0,0 @@ -a = 1.02 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.json deleted file mode 100644 index a9d1ab4..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/float.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "a": 1.02 -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl deleted file mode 100644 index 7b95391..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/interpolate_escape.hcl +++ /dev/null @@ -1 +0,0 @@ -foo="${file(\"bing/bong.txt\")}" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.hcl deleted file mode 100644 index f883bd7..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = <<EOF -bar -baz -EOF http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.json deleted file mode 100644 index 93f7cc5..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "bar\nbaz" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl deleted file mode 100644 index 4cd0f4d..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = <EOF -bar -baz -EOF http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl deleted file mode 100644 index faa1329..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl +++ /dev/null @@ -1,5 +0,0 @@ -foo = <<EOF -bar -baz -EOF -key = "value" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl deleted file mode 100644 index 55c1739..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = << http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl deleted file mode 100644 index e827782..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl +++ /dev/null @@ -1,5 +0,0 @@ -/* -foo = "bar/*" -*/ - -bar = "value" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/object_list.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/object_list.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/object_list.json deleted file mode 100644 index 73f3674..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/object_list.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "resource": { - "aws_instance": { - "db": { - "vpc": "foo", - "provisioner": [{ - "file": { - "source": "foo", - "destination": "bar" - } - }] - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.hcl deleted file mode 100644 index b9eca28..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.hcl +++ /dev/null @@ -1,6 +0,0 @@ -a = 1e-10 -b = 1e+10 -c = 1e10 -d = 1.2e-10 -e = 1.2e+10 -f = 1.2e10 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.json deleted file mode 100644 index c1fce3c..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/scientific.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "a": 1e-10, - "b": 1e+10, - "c": 1e10, - "d": 1.2e-10, - "e": 1.2e+10, - "f": 1.2e10 -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl deleted file mode 100644 index 4d3725f..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl +++ /dev/null @@ -1,7 +0,0 @@ -service "my-service-0" { - key = "value" -} - -service "my-service-1" { - key = "value" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.hcl deleted file mode 100644 index 18b6b1e..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.hcl +++ /dev/null @@ -1,5 +0,0 @@ -// This is a test structure for the lexer -foo "baz" { - key = 7 - foo = "bar" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.json deleted file mode 100644 index 30aa765..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "foo": [{ - "baz": [{ - "key": 7, - "foo": "bar" - }] - }] -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.hcl deleted file mode 100644 index 7577ffc..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.hcl +++ /dev/null @@ -1,9 +0,0 @@ -// This is a test structure for the lexer -foo "baz" { - key = 7 - foo = "bar" -} - -foo { - key = 7 -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.json deleted file mode 100644 index c51fcf5..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure2.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": [{ - "baz": { - "key": 7, - "foo": "bar" - } - }, { - "key": 7 - }] -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flat.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flat.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flat.json deleted file mode 100644 index 5256db4..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flat.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "foo": { - "baz": { - "key": 7, - "foo": "bar" - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl deleted file mode 100644 index fcf689e..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl +++ /dev/null @@ -1,7 +0,0 @@ -foo { - key = 7 -} - -foo { - foo = "bar" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl deleted file mode 100644 index 33193ae..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl +++ /dev/null @@ -1,6 +0,0 @@ -foo { - key = 7 -} -foo { - key = 12 -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.json deleted file mode 100644 index 806a60e..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "foo": [{ - "key": 7 - }, { - "key": 12 - }] -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json deleted file mode 100644 index 46e98be..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "bar": { - "foo": { - "name": "terraform_example", - "ingress": [ - { - "from_port": 22 - }, - { - "from_port": 80 - } - ] - } - } -} - http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl deleted file mode 100644 index e45b23d..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl +++ /dev/null @@ -1,7 +0,0 @@ -foo "baz" { - key = 7 -} - -foo "bar" { - key = 12 -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.json deleted file mode 100644 index 773761a..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/structure_multi.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "foo": { - "baz": { - "key": 7 - }, - - "bar": { - "key": 12 - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl deleted file mode 100644 index fda9241..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl +++ /dev/null @@ -1,5 +0,0 @@ -name = "terraform-test-app" - -config_vars { - FOO = "bar" -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json deleted file mode 100644 index e8c6fac..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "terraform-test-app", - "config_vars": { - "FOO": "bar" - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl deleted file mode 100644 index 5f623e0..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl +++ /dev/null @@ -1,3 +0,0 @@ -regularvar = "Should work" -map.key1 = "Value" -map.key2 = "Other value" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl deleted file mode 100644 index c0ce34d..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl +++ /dev/null @@ -1,2 +0,0 @@ -/* -Foo http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl b/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl deleted file mode 100644 index 31b37c4..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo "baz" { - bar = "baz" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore deleted file mode 100644 index 0026861..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE deleted file mode 100644 index c33dcc7..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. âContributorâ - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. âContributor Versionâ - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributorâs Contribution. - -1.3. âContributionâ - - means Covered Software of a particular Contributor. - -1.4. âCovered Softwareâ - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. âIncompatible With Secondary Licensesâ - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. âExecutable Formâ - - means any form of the work other than Source Code Form. - -1.7. âLarger Workâ - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. âLicenseâ - - means this document. - -1.9. âLicensableâ - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. âModificationsâ - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. âPatent Claimsâ of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. âSecondary Licenseâ - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. âSource Code Formâ - - means the form of the work preferred for making modifications. - -1.14. âYouâ (or âYourâ) - - means an individual or a legal entity exercising rights under this - License. For legal entities, âYouâ includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, âcontrolâ means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third partyâs - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipientsâ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipientsâ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an âas isâ basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - partyâs negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a partyâs ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - âIncompatible With Secondary Licensesâ Notice - - This Source Code Form is âIncompatible - With Secondary Licensesâ, as defined by - the Mozilla Public License, v. 2.0. - http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md deleted file mode 100644 index 49490ea..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# logutils - -logutils is a Go package that augments the standard library "log" package -to make logging a bit more modern, without fragmenting the Go ecosystem -with new logging packages. - -## The simplest thing that could possibly work - -Presumably your application already uses the default `log` package. To switch, you'll want your code to look like the following: - -```go -package main - -import ( - "log" - "os" - - "github.com/hashicorp/logutils" -) - -func main() { - filter := &logutils.LevelFilter{ - Levels: []logutils.LogLevel{"DEBUG", "WARN", "ERROR"}, - MinLevel: logutils.LogLevel("WARN"), - Writer: os.Stderr, - } - log.SetOutput(filter) - - log.Print("[DEBUG] Debugging") // this will not print - log.Print("[WARN] Warning") // this will - log.Print("[ERROR] Erring") // and so will this - log.Print("Message I haven't updated") // and so will this -} -``` - -This logs to standard error exactly like go's standard logger. Any log messages you haven't converted to have a level will continue to print as before. http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go deleted file mode 100644 index 6381bf1..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level.go +++ /dev/null @@ -1,81 +0,0 @@ -// Package logutils augments the standard log package with levels. -package logutils - -import ( - "bytes" - "io" - "sync" -) - -type LogLevel string - -// LevelFilter is an io.Writer that can be used with a logger that -// will filter out log messages that aren't at least a certain level. -// -// Once the filter is in use somewhere, it is not safe to modify -// the structure. -type LevelFilter struct { - // Levels is the list of log levels, in increasing order of - // severity. Example might be: {"DEBUG", "WARN", "ERROR"}. - Levels []LogLevel - - // MinLevel is the minimum level allowed through - MinLevel LogLevel - - // The underlying io.Writer where log messages that pass the filter - // will be set. - Writer io.Writer - - badLevels map[LogLevel]struct{} - once sync.Once -} - -// Check will check a given line if it would be included in the level -// filter. -func (f *LevelFilter) Check(line []byte) bool { - f.once.Do(f.init) - - // Check for a log level - var level LogLevel - x := bytes.IndexByte(line, '[') - if x >= 0 { - y := bytes.IndexByte(line[x:], ']') - if y >= 0 { - level = LogLevel(line[x+1 : x+y]) - } - } - - _, ok := f.badLevels[level] - return !ok -} - -func (f *LevelFilter) Write(p []byte) (n int, err error) { - // Note in general that io.Writer can receive any byte sequence - // to write, but the "log" package always guarantees that we only - // get a single line. We use that as a slight optimization within - // this method, assuming we're dealing with a single, complete line - // of log data. - - if !f.Check(p) { - return len(p), nil - } - - return f.Writer.Write(p) -} - -// SetMinLevel is used to update the minimum log level -func (f *LevelFilter) SetMinLevel(min LogLevel) { - f.MinLevel = min - f.init() -} - -func (f *LevelFilter) init() { - badLevels := make(map[LogLevel]struct{}) - for _, level := range f.Levels { - if level == f.MinLevel { - break - } - badLevels[level] = struct{}{} - } - f.badLevels = badLevels -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go deleted file mode 100644 index 3c2caf7..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_benchmark_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package logutils - -import ( - "io/ioutil" - "testing" -) - -var messages [][]byte - -func init() { - messages = [][]byte{ - []byte("[TRACE] foo"), - []byte("[DEBUG] foo"), - []byte("[INFO] foo"), - []byte("[WARN] foo"), - []byte("[ERROR] foo"), - } -} - -func BenchmarkDiscard(b *testing.B) { - for i := 0; i < b.N; i++ { - ioutil.Discard.Write(messages[i%len(messages)]) - } -} - -func BenchmarkLevelFilter(b *testing.B) { - filter := &LevelFilter{ - Levels: []LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"}, - MinLevel: "WARN", - Writer: ioutil.Discard, - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - filter.Write(messages[i%len(messages)]) - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go b/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go deleted file mode 100644 index f6b6ac3..0000000 --- a/newt/Godeps/_workspace/src/github.com/hashicorp/logutils/level_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package logutils - -import ( - "bytes" - "io" - "log" - "testing" -) - -func TestLevelFilter_impl(t *testing.T) { - var _ io.Writer = new(LevelFilter) -} - -func TestLevelFilter(t *testing.T) { - buf := new(bytes.Buffer) - filter := &LevelFilter{ - Levels: []LogLevel{"DEBUG", "WARN", "ERROR"}, - MinLevel: "WARN", - Writer: buf, - } - - logger := log.New(filter, "", 0) - logger.Print("[WARN] foo") - logger.Println("[ERROR] bar") - logger.Println("[DEBUG] baz") - logger.Println("[WARN] buzz") - - result := buf.String() - expected := "[WARN] foo\n[ERROR] bar\n[WARN] buzz\n" - if result != expected { - t.Fatalf("bad: %#v", result) - } -} - -func TestLevelFilterCheck(t *testing.T) { - filter := &LevelFilter{ - Levels: []LogLevel{"DEBUG", "WARN", "ERROR"}, - MinLevel: "WARN", - Writer: nil, - } - - testCases := []struct { - line string - check bool - }{ - {"[WARN] foo\n", true}, - {"[ERROR] bar\n", true}, - {"[DEBUG] baz\n", false}, - {"[WARN] buzz\n", true}, - } - - for _, testCase := range testCases { - result := filter.Check([]byte(testCase.line)) - if result != testCase.check { - t.Errorf("Fail: %s", testCase.line) - } - } -} - -func TestLevelFilter_SetMinLevel(t *testing.T) { - filter := &LevelFilter{ - Levels: []LogLevel{"DEBUG", "WARN", "ERROR"}, - MinLevel: "ERROR", - Writer: nil, - } - - testCases := []struct { - line string - checkBefore bool - checkAfter bool - }{ - {"[WARN] foo\n", false, true}, - {"[ERROR] bar\n", true, true}, - {"[DEBUG] baz\n", false, false}, - {"[WARN] buzz\n", false, true}, - } - - for _, testCase := range testCases { - result := filter.Check([]byte(testCase.line)) - if result != testCase.checkBefore { - t.Errorf("Fail: %s", testCase.line) - } - } - - // Update the minimum level to WARN - filter.SetMinLevel("WARN") - - for _, testCase := range testCases { - result := filter.Check([]byte(testCase.line)) - if result != testCase.checkAfter { - t.Errorf("Fail: %s", testCase.line) - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore b/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore deleted file mode 100644 index 7054822..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.sublime-project -*.sublime-workspace -*.un~ -*.swp http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml b/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml deleted file mode 100644 index ae2f187..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: - - 1.4 - - 1.4.1 - - 1.4.2 - - 1.4.3 - - 1.5 - - 1.5.1 - - 1.5.2 - - tip http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/CHANGELOG.md ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/CHANGELOG.md b/newt/Godeps/_workspace/src/github.com/magiconair/properties/CHANGELOG.md deleted file mode 100644 index 160cd83..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/CHANGELOG.md +++ /dev/null @@ -1,75 +0,0 @@ -## Changelog - -### [1.6.0](https://github.com/magiconair/properties/tags/v1.6.0) - 11 Dec 2015 - - * Add [Decode](http://godoc.org/github.com/magiconair/properties#Properties.Decode) method to populate struct from properties via tags. - -### [1.5.6](https://github.com/magiconair/properties/tags/v1.5.6) - 18 Oct 2015 - - * Vendored in gopkg.in/check.v1 - -### [1.5.5](https://github.com/magiconair/properties/tags/v1.5.5) - 31 Jul 2015 - - * [Pull Request #6](https://github.com/magiconair/properties/pull/6): Add [Delete](http://godoc.org/github.com/magiconair/properties#Properties.Delete) method to remove keys including comments. (@gerbenjacobs) - -### [1.5.4](https://github.com/magiconair/properties/tags/v1.5.4) - 23 Jun 2015 - - * [Issue #5](https://github.com/magiconair/properties/issues/5): Allow disabling of property expansion [DisableExpansion](http://godoc.org/github.com/magiconair/properties#Properties.DisableExpansion). When property expansion is disabled Properties become a simple key/value store and don't check for circular references. - -### [1.5.3](https://github.com/magiconair/properties/tags/v1.5.3) - 02 Jun 2015 - - * [Issue #4](https://github.com/magiconair/properties/issues/4): Maintain key order in [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) and [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) - -### [1.5.2](https://github.com/magiconair/properties/tags/v1.5.2) - 10 Apr 2015 - - * [Issue #3](https://github.com/magiconair/properties/issues/3): Don't print comments in [WriteComment()](http://godoc.org/github.com/magiconair/properties#Properties.WriteComment) if they are all empty - * Add clickable links to README - -### [1.5.1](https://github.com/magiconair/properties/tags/v1.5.1) - 08 Dec 2014 - - * Added [GetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.GetParsedDuration) and [MustGetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.MustGetParsedDuration) for values specified compatible with - [time.ParseDuration()](http://golang.org/pkg/time/#ParseDuration). - -### [1.5.0](https://github.com/magiconair/properties/tags/v1.5.0) - 18 Nov 2014 - - * Added support for single and multi-line comments (reading, writing and updating) - * The order of keys is now preserved - * Calling [Set()](http://godoc.org/github.com/magiconair/properties#Properties.Set) with an empty key now silently ignores the call and does not create a new entry - * Added a [MustSet()](http://godoc.org/github.com/magiconair/properties#Properties.MustSet) method - * Migrated test library from launchpad.net/gocheck to [gopkg.in/check.v1](http://gopkg.in/check.v1) - -### [1.4.2](https://github.com/magiconair/properties/tags/v1.4.2) - 15 Nov 2014 - - * [Issue #2](https://github.com/magiconair/properties/issues/2): Fixed goroutine leak in parser which created two lexers but cleaned up only one - -### [1.4.1](https://github.com/magiconair/properties/tags/v1.4.1) - 13 Nov 2014 - - * [Issue #1](https://github.com/magiconair/properties/issues/1): Fixed bug in Keys() method which returned an empty string - -### [1.4.0](https://github.com/magiconair/properties/tags/v1.4.0) - 23 Sep 2014 - - * Added [Keys()](http://godoc.org/github.com/magiconair/properties#Properties.Keys) to get the keys - * Added [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) and [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) to get a subset of the properties - -### [1.3.0](https://github.com/magiconair/properties/tags/v1.3.0) - 18 Mar 2014 - -* Added support for time.Duration -* Made MustXXX() failure beha[ior configurable (log.Fatal, panic](https://github.com/magiconair/properties/tags/vior configurable (log.Fatal, panic) - custom) -* Changed default of MustXXX() failure from panic to log.Fatal - -### [1.2.0](https://github.com/magiconair/properties/tags/v1.2.0) - 05 Mar 2014 - -* Added MustGet... functions -* Added support for int and uint with range checks on 32 bit platforms - -### [1.1.0](https://github.com/magiconair/properties/tags/v1.1.0) - 20 Jan 2014 - -* Renamed from goproperties to properties -* Added support for expansion of environment vars in - filenames and value expressions -* Fixed bug where value expressions were not at the - start of the string - -### [1.0.0](https://github.com/magiconair/properties/tags/v1.0.0) - 7 Jan 2014 - -* Initial release http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE b/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE deleted file mode 100644 index 7eab43b..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -goproperties - properties file decoder for Go - -Copyright (c) 2013-2014 - Frank Schroeder - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md b/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md deleted file mode 100644 index b3b2e5c..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/README.md +++ /dev/null @@ -1,79 +0,0 @@ -Overview [![Build Status](https://travis-ci.org/magiconair/properties.svg?branch=master)](https://travis-ci.org/magiconair/properties) -======== - -#### Current version: 1.6.0 - -properties is a Go library for reading and writing properties files. - -It supports reading from multiple files and Spring style recursive property -expansion of expressions like `${key}` to their corresponding value. -Value expressions can refer to other keys like in `${key}` or to -environment variables like in `${USER}`. -Filenames can also contain environment variables like in -`/home/${USER}/myapp.properties`. - -Properties can be decoded into structs, maps, arrays and values through -struct tags. - -Comments and the order of keys are preserved. Comments can be modified -and can be written to the output. - -The properties library supports both ISO-8859-1 and UTF-8 encoded data. - -Starting from version 1.3.0 the behavior of the MustXXX() functions is -configurable by providing a custom `ErrorHandler` function. The default has -changed from `panic` to `log.Fatal` but this is configurable and custom -error handling functions can be provided. See the package documentation for -details. - -Getting Started ---------------- - -```go -import ( - "flag" - "github.com/magiconair/properties" -) - -func main() { - p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8) - - // via getters - host := p.MustGetString("host") - port := p.GetInt("port", 8080) - - // or via decode - type Config struct { - Host string `properties:"host"` - Port int `properties:"port,default=9000"` - Accept []string `properties:"accept,default=image/png;image;gif"` - Timeout time.Duration `properties:"timeout,default=5s"` - } - var cfg Config - if err := p.Decode(&cfg); err != nil { - log.Fatal(err) - } - - // or via flags - p.MustFlag(flag.CommandLine) -} - -``` - -Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties) [![GoDoc](https://godoc.org/github.com/magiconair/properties?status.png)](https://godoc.org/github.com/magiconair/properties) - -Installation and Upgrade ------------------------- - -``` -$ go get -u github.com/magiconair/properties -``` - -License -------- - -2 clause BSD license. See [LICENSE](https://github.com/magiconair/properties/blob/master/LICENSE) file for details. - -ToDo ----- -* Dump contents with passwords and secrets obscured http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go deleted file mode 100644 index b2019e1..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/benchmark_test.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2013-2014 Frank Schroeder. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package properties - -import ( - "fmt" - "testing" -) - -// Benchmarks the decoder by creating a property file with 1000 key/value pairs. -func BenchmarkLoad(b *testing.B) { - input := "" - for i := 0; i < 1000; i++ { - input += fmt.Sprintf("key%d=value%d\n", i, i) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - Load([]byte(input), ISO_8859_1) - } -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode.go deleted file mode 100644 index cef8c3a..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode.go +++ /dev/null @@ -1,286 +0,0 @@ -package properties - -import ( - "fmt" - "reflect" - "strconv" - "strings" - "time" -) - -// Decode assigns property values to exported fields of a struct. -// -// Decode traverses v recursively and returns an error if a value cannot be -// converted to the field type or a required value is missing for a field. -// -// The following type dependent decodings are used: -// -// String, boolean, numeric fields have the value of the property key assigned. -// The property key name is the name of the field. A different key and a default -// value can be set in the field's tag. Fields without default value are -// required. If the value cannot be converted to the field type an error is -// returned. -// -// time.Duration fields have the result of time.ParseDuration() assigned. -// -// time.Time fields have the vaule of time.Parse() assigned. The default layout -// is time.RFC3339 but can be set in the field's tag. -// -// Arrays and slices of string, boolean, numeric, time.Duration and time.Time -// fields have the value interpreted as a comma separated list of values. The -// individual values are trimmed of whitespace and empty values are ignored. A -// default value can be provided as a semicolon separated list in the field's -// tag. -// -// Struct fields are decoded recursively using the field name plus "." as -// prefix. The prefix (without dot) can be overridden in the field's tag. -// Default values are not supported in the field's tag. Specify them on the -// fields of the inner struct instead. -// -// Map fields must have a key of type string and are decoded recursively by -// using the field's name plus ".' as prefix and the next element of the key -// name as map key. The prefix (without dot) can be overridden in the field's -// tag. Default values are not supported. -// -// Examples: -// -// // Field is ignored. -// Field int `properties:"-"` -// -// // Field is assigned value of 'Field'. -// Field int -// -// // Field is assigned value of 'myName'. -// Field int `properties:"myName"` -// -// // Field is assigned value of key 'myName' and has a default -// // value 15 if the key does not exist. -// Field int `properties:"myName,default=15"` -// -// // Field is assigned value of key 'Field' and has a default -// // value 15 if the key does not exist. -// Field int `properties:",default=15"` -// -// // Field is assigned value of key 'date' and the date -// // is in format 2006-01-02 -// Field time.Time `properties:"date,layout=2006-01-02"` -// -// // Field is assigned the non-empty and whitespace trimmed -// // values of key 'Field' split by commas. -// Field []string -// -// // Field is assigned the non-empty and whitespace trimmed -// // values of key 'Field' split by commas and has a default -// // value ["a", "b", "c"] if the key does not exist. -// Field []string `properties:",default=a;b;c"` -// -// // Field is decoded recursively with "Field." as key prefix. -// Field SomeStruct -// -// // Field is decoded recursively with "myName." as key prefix. -// Field SomeStruct `properties:"myName"` -// -// // Field is decoded recursively with "Field." as key prefix -// // and the next dotted element of the key as map key. -// Field map[string]string -// -// // Field is decoded recursively with "myName." as key prefix -// // and the next dotted element of the key as map key. -// Field map[string]string `properties:"myName"` -func (p *Properties) Decode(x interface{}) error { - t, v := reflect.TypeOf(x), reflect.ValueOf(x) - if t.Kind() != reflect.Ptr || v.Elem().Type().Kind() != reflect.Struct { - return fmt.Errorf("not a pointer to struct: %s", t) - } - if err := dec(p, "", nil, nil, v); err != nil { - return err - } - return nil -} - -func dec(p *Properties, key string, def *string, opts map[string]string, v reflect.Value) error { - t := v.Type() - - // value returns the property value for key or the default if provided. - value := func() (string, error) { - if val, ok := p.Get(key); ok { - return val, nil - } - if def != nil { - return *def, nil - } - return "", fmt.Errorf("missing required key %s", key) - } - - // conv converts a string to a value of the given type. - conv := func(s string, t reflect.Type) (val reflect.Value, err error) { - var v interface{} - - switch { - case isDuration(t): - v, err = time.ParseDuration(s) - - case isTime(t): - layout := opts["layout"] - if layout == "" { - layout = time.RFC3339 - } - v, err = time.Parse(layout, s) - - case isBool(t): - v, err = boolVal(s), nil - - case isString(t): - v, err = s, nil - - case isFloat(t): - v, err = strconv.ParseFloat(s, 64) - - case isInt(t): - v, err = strconv.ParseInt(s, 10, 64) - - case isUint(t): - v, err = strconv.ParseUint(s, 10, 64) - - default: - return reflect.Zero(t), fmt.Errorf("unsupported type %s", t) - } - if err != nil { - return reflect.Zero(t), err - } - return reflect.ValueOf(v).Convert(t), nil - } - - // keydef returns the property key and the default value based on the - // name of the struct field and the options in the tag. - keydef := func(f reflect.StructField) (string, *string, map[string]string) { - key, opts := parseTag(f.Tag.Get("properties")) - - var def *string - if d, ok := opts["default"]; ok { - def = &d - } - if key != "" { - return key, def, opts - } - return f.Name, def, opts - } - - switch { - case isDuration(t) || isTime(t) || isBool(t) || isString(t) || isFloat(t) || isInt(t) || isUint(t): - s, err := value() - if err != nil { - return err - } - val, err := conv(s, t) - if err != nil { - return err - } - v.Set(val) - - case isPtr(t): - return dec(p, key, def, opts, v.Elem()) - - case isStruct(t): - for i := 0; i < v.NumField(); i++ { - fv := v.Field(i) - fk, def, opts := keydef(t.Field(i)) - if !fv.CanSet() { - return fmt.Errorf("cannot set ", t.Field(i).Name) - } - if fk == "-" { - continue - } - if key != "" { - fk = key + "." + fk - } - if err := dec(p, fk, def, opts, fv); err != nil { - return err - } - } - return nil - - case isArray(t): - val, err := value() - if err != nil { - return err - } - vals := split(val, ";") - a := reflect.MakeSlice(t, 0, len(vals)) - for _, s := range vals { - val, err := conv(s, t.Elem()) - if err != nil { - return err - } - a = reflect.Append(a, val) - } - v.Set(a) - - case isMap(t): - valT := t.Elem() - m := reflect.MakeMap(t) - for postfix, _ := range p.FilterStripPrefix(key + ".").m { - pp := strings.SplitN(postfix, ".", 2) - mk, mv := pp[0], reflect.New(valT) - if err := dec(p, key+"."+mk, nil, nil, mv); err != nil { - return err - } - m.SetMapIndex(reflect.ValueOf(mk), mv.Elem()) - } - v.Set(m) - - default: - return fmt.Errorf("unsupported type %s", t) - } - return nil -} - -// split splits a string on sep, trims whitespace of elements -// and omits empty elements -func split(s string, sep string) []string { - var a []string - for _, v := range strings.Split(s, sep) { - if v = strings.TrimSpace(v); v != "" { - a = append(a, v) - } - } - return a -} - -// parseTag parses a "key,k=v,k=v,..." -func parseTag(tag string) (key string, opts map[string]string) { - opts = map[string]string{} - for i, s := range strings.Split(tag, ",") { - if i == 0 { - key = s - continue - } - - pp := strings.SplitN(s, "=", 2) - if len(pp) == 1 { - opts[pp[0]] = "" - } else { - opts[pp[0]] = pp[1] - } - } - return key, opts -} - -func isArray(t reflect.Type) bool { return t.Kind() == reflect.Array || t.Kind() == reflect.Slice } -func isBool(t reflect.Type) bool { return t.Kind() == reflect.Bool } -func isDuration(t reflect.Type) bool { return t == reflect.TypeOf(time.Second) } -func isMap(t reflect.Type) bool { return t.Kind() == reflect.Map } -func isNumeric(t reflect.Type) bool { return isInt(t) || isUint(t) || isFloat(t) } -func isPtr(t reflect.Type) bool { return t.Kind() == reflect.Ptr } -func isString(t reflect.Type) bool { return t.Kind() == reflect.String } -func isStruct(t reflect.Type) bool { return t.Kind() == reflect.Struct } -func isTime(t reflect.Type) bool { return t == reflect.TypeOf(time.Time{}) } -func isFloat(t reflect.Type) bool { - return t.Kind() == reflect.Float32 || t.Kind() == reflect.Float64 -} -func isInt(t reflect.Type) bool { - return t.Kind() == reflect.Int || t.Kind() == reflect.Int8 || t.Kind() == reflect.Int16 || t.Kind() == reflect.Int32 || t.Kind() == reflect.Int64 -} -func isUint(t reflect.Type) bool { - return t.Kind() == reflect.Uint || t.Kind() == reflect.Uint8 || t.Kind() == reflect.Uint16 || t.Kind() == reflect.Uint32 || t.Kind() == reflect.Uint64 -} http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/4ae9684f/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode_test.go ---------------------------------------------------------------------- diff --git a/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode_test.go b/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode_test.go deleted file mode 100644 index 4115fbb..0000000 --- a/newt/Godeps/_workspace/src/github.com/magiconair/properties/decode_test.go +++ /dev/null @@ -1,295 +0,0 @@ -package properties - -import ( - "reflect" - "testing" - "time" -) - -func TestDecodeValues(t *testing.T) { - type S struct { - S string - BT bool - BF bool - I int - I8 int8 - I16 int16 - I32 int32 - I64 int64 - U uint - U8 uint8 - U16 uint16 - U32 uint32 - U64 uint64 - F32 float32 - F64 float64 - D time.Duration - TM time.Time - } - in := ` - S=abc - BT=true - BF=false - I=-1 - I8=-8 - I16=-16 - I32=-32 - I64=-64 - U=1 - U8=8 - U16=16 - U32=32 - U64=64 - F32=3.2 - F64=6.4 - D=5s - TM=2015-01-02T12:34:56Z - ` - out := &S{ - S: "abc", - BT: true, - BF: false, - I: -1, - I8: -8, - I16: -16, - I32: -32, - I64: -64, - U: 1, - U8: 8, - U16: 16, - U32: 32, - U64: 64, - F32: 3.2, - F64: 6.4, - D: 5 * time.Second, - TM: tm(t, time.RFC3339, "2015-01-02T12:34:56Z"), - } - testDecode(t, in, &S{}, out) -} - -func TestDecodeValueDefaults(t *testing.T) { - type S struct { - S string `properties:",default=abc"` - BT bool `properties:",default=true"` - BF bool `properties:",default=false"` - I int `properties:",default=-1"` - I8 int8 `properties:",default=-8"` - I16 int16 `properties:",default=-16"` - I32 int32 `properties:",default=-32"` - I64 int64 `properties:",default=-64"` - U uint `properties:",default=1"` - U8 uint8 `properties:",default=8"` - U16 uint16 `properties:",default=16"` - U32 uint32 `properties:",default=32"` - U64 uint64 `properties:",default=64"` - F32 float32 `properties:",default=3.2"` - F64 float64 `properties:",default=6.4"` - D time.Duration `properties:",default=5s"` - TM time.Time `properties:",default=2015-01-02T12:34:56Z"` - } - out := &S{ - S: "abc", - BT: true, - BF: false, - I: -1, - I8: -8, - I16: -16, - I32: -32, - I64: -64, - U: 1, - U8: 8, - U16: 16, - U32: 32, - U64: 64, - F32: 3.2, - F64: 6.4, - D: 5 * time.Second, - TM: tm(t, time.RFC3339, "2015-01-02T12:34:56Z"), - } - testDecode(t, "", &S{}, out) -} - -func TestDecodeArrays(t *testing.T) { - type S struct { - S []string - B []bool - I []int - I8 []int8 - I16 []int16 - I32 []int32 - I64 []int64 - U []uint - U8 []uint8 - U16 []uint16 - U32 []uint32 - U64 []uint64 - F32 []float32 - F64 []float64 - D []time.Duration - TM []time.Time - } - in := ` - S=a;b - B=true;false - I=-1;-2 - I8=-8;-9 - I16=-16;-17 - I32=-32;-33 - I64=-64;-65 - U=1;2 - U8=8;9 - U16=16;17 - U32=32;33 - U64=64;65 - F32=3.2;3.3 - F64=6.4;6.5 - D=4s;5s - TM=2015-01-01T00:00:00Z;2016-01-01T00:00:00Z - ` - out := &S{ - S: []string{"a", "b"}, - B: []bool{true, false}, - I: []int{-1, -2}, - I8: []int8{-8, -9}, - I16: []int16{-16, -17}, - I32: []int32{-32, -33}, - I64: []int64{-64, -65}, - U: []uint{1, 2}, - U8: []uint8{8, 9}, - U16: []uint16{16, 17}, - U32: []uint32{32, 33}, - U64: []uint64{64, 65}, - F32: []float32{3.2, 3.3}, - F64: []float64{6.4, 6.5}, - D: []time.Duration{4 * time.Second, 5 * time.Second}, - TM: []time.Time{tm(t, time.RFC3339, "2015-01-01T00:00:00Z"), tm(t, time.RFC3339, "2016-01-01T00:00:00Z")}, - } - testDecode(t, in, &S{}, out) -} - -func TestDecodeArrayDefaults(t *testing.T) { - type S struct { - S []string `properties:",default=a;b"` - B []bool `properties:",default=true;false"` - I []int `properties:",default=-1;-2"` - I8 []int8 `properties:",default=-8;-9"` - I16 []int16 `properties:",default=-16;-17"` - I32 []int32 `properties:",default=-32;-33"` - I64 []int64 `properties:",default=-64;-65"` - U []uint `properties:",default=1;2"` - U8 []uint8 `properties:",default=8;9"` - U16 []uint16 `properties:",default=16;17"` - U32 []uint32 `properties:",default=32;33"` - U64 []uint64 `properties:",default=64;65"` - F32 []float32 `properties:",default=3.2;3.3"` - F64 []float64 `properties:",default=6.4;6.5"` - D []time.Duration `properties:",default=4s;5s"` - TM []time.Time `properties:",default=2015-01-01T00:00:00Z;2016-01-01T00:00:00Z"` - } - out := &S{ - S: []string{"a", "b"}, - B: []bool{true, false}, - I: []int{-1, -2}, - I8: []int8{-8, -9}, - I16: []int16{-16, -17}, - I32: []int32{-32, -33}, - I64: []int64{-64, -65}, - U: []uint{1, 2}, - U8: []uint8{8, 9}, - U16: []uint16{16, 17}, - U32: []uint32{32, 33}, - U64: []uint64{64, 65}, - F32: []float32{3.2, 3.3}, - F64: []float64{6.4, 6.5}, - D: []time.Duration{4 * time.Second, 5 * time.Second}, - TM: []time.Time{tm(t, time.RFC3339, "2015-01-01T00:00:00Z"), tm(t, time.RFC3339, "2016-01-01T00:00:00Z")}, - } - testDecode(t, "", &S{}, out) -} - -func TestDecodeSkipUndef(t *testing.T) { - type S struct { - X string `properties:"-"` - Undef string `properties:",default=some value"` - } - in := `X=ignore` - out := &S{"", "some value"} - testDecode(t, in, &S{}, out) -} - -func TestDecodeStruct(t *testing.T) { - type A struct { - S string - T string `properties:"t"` - U string `properties:"u,default=uuu"` - } - type S struct { - A A - B A `properties:"b"` - } - in := ` - A.S=sss - A.t=ttt - b.S=SSS - b.t=TTT - ` - out := &S{ - A{S: "sss", T: "ttt", U: "uuu"}, - A{S: "SSS", T: "TTT", U: "uuu"}, - } - testDecode(t, in, &S{}, out) -} - -func TestDecodeMap(t *testing.T) { - type S struct { - A string `properties:"a"` - } - type X struct { - A map[string]string - B map[string][]string - C map[string]map[string]string - D map[string]S - E map[string]int - F map[string]int `properties:"-"` - } - in := ` - A.foo=bar - A.bar=bang - B.foo=a;b;c - B.bar=1;2;3 - C.foo.one=1 - C.foo.two=2 - C.bar.three=3 - C.bar.four=4 - D.foo.a=bar - ` - out := &X{ - A: map[string]string{"foo": "bar", "bar": "bang"}, - B: map[string][]string{"foo": []string{"a", "b", "c"}, "bar": []string{"1", "2", "3"}}, - C: map[string]map[string]string{"foo": map[string]string{"one": "1", "two": "2"}, "bar": map[string]string{"three": "3", "four": "4"}}, - D: map[string]S{"foo": S{"bar"}}, - E: map[string]int{}, - } - testDecode(t, in, &X{}, out) -} - -func testDecode(t *testing.T, in string, v, out interface{}) { - p, err := parse(in) - if err != nil { - t.Fatalf("got %v want nil", err) - } - if err := p.Decode(v); err != nil { - t.Fatalf("got %v want nil", err) - } - if got, want := v, out; !reflect.DeepEqual(got, want) { - t.Fatalf("\ngot %+v\nwant %+v", got, want) - } -} - -func tm(t *testing.T, layout, s string) time.Time { - tm, err := time.Parse(layout, s) - if err != nil { - t.Fatalf("got %v want nil", err) - } - return tm -}