diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 104bff7d5f1..ee9d78e1470 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -20,53 +20,63 @@
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/endpoints",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ },
+ {
+ "ImportPath": "github.com/aws/aws-sdk-go/private/waiter",
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatch",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
- "Comment": "v0.9.16-3-g4944a94",
- "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a"
+ "Comment": "v0.10.4-18-gce51895",
+ "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
},
{
"ImportPath": "github.com/davecgh/go-spew/spew",
"Rev": "2df174808ee097f90d259e432cc04442cf60be21"
},
+ {
+ "ImportPath": "github.com/go-ini/ini",
+ "Comment": "v0-48-g060d7da",
+ "Rev": "060d7da055ba6ec5ea7a31f116332fe5efa04ce0"
+ },
{
"ImportPath": "github.com/go-ldap/ldap",
"Comment": "v1-19-g83e6542",
@@ -90,6 +100,11 @@
"ImportPath": "github.com/gosimple/slug",
"Rev": "8d258463b4459f161f51d6a357edacd3eef9d663"
},
+ {
+ "ImportPath": "github.com/jmespath/go-jmespath",
+ "Comment": "0.2.2",
+ "Rev": "3433f3ea46d9f8019119e7dd41274e112a2359a9"
+ },
{
"ImportPath": "github.com/jtolds/gls",
"Rev": "f1ac7f4f24f50328e6bc838ca4437d1612a0243c"
@@ -124,10 +139,6 @@
"ImportPath": "github.com/streadway/amqp",
"Rev": "150b7f24d6ad507e6026c13d85ce1f1391ac7400"
},
- {
- "ImportPath": "github.com/vaughan0/go-ini",
- "Rev": "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1"
- },
{
"ImportPath": "golang.org/x/net/context",
"Rev": "972f0c5fbe4ae29e666c3f78c3ed42ae7a448b0a"
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go
index f91743c6e1d..8429470b9d7 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go
@@ -57,16 +57,13 @@ func rcopy(dst, src reflect.Value, root bool) {
}
}
case reflect.Struct:
- if !root {
- dst.Set(reflect.New(src.Type()).Elem())
- }
-
t := dst.Type()
for i := 0; i < t.NumField(); i++ {
name := t.Field(i).Name
- srcval := src.FieldByName(name)
- if srcval.IsValid() {
- rcopy(dst.FieldByName(name), srcval, false)
+ srcVal := src.FieldByName(name)
+ dstVal := dst.FieldByName(name)
+ if srcVal.IsValid() && dstVal.CanSet() {
+ rcopy(dstVal, srcVal, false)
}
}
case reflect.Slice:
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go
index 4f26241a2b8..84b7e3f34aa 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go
@@ -77,6 +77,28 @@ func TestCopy(t *testing.T) {
assert.NotEqual(t, f2.C, f1.C)
}
+func TestCopyNestedWithUnexported(t *testing.T) {
+ type Bar struct {
+ a int
+ B int
+ }
+ type Foo struct {
+ A string
+ B Bar
+ }
+
+ f1 := &Foo{A: "string", B: Bar{a: 1, B: 2}}
+
+ var f2 Foo
+ awsutil.Copy(&f2, f1)
+
+ // Values match
+ assert.Equal(t, f2.A, f1.A)
+ assert.NotEqual(t, f2.B, f1.B)
+ assert.NotEqual(t, f2.B.a, f1.B.a)
+ assert.Equal(t, f2.B.B, f2.B.B)
+}
+
func TestCopyIgnoreNilMembers(t *testing.T) {
type Foo struct {
A *string
@@ -136,6 +158,8 @@ func TestCopyDifferentStructs(t *testing.T) {
C map[string]*int
SrcUnique string
SameNameDiffType int
+ unexportedPtr *int
+ ExportedPtr *int
}
type DstFoo struct {
A int
@@ -143,6 +167,8 @@ func TestCopyDifferentStructs(t *testing.T) {
C map[string]*int
DstUnique int
SameNameDiffType string
+ unexportedPtr *int
+ ExportedPtr *int
}
// Create the initial value
@@ -159,6 +185,8 @@ func TestCopyDifferentStructs(t *testing.T) {
},
SrcUnique: "unique",
SameNameDiffType: 1,
+ unexportedPtr: &int1,
+ ExportedPtr: &int2,
}
// Do the copy
@@ -173,6 +201,10 @@ func TestCopyDifferentStructs(t *testing.T) {
assert.Equal(t, 1, f1.SameNameDiffType)
assert.Equal(t, 0, f2.DstUnique)
assert.Equal(t, "", f2.SameNameDiffType)
+ assert.Equal(t, int1, *f1.unexportedPtr)
+ assert.Nil(t, f2.unexportedPtr)
+ assert.Equal(t, int2, *f1.ExportedPtr)
+ assert.Equal(t, int2, *f2.ExportedPtr)
}
func ExampleCopyOf() {
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
new file mode 100644
index 00000000000..59fa4a558a9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
@@ -0,0 +1,27 @@
+package awsutil
+
+import (
+ "reflect"
+)
+
+// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual.
+// In addition to this, this method will also dereference the input values if
+// possible so the DeepEqual performed will not fail if one parameter is a
+// pointer and the other is not.
+//
+// DeepEqual will not perform indirection of nested values of the input parameters.
+func DeepEqual(a, b interface{}) bool {
+ ra := reflect.Indirect(reflect.ValueOf(a))
+ rb := reflect.Indirect(reflect.ValueOf(b))
+
+ if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid {
+ // If the elements are both nil, and of the same type the are equal
+ // If they are of different types they are not equal
+ return reflect.TypeOf(a) == reflect.TypeOf(b)
+ } else if raValid != rbValid {
+ // Both values must be valid to be equal
+ return false
+ }
+
+ return reflect.DeepEqual(ra.Interface(), rb.Interface())
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go
new file mode 100644
index 00000000000..7a5db6e49bc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go
@@ -0,0 +1,29 @@
+package awsutil_test
+
+import (
+ "testing"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awsutil"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestDeepEqual(t *testing.T) {
+ cases := []struct {
+ a, b interface{}
+ equal bool
+ }{
+ {"a", "a", true},
+ {"a", "b", false},
+ {"a", aws.String(""), false},
+ {"a", nil, false},
+ {"a", aws.String("a"), true},
+ {(*bool)(nil), (*bool)(nil), true},
+ {(*bool)(nil), (*string)(nil), false},
+ {nil, nil, true},
+ }
+
+ for i, c := range cases {
+ assert.Equal(t, c.equal, awsutil.DeepEqual(c.a, c.b), "%d, a:%v b:%v, %t", i, c.a, c.b, c.equal)
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
index 905d82385ec..8c0dc2d8d24 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
@@ -5,6 +5,8 @@ import (
"regexp"
"strconv"
"strings"
+
+ "github.com/jmespath/go-jmespath"
)
var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`)
@@ -16,7 +18,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool)
if len(pathparts) > 1 {
for _, pathpart := range pathparts {
vals := rValuesAtPath(v, pathpart, create, caseSensitive)
- if vals != nil && len(vals) > 0 {
+ if len(vals) > 0 {
return vals
}
}
@@ -142,46 +144,67 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool)
return values
}
-// ValuesAtPath returns a list of objects at the lexical path inside of a structure
-func ValuesAtPath(i interface{}, path string) []interface{} {
- if rvals := rValuesAtPath(i, path, false, true); rvals != nil {
- vals := make([]interface{}, len(rvals))
- for i, rval := range rvals {
- vals[i] = rval.Interface()
- }
- return vals
+// ValuesAtPath returns a list of values at the case insensitive lexical
+// path inside of a structure.
+func ValuesAtPath(i interface{}, path string) ([]interface{}, error) {
+ result, err := jmespath.Search(path, i)
+ if err != nil {
+ return nil, err
}
- return nil
+
+ v := reflect.ValueOf(result)
+ if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) {
+ return nil, nil
+ }
+ if s, ok := result.([]interface{}); ok {
+ return s, err
+ }
+ if v.Kind() == reflect.Map && v.Len() == 0 {
+ return nil, nil
+ }
+ if v.Kind() == reflect.Slice {
+ out := make([]interface{}, v.Len())
+ for i := 0; i < v.Len(); i++ {
+ out[i] = v.Index(i).Interface()
+ }
+ return out, nil
+ }
+
+ return []interface{}{result}, nil
}
-// ValuesAtAnyPath returns a list of objects at the case-insensitive lexical
-// path inside of a structure
-func ValuesAtAnyPath(i interface{}, path string) []interface{} {
- if rvals := rValuesAtPath(i, path, false, false); rvals != nil {
- vals := make([]interface{}, len(rvals))
- for i, rval := range rvals {
- vals[i] = rval.Interface()
- }
- return vals
- }
- return nil
-}
-
-// SetValueAtPath sets an object at the lexical path inside of a structure
+// SetValueAtPath sets a value at the case insensitive lexical path inside
+// of a structure.
func SetValueAtPath(i interface{}, path string, v interface{}) {
- if rvals := rValuesAtPath(i, path, true, true); rvals != nil {
- for _, rval := range rvals {
- rval.Set(reflect.ValueOf(v))
- }
- }
-}
-
-// SetValueAtAnyPath sets an object at the case insensitive lexical path inside
-// of a structure
-func SetValueAtAnyPath(i interface{}, path string, v interface{}) {
if rvals := rValuesAtPath(i, path, true, false); rvals != nil {
for _, rval := range rvals {
- rval.Set(reflect.ValueOf(v))
+ setValue(rval, v)
}
}
}
+
+func setValue(dstVal reflect.Value, src interface{}) {
+ if dstVal.Kind() == reflect.Ptr {
+ dstVal = reflect.Indirect(dstVal)
+ }
+ srcVal := reflect.ValueOf(src)
+
+ if !srcVal.IsValid() { // src is literal nil
+ if dstVal.CanAddr() {
+ // Convert to pointer so that pointer's value can be nil'ed
+ // dstVal = dstVal.Addr()
+ }
+ dstVal.Set(reflect.Zero(dstVal.Type()))
+
+ } else if srcVal.Kind() == reflect.Ptr {
+ if srcVal.IsNil() {
+ srcVal = reflect.Zero(dstVal.Type())
+ } else {
+ srcVal = reflect.ValueOf(src).Elem()
+ }
+ dstVal.Set(srcVal)
+ } else {
+ dstVal.Set(srcVal)
+ }
+
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go
index 0da6b06fddc..378a4864848 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go
@@ -13,6 +13,7 @@ type Struct struct {
B *Struct
D *Struct
C string
+ E map[string]string
}
var data = Struct{
@@ -21,30 +22,69 @@ var data = Struct{
B: &Struct{B: &Struct{C: "terminal"}, D: &Struct{C: "terminal2"}},
C: "initial",
}
+var data2 = Struct{A: []Struct{
+ {A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}},
+ {A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}},
+}}
func TestValueAtPathSuccess(t *testing.T) {
- assert.Equal(t, []interface{}{"initial"}, awsutil.ValuesAtPath(data, "C"))
- assert.Equal(t, []interface{}{"value1"}, awsutil.ValuesAtPath(data, "A[0].C"))
- assert.Equal(t, []interface{}{"value2"}, awsutil.ValuesAtPath(data, "A[1].C"))
- assert.Equal(t, []interface{}{"value3"}, awsutil.ValuesAtPath(data, "A[2].C"))
- assert.Equal(t, []interface{}{"value3"}, awsutil.ValuesAtAnyPath(data, "a[2].c"))
- assert.Equal(t, []interface{}{"value3"}, awsutil.ValuesAtPath(data, "A[-1].C"))
- assert.Equal(t, []interface{}{"value1", "value2", "value3"}, awsutil.ValuesAtPath(data, "A[].C"))
- assert.Equal(t, []interface{}{"terminal"}, awsutil.ValuesAtPath(data, "B . B . C"))
- assert.Equal(t, []interface{}{"terminal", "terminal2"}, awsutil.ValuesAtPath(data, "B.*.C"))
- assert.Equal(t, []interface{}{"initial"}, awsutil.ValuesAtPath(data, "A.D.X || C"))
+ var testCases = []struct {
+ expect []interface{}
+ data interface{}
+ path string
+ }{
+ {[]interface{}{"initial"}, data, "C"},
+ {[]interface{}{"value1"}, data, "A[0].C"},
+ {[]interface{}{"value2"}, data, "A[1].C"},
+ {[]interface{}{"value3"}, data, "A[2].C"},
+ {[]interface{}{"value3"}, data, "a[2].c"},
+ {[]interface{}{"value3"}, data, "A[-1].C"},
+ {[]interface{}{"value1", "value2", "value3"}, data, "A[].C"},
+ {[]interface{}{"terminal"}, data, "B . B . C"},
+ {[]interface{}{"initial"}, data, "A.D.X || C"},
+ {[]interface{}{"initial"}, data, "A[0].B || C"},
+ {[]interface{}{
+ Struct{A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}},
+ Struct{A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}},
+ }, data2, "A"},
+ }
+ for i, c := range testCases {
+ v, err := awsutil.ValuesAtPath(c.data, c.path)
+ assert.NoError(t, err, "case %d, expected no error, %s", i, c.path)
+ assert.Equal(t, c.expect, v, "case %d, %s", i, c.path)
+ }
}
func TestValueAtPathFailure(t *testing.T) {
- assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, "C.x"))
- assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, ".x"))
- assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "X.Y.Z"))
- assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "A[100].C"))
- assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "A[3].C"))
- assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "B.B.C.Z"))
- assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, "z[-1].C"))
- assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(nil, "A.B.C"))
- assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(Struct{}, "A"))
+ var testCases = []struct {
+ expect []interface{}
+ errContains string
+ data interface{}
+ path string
+ }{
+ {nil, "", data, "C.x"},
+ {nil, "SyntaxError: Invalid token: tDot", data, ".x"},
+ {nil, "", data, "X.Y.Z"},
+ {nil, "", data, "A[100].C"},
+ {nil, "", data, "A[3].C"},
+ {nil, "", data, "B.B.C.Z"},
+ {nil, "", data, "z[-1].C"},
+ {nil, "", nil, "A.B.C"},
+ {[]interface{}{}, "", Struct{}, "A"},
+ {nil, "", data, "A[0].B.C"},
+ {nil, "", data, "D"},
+ }
+
+ for i, c := range testCases {
+ v, err := awsutil.ValuesAtPath(c.data, c.path)
+ if c.errContains != "" {
+ assert.Contains(t, err.Error(), c.errContains, "case %d, expected error, %s", i, c.path)
+ continue
+ } else {
+ assert.NoError(t, err, "case %d, expected no error, %s", i, c.path)
+ }
+ assert.Equal(t, c.expect, v, "case %d, %s", i, c.path)
+ }
}
func TestSetValueAtPathSuccess(t *testing.T) {
@@ -61,8 +101,8 @@ func TestSetValueAtPathSuccess(t *testing.T) {
assert.Equal(t, "test0", s.B.D.C)
var s2 Struct
- awsutil.SetValueAtAnyPath(&s2, "b.b.c", "test0")
+ awsutil.SetValueAtPath(&s2, "b.b.c", "test0")
assert.Equal(t, "test0", s2.B.B.C)
- awsutil.SetValueAtAnyPath(&s2, "A", []Struct{{}})
+ awsutil.SetValueAtPath(&s2, "A", []Struct{{}})
assert.Equal(t, []Struct{{}}, s2.A)
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
new file mode 100644
index 00000000000..b6432f1a118
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
@@ -0,0 +1,89 @@
+package awsutil
+
+import (
+ "bytes"
+ "fmt"
+ "reflect"
+ "strings"
+)
+
+// StringValue returns the string representation of a value.
+func StringValue(i interface{}) string {
+ var buf bytes.Buffer
+ stringValue(reflect.ValueOf(i), 0, &buf)
+ return buf.String()
+}
+
+func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) {
+ for v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ }
+
+ switch v.Kind() {
+ case reflect.Struct:
+ buf.WriteString("{\n")
+
+ names := []string{}
+ for i := 0; i < v.Type().NumField(); i++ {
+ name := v.Type().Field(i).Name
+ f := v.Field(i)
+ if name[0:1] == strings.ToLower(name[0:1]) {
+ continue // ignore unexported fields
+ }
+ if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() {
+ continue // ignore unset fields
+ }
+ names = append(names, name)
+ }
+
+ for i, n := range names {
+ val := v.FieldByName(n)
+ buf.WriteString(strings.Repeat(" ", indent+2))
+ buf.WriteString(n + ": ")
+ stringValue(val, indent+2, buf)
+
+ if i < len(names)-1 {
+ buf.WriteString(",\n")
+ }
+ }
+
+ buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
+ case reflect.Slice:
+ nl, id, id2 := "", "", ""
+ if v.Len() > 3 {
+ nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2)
+ }
+ buf.WriteString("[" + nl)
+ for i := 0; i < v.Len(); i++ {
+ buf.WriteString(id2)
+ stringValue(v.Index(i), indent+2, buf)
+
+ if i < v.Len()-1 {
+ buf.WriteString("," + nl)
+ }
+ }
+
+ buf.WriteString(nl + id + "]")
+ case reflect.Map:
+ buf.WriteString("{\n")
+
+ for i, k := range v.MapKeys() {
+ buf.WriteString(strings.Repeat(" ", indent+2))
+ buf.WriteString(k.String() + ": ")
+ stringValue(v.MapIndex(k), indent+2, buf)
+
+ if i < v.Len()-1 {
+ buf.WriteString(",\n")
+ }
+ }
+
+ buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
+ default:
+ format := "%v"
+ switch v.Interface().(type) {
+ case string:
+ format = "%q"
+ }
+ fmt.Fprintf(buf, format, v.Interface())
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go
new file mode 100644
index 00000000000..63ab805b9c4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go
@@ -0,0 +1,111 @@
+package client
+
+import (
+ "fmt"
+ "io/ioutil"
+ "net/http/httputil"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
+ "github.com/aws/aws-sdk-go/aws/request"
+)
+
+// A Config provides configuration to a service client instance.
+type Config struct {
+ Config *aws.Config
+ Handlers request.Handlers
+ Endpoint, SigningRegion string
+}
+
+// ConfigProvider provides a generic way for a service client to receive
+// the ClientConfig without circular dependencies.
+type ConfigProvider interface {
+ ClientConfig(serviceName string, cfgs ...*aws.Config) Config
+}
+
+// A Client implements the base client request and response handling
+// used by all service clients.
+type Client struct {
+ request.Retryer
+ metadata.ClientInfo
+
+ Config aws.Config
+ Handlers request.Handlers
+}
+
+// New will return a pointer to a new initialized service client.
+func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client {
+ svc := &Client{
+ Config: cfg,
+ ClientInfo: info,
+ Handlers: handlers,
+ }
+
+ maxRetries := aws.IntValue(cfg.MaxRetries)
+ if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {
+ maxRetries = 3
+ }
+ svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries}
+
+ svc.AddDebugHandlers()
+
+ for _, option := range options {
+ option(svc)
+ }
+
+ return svc
+}
+
+// NewRequest returns a new Request pointer for the service API
+// operation and parameters.
+func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request {
+ return request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data)
+}
+
+// AddDebugHandlers injects debug logging handlers into the service to log request
+// debug information.
+func (c *Client) AddDebugHandlers() {
+ if !c.Config.LogLevel.AtLeast(aws.LogDebug) {
+ return
+ }
+
+ c.Handlers.Send.PushFront(logRequest)
+ c.Handlers.Send.PushBack(logResponse)
+}
+
+const logReqMsg = `DEBUG: Request %s/%s Details:
+---[ REQUEST POST-SIGN ]-----------------------------
+%s
+-----------------------------------------------------`
+
+func logRequest(r *request.Request) {
+ logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
+ dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody)
+
+ if logBody {
+ // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's
+ // Body as a NoOpCloser and will not be reset after read by the HTTP
+ // client reader.
+ r.Body.Seek(r.BodyStart, 0)
+ r.HTTPRequest.Body = ioutil.NopCloser(r.Body)
+ }
+
+ r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody)))
+}
+
+const logRespMsg = `DEBUG: Response %s/%s Details:
+---[ RESPONSE ]--------------------------------------
+%s
+-----------------------------------------------------`
+
+func logResponse(r *request.Request) {
+ var msg = "no reponse data"
+ if r.HTTPResponse != nil {
+ logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
+ dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody)
+ msg = string(dumpedBody)
+ } else if r.Error != nil {
+ msg = r.Error.Error()
+ }
+ r.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ClientInfo.ServiceName, r.Operation.Name, msg))
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/default_retryer.go
similarity index 83%
rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go
rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/default_retryer.go
index c3dd0fa35a1..24d39ce5641 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/default_retryer.go
@@ -1,11 +1,10 @@
-package service
+package client
import (
"math"
"math/rand"
"time"
- "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
@@ -22,16 +21,13 @@ import (
// // This implementation always has 100 max retries
// func (d retryer) MaxRetries() uint { return 100 }
type DefaultRetryer struct {
- *Service
+ NumMaxRetries int
}
// MaxRetries returns the number of maximum returns the service will use to make
// an individual API request.
-func (d DefaultRetryer) MaxRetries() uint {
- if aws.IntValue(d.Service.Config.MaxRetries) < 0 {
- return d.DefaultMaxRetries
- }
- return uint(aws.IntValue(d.Service.Config.MaxRetries))
+func (d DefaultRetryer) MaxRetries() int {
+ return d.NumMaxRetries
}
// RetryRules returns the delay duration before retrying this request again
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
new file mode 100644
index 00000000000..4778056ddfd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
@@ -0,0 +1,12 @@
+package metadata
+
+// ClientInfo wraps immutable data from the client.Client structure.
+type ClientInfo struct {
+ ServiceName string
+ APIVersion string
+ Endpoint string
+ SigningName string
+ SigningRegion string
+ JSONVersion string
+ TargetPrefix string
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go
index cd2aade289f..f157f8b3b5a 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go
@@ -7,15 +7,17 @@ import (
"github.com/aws/aws-sdk-go/aws/credentials"
)
-// DefaultRetries is the default number of retries for a service. The value of
-// -1 indicates that the service specific retry default will be used.
-const DefaultRetries = -1
+// UseServiceDefaultRetries instructs the config to use the service's own default
+// number of retries. This will be the default action if Config.MaxRetries
+// is nil also.
+const UseServiceDefaultRetries = -1
// A Config provides service configuration for service clients. By default,
// all clients will use the {defaults.DefaultConfig} structure.
type Config struct {
// The credentials object to use when signing requests. Defaults to
- // {defaults.DefaultChainCredentials}.
+ // a chain of credential providers to search for credentials in environment
+ // variables, shared credential file, and EC2 Instance Roles.
Credentials *credentials.Credentials
// An optional endpoint URL (hostname only or fully qualified URI)
@@ -171,15 +173,17 @@ func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
return c
}
-// Merge returns a new Config with the other Config's attribute values merged into
-// this Config. If the other Config's attribute is nil it will not be merged into
-// the new Config to be returned.
-func (c Config) Merge(other *Config) *Config {
- if other == nil {
- return &c
+// MergeIn merges the passed in configs into the existing config object.
+func (c *Config) MergeIn(cfgs ...*Config) {
+ for _, other := range cfgs {
+ mergeInConfig(c, other)
}
+}
- dst := c
+func mergeInConfig(dst *Config, other *Config) {
+ if other == nil {
+ return
+ }
if other.Credentials != nil {
dst.Credentials = other.Credentials
@@ -228,12 +232,17 @@ func (c Config) Merge(other *Config) *Config {
if other.SleepDelay != nil {
dst.SleepDelay = other.SleepDelay
}
-
- return &dst
}
-// Copy will return a shallow copy of the Config object.
-func (c Config) Copy() *Config {
- dst := c
- return &dst
+// Copy will return a shallow copy of the Config object. If any additional
+// configurations are provided they will be merged into the new config returned.
+func (c *Config) Copy(cfgs ...*Config) *Config {
+ dst := &Config{}
+ dst.MergeIn(c)
+
+ for _, cfg := range cfgs {
+ dst.MergeIn(cfg)
+ }
+
+ return dst
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go
index c4320ca1ede..fe97a31fc76 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go
@@ -18,7 +18,7 @@ var copyTestConfig = Config{
HTTPClient: http.DefaultClient,
LogLevel: LogLevel(LogDebug),
Logger: NewDefaultLogger(),
- MaxRetries: Int(DefaultRetries),
+ MaxRetries: Int(3),
DisableParamValidation: Bool(true),
DisableComputeChecksums: Bool(true),
S3ForcePathStyle: Bool(true),
@@ -31,6 +31,11 @@ func TestCopy(t *testing.T) {
t.Errorf("Copy() = %+v", got)
t.Errorf(" want %+v", want)
}
+
+ got.Region = String("other")
+ if got.Region == want.Region {
+ t.Errorf("Expect setting copy values not not reflect in source")
+ }
}
func TestCopyReturnsNewInstance(t *testing.T) {
@@ -69,7 +74,8 @@ var mergeTests = []struct {
func TestMerge(t *testing.T) {
for i, tt := range mergeTests {
- got := tt.cfg.Merge(tt.in)
+ got := tt.cfg.Copy()
+ got.MergeIn(tt.in)
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Config %d %+v", i, tt.cfg)
t.Errorf(" Merge(%+v)", tt.in)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
index 597feb4fa44..1d3e656fd68 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
@@ -8,6 +8,7 @@ import (
"net/http"
"net/url"
"regexp"
+ "runtime"
"strconv"
"github.com/aws/aws-sdk-go/aws"
@@ -23,7 +24,7 @@ type lener interface {
// BuildContentLengthHandler builds the content length of a request based on the body,
// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable
// to determine request body length and no "Content-Length" was specified it will panic.
-var BuildContentLengthHandler = request.NamedHandler{"core.BuildContentLengthHandler", func(r *request.Request) {
+var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) {
if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
length, _ := strconv.ParseInt(slength, 10, 64)
r.HTTPRequest.ContentLength = length
@@ -49,17 +50,19 @@ var BuildContentLengthHandler = request.NamedHandler{"core.BuildContentLengthHan
r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length))
}}
-// UserAgentHandler is a request handler for injecting User agent into requests.
-var UserAgentHandler = request.NamedHandler{"core.UserAgentHandler", func(r *request.Request) {
- r.HTTPRequest.Header.Set("User-Agent", aws.SDKName+"/"+aws.SDKVersion)
-}}
+// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent.
+var SDKVersionUserAgentHandler = request.NamedHandler{
+ Name: "core.SDKVersionUserAgentHandler",
+ Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion,
+ runtime.Version(), runtime.GOOS, runtime.GOARCH),
+}
var reStatusCode = regexp.MustCompile(`^(\d{3})`)
// SendHandler is a request handler to send service request using HTTP client.
-var SendHandler = request.NamedHandler{"core.SendHandler", func(r *request.Request) {
+var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *request.Request) {
var err error
- r.HTTPResponse, err = r.Service.Config.HTTPClient.Do(r.HTTPRequest)
+ r.HTTPResponse, err = r.Config.HTTPClient.Do(r.HTTPRequest)
if err != nil {
// Capture the case where url.Error is returned for error processing
// response. e.g. 301 without location header comes back as string
@@ -92,7 +95,7 @@ var SendHandler = request.NamedHandler{"core.SendHandler", func(r *request.Reque
}}
// ValidateResponseHandler is a request handler to validate service response.
-var ValidateResponseHandler = request.NamedHandler{"core.ValidateResponseHandler", func(r *request.Request) {
+var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) {
if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 {
// this may be replaced by an UnmarshalError handler
r.Error = awserr.New("UnknownError", "unknown error", nil)
@@ -101,7 +104,7 @@ var ValidateResponseHandler = request.NamedHandler{"core.ValidateResponseHandler
// AfterRetryHandler performs final checks to determine if the request should
// be retried and how long to delay.
-var AfterRetryHandler = request.NamedHandler{"core.AfterRetryHandler", func(r *request.Request) {
+var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) {
// If one of the other handlers already set the retry state
// we don't want to override it based on the service's state
if r.Retryable == nil {
@@ -110,13 +113,13 @@ var AfterRetryHandler = request.NamedHandler{"core.AfterRetryHandler", func(r *r
if r.WillRetry() {
r.RetryDelay = r.RetryRules(r)
- r.Service.Config.SleepDelay(r.RetryDelay)
+ r.Config.SleepDelay(r.RetryDelay)
// when the expired token exception occurs the credentials
// need to be expired locally so that the next request to
// get credentials will trigger a credentials refresh.
if r.IsErrorExpired() {
- r.Service.Config.Credentials.Expire()
+ r.Config.Credentials.Expire()
}
r.RetryCount++
@@ -127,10 +130,10 @@ var AfterRetryHandler = request.NamedHandler{"core.AfterRetryHandler", func(r *r
// ValidateEndpointHandler is a request handler to validate a request had the
// appropriate Region and Endpoint set. Will set r.Error if the endpoint or
// region is not valid.
-var ValidateEndpointHandler = request.NamedHandler{"core.ValidateEndpointHandler", func(r *request.Request) {
- if r.Service.SigningRegion == "" && aws.StringValue(r.Service.Config.Region) == "" {
+var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) {
+ if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" {
r.Error = aws.ErrMissingRegion
- } else if r.Service.Endpoint == "" {
+ } else if r.ClientInfo.Endpoint == "" {
r.Error = aws.ErrMissingEndpoint
}
}}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go
index 214adcab088..632ea8d4ea1 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go
@@ -13,12 +13,13 @@ import (
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
+ "github.com/aws/aws-sdk-go/awstesting"
)
func TestValidateEndpointHandler(t *testing.T) {
os.Clearenv()
- svc := service.New(aws.NewConfig().WithRegion("us-west-2"))
+
+ svc := awstesting.NewClient(aws.NewConfig().WithRegion("us-west-2"))
svc.Handlers.Clear()
svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
@@ -30,7 +31,8 @@ func TestValidateEndpointHandler(t *testing.T) {
func TestValidateEndpointHandlerErrorRegion(t *testing.T) {
os.Clearenv()
- svc := service.New(nil)
+
+ svc := awstesting.NewClient()
svc.Handlers.Clear()
svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
@@ -58,7 +60,11 @@ func (m *mockCredsProvider) IsExpired() bool {
func TestAfterRetryRefreshCreds(t *testing.T) {
os.Clearenv()
credProvider := &mockCredsProvider{}
- svc := service.New(&aws.Config{Credentials: credentials.NewCredentials(credProvider), MaxRetries: aws.Int(1)})
+
+ svc := awstesting.NewClient(&aws.Config{
+ Credentials: credentials.NewCredentials(credProvider),
+ MaxRetries: aws.Int(1),
+ })
svc.Handlers.Clear()
svc.Handlers.ValidateResponse.PushBack(func(r *request.Request) {
@@ -91,7 +97,7 @@ func (t *testSendHandlerTransport) RoundTrip(r *http.Request) (*http.Response, e
}
func TestSendHandlerError(t *testing.T) {
- svc := service.New(&aws.Config{
+ svc := awstesting.NewClient(&aws.Config{
HTTPClient: &http.Client{
Transport: &testSendHandlerTransport{},
},
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go
index c70d422dfb0..3b53f5e026a 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go
@@ -12,7 +12,7 @@ import (
// ValidateParametersHandler is a request handler to validate the input parameters.
// Validating parameters only has meaning if done prior to the request being sent.
-var ValidateParametersHandler = request.NamedHandler{"core.ValidateParametersHandler", func(r *request.Request) {
+var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) {
if r.ParamsFilled() {
v := validator{errors: []string{}}
v.validateAny(reflect.ValueOf(r.Params), "")
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go
index db483ba408b..96bfc0e6720 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go
@@ -7,17 +7,17 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
"github.com/stretchr/testify/require"
)
-var testSvc = func() *service.Service {
- s := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: &aws.Config{},
+var testSvc = func() *client.Client {
+ s := &client.Client{
+ Config: aws.Config{},
+ ClientInfo: metadata.ClientInfo{
ServiceName: "mock-service",
APIVersion: "2015-01-01",
},
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
index 946a117206e..80702c26f9c 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
)
@@ -25,9 +26,6 @@ import (
// Client: &http.Client{
// Timeout: 10 * time.Second,
// },
-// // Use default EC2 Role metadata endpoint, Alternate endpoints can be
-// // specified setting Endpoint to something else.
-// Endpoint: "",
// // Do not use early expiry of credentials. If a non zero value is
// // specified the credentials will be expired early
// ExpiryWindow: 0,
@@ -35,8 +33,8 @@ import (
type EC2RoleProvider struct {
credentials.Expiry
- // EC2Metadata client to use when connecting to EC2 metadata service
- Client *ec2metadata.Client
+ // Required EC2Metadata client to use when connecting to EC2 metadata service.
+ Client *ec2metadata.EC2Metadata
// ExpiryWindow will allow the credentials to trigger refreshing prior to
// the credentials actually expiring. This is beneficial so race conditions
@@ -50,33 +48,40 @@ type EC2RoleProvider struct {
ExpiryWindow time.Duration
}
-// NewCredentials returns a pointer to a new Credentials object
-// wrapping the EC2RoleProvider.
-//
-// Takes a custom http.Client which can be configured for custom handling of
-// things such as timeout.
-//
-// Endpoint is the URL that the EC2RoleProvider will connect to when retrieving
-// role and credentials.
-//
-// Window is the expiry window that will be subtracted from the expiry returned
-// by the role credential request. This is done so that the credentials will
-// expire sooner than their actual lifespan.
-func NewCredentials(client *ec2metadata.Client, window time.Duration) *credentials.Credentials {
- return credentials.NewCredentials(&EC2RoleProvider{
- Client: client,
- ExpiryWindow: window,
- })
+// NewCredentials returns a pointer to a new Credentials object wrapping
+// the EC2RoleProvider. Takes a ConfigProvider to create a EC2Metadata client.
+// The ConfigProvider is satisfied by the session.Session type.
+func NewCredentials(c client.ConfigProvider, options ...func(*EC2RoleProvider)) *credentials.Credentials {
+ p := &EC2RoleProvider{
+ Client: ec2metadata.New(c),
+ }
+
+ for _, option := range options {
+ option(p)
+ }
+
+ return credentials.NewCredentials(p)
+}
+
+// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping
+// the EC2RoleProvider. Takes a EC2Metadata client to use when connecting to EC2
+// metadata service.
+func NewCredentialsWithClient(client *ec2metadata.EC2Metadata, options ...func(*EC2RoleProvider)) *credentials.Credentials {
+ p := &EC2RoleProvider{
+ Client: client,
+ }
+
+ for _, option := range options {
+ option(p)
+ }
+
+ return credentials.NewCredentials(p)
}
// Retrieve retrieves credentials from the EC2 service.
// Error will be returned if the request fails, or unable to extract
// the desired credentials.
func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) {
- if m.Client == nil {
- m.Client = ec2metadata.New(nil)
- }
-
credsList, err := requestCredList(m.Client)
if err != nil {
return credentials.Value{}, err
@@ -101,7 +106,7 @@ func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) {
}, nil
}
-// A ec2RoleCredRespBody provides the shape for deserializing credential
+// A ec2RoleCredRespBody provides the shape for unmarshalling credential
// request responses.
type ec2RoleCredRespBody struct {
// Success State
@@ -119,7 +124,7 @@ const iamSecurityCredsPath = "/iam/security-credentials"
// requestCredList requests a list of credentials from the EC2 service.
// If there are no credentials, or there is an error making or receiving the request
-func requestCredList(client *ec2metadata.Client) ([]string, error) {
+func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
resp, err := client.GetMetadata(iamSecurityCredsPath)
if err != nil {
return nil, awserr.New("EC2RoleRequestError", "failed to list EC2 Roles", err)
@@ -142,7 +147,7 @@ func requestCredList(client *ec2metadata.Client) ([]string, error) {
//
// If the credentials cannot be found, or there is an error reading the response
// and error will be returned.
-func requestCred(client *ec2metadata.Client, credsName string) (ec2RoleCredRespBody, error) {
+func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {
resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName))
if err != nil {
return ec2RoleCredRespBody{},
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go
index cd0cbc97e06..da3d8ed3ec1 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go
@@ -13,6 +13,7 @@ import (
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
+ "github.com/aws/aws-sdk-go/aws/session"
)
const credsRespTmpl = `{
@@ -54,11 +55,11 @@ func TestEC2RoleProvider(t *testing.T) {
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
- Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}),
+ Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
creds, err := p.Retrieve()
- assert.Nil(t, err, "Expect no error")
+ assert.Nil(t, err, "Expect no error, %v", err)
assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
@@ -70,7 +71,7 @@ func TestEC2RoleProviderFailAssume(t *testing.T) {
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
- Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}),
+ Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
creds, err := p.Retrieve()
@@ -91,7 +92,7 @@ func TestEC2RoleProviderIsExpired(t *testing.T) {
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
- Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}),
+ Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
p.CurrentTime = func() time.Time {
return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC)
@@ -100,7 +101,7 @@ func TestEC2RoleProviderIsExpired(t *testing.T) {
assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.")
_, err := p.Retrieve()
- assert.Nil(t, err, "Expect no error")
+ assert.Nil(t, err, "Expect no error, %v", err)
assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.")
@@ -116,7 +117,7 @@ func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) {
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
- Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}),
+ Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
ExpiryWindow: time.Hour * 1,
}
p.CurrentTime = func() time.Time {
@@ -126,7 +127,7 @@ func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) {
assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.")
_, err := p.Retrieve()
- assert.Nil(t, err, "Expect no error")
+ assert.Nil(t, err, "Expect no error, %v", err)
assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.")
@@ -137,12 +138,12 @@ func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) {
assert.True(t, p.IsExpired(), "Expect creds to be expired.")
}
-func BenchmarkEC2RoleProvider(b *testing.B) {
+func BenchmarkEC3RoleProvider(b *testing.B) {
server := initTestServer("2014-12-16T01:51:37Z", false)
defer server.Close()
p := &ec2rolecreds.EC2RoleProvider{
- Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}),
+ Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}),
}
_, err := p.Retrieve()
if err != nil {
@@ -150,12 +151,9 @@ func BenchmarkEC2RoleProvider(b *testing.B) {
}
b.ResetTimer()
- b.RunParallel(func(pb *testing.PB) {
- for pb.Next() {
- _, err := p.Retrieve()
- if err != nil {
- b.Fatal(err)
- }
+ for i := 0; i < b.N; i++ {
+ if _, err := p.Retrieve(); err != nil {
+ b.Fatal(err)
}
- })
+ }
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini
index aa2dc506ad0..7fc91d9d204 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini
@@ -6,3 +6,7 @@ aws_session_token = token
[no_token]
aws_access_key_id = accessKey
aws_secret_access_key = secret
+
+[with_colon]
+aws_access_key_id: accessKey
+aws_secret_access_key: secret
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
index fac6d78c41e..09bd00a9506 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
@@ -5,7 +5,7 @@ import (
"os"
"path/filepath"
- "github.com/vaughan0/go-ini"
+ "github.com/go-ini/ini"
"github.com/aws/aws-sdk-go/aws/awserr"
)
@@ -76,32 +76,36 @@ func (p *SharedCredentialsProvider) IsExpired() bool {
// The credentials retrieved from the profile will be returned or error. Error will be
// returned if it fails to read from the file, or the data is invalid.
func loadProfile(filename, profile string) (Value, error) {
- config, err := ini.LoadFile(filename)
+ config, err := ini.Load(filename)
if err != nil {
return Value{}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err)
}
- iniProfile := config.Section(profile)
-
- id, ok := iniProfile["aws_access_key_id"]
- if !ok {
- return Value{}, awserr.New("SharedCredsAccessKey",
- fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename),
- nil)
+ iniProfile, err := config.GetSection(profile)
+ if err != nil {
+ return Value{}, awserr.New("SharedCredsLoad", "failed to get profile", err)
}
- secret, ok := iniProfile["aws_secret_access_key"]
- if !ok {
+ id, err := iniProfile.GetKey("aws_access_key_id")
+ if err != nil {
+ return Value{}, awserr.New("SharedCredsAccessKey",
+ fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename),
+ err)
+ }
+
+ secret, err := iniProfile.GetKey("aws_secret_access_key")
+ if err != nil {
return Value{}, awserr.New("SharedCredsSecret",
fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename),
nil)
}
- token := iniProfile["aws_session_token"]
+ // Default to empty string if not found
+ token := iniProfile.Key("aws_session_token")
return Value{
- AccessKeyID: id,
- SecretAccessKey: secret,
- SessionToken: token,
+ AccessKeyID: id.String(),
+ SecretAccessKey: secret.String(),
+ SessionToken: token.String(),
}, nil
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go
index 1d9983f2ce1..2e26da2634b 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go
@@ -69,6 +69,18 @@ func TestSharedCredentialsProviderWithoutTokenFromProfile(t *testing.T) {
assert.Empty(t, creds.SessionToken, "Expect no token")
}
+func TestSharedCredentialsProviderColonInCredFile(t *testing.T) {
+ os.Clearenv()
+
+ p := SharedCredentialsProvider{Filename: "example.ini", Profile: "with_colon"}
+ creds, err := p.Retrieve()
+ assert.Nil(t, err, "Expect no error")
+
+ assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match")
+ assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match")
+ assert.Empty(t, creds.SessionToken, "Expect no token")
+}
+
func BenchmarkSharedCredentialsProvider(b *testing.B) {
os.Clearenv()
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
index 7a4459f8046..0214860d4cc 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/sts"
)
@@ -18,31 +19,17 @@ type AssumeRoler interface {
AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
}
+// DefaultDuration is the default amount of time in minutes that the credentials
+// will be valid for.
+var DefaultDuration = time.Duration(15) * time.Minute
+
// AssumeRoleProvider retrieves temporary credentials from the STS service, and
// keeps track of their expiration time. This provider must be used explicitly,
// as it is not included in the credentials chain.
-//
-// Example how to configure a service to use this provider:
-//
-// config := &aws.Config{
-// Credentials: stscreds.NewCredentials(nil, "arn-of-the-role-to-assume", 10*time.Second),
-// })
-// // Use config for creating your AWS service.
-//
-// Example how to obtain customised credentials:
-//
-// provider := &stscreds.Provider{
-// // Extend the duration to 1 hour.
-// Duration: time.Hour,
-// // Custom role name.
-// RoleSessionName: "custom-session-name",
-// }
-// creds := credentials.NewCredentials(provider)
-//
type AssumeRoleProvider struct {
credentials.Expiry
- // Custom STS client. If not set the default STS client will be used.
+ // STS client to make assume role request with.
Client AssumeRoler
// Role to be assumed.
@@ -70,37 +57,55 @@ type AssumeRoleProvider struct {
}
// NewCredentials returns a pointer to a new Credentials object wrapping the
-// AssumeRoleProvider. The credentials will expire every 15 minutes and the
+// AssumeRoleProvider. The credentials will expire every 15 minutes and the
// role will be named after a nanosecond timestamp of this operation.
//
-// The sts and roleARN parameters are used for building the "AssumeRole" call.
-// Pass nil as sts to use the default client.
+// Takes a Config provider to create the STS client. The ConfigProvider is
+// satisfied by the session.Session type.
+func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
+ p := &AssumeRoleProvider{
+ Client: sts.New(c),
+ RoleARN: roleARN,
+ Duration: DefaultDuration,
+ }
+
+ for _, option := range options {
+ option(p)
+ }
+
+ return credentials.NewCredentials(p)
+}
+
+// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the
+// AssumeRoleProvider. The credentials will expire every 15 minutes and the
+// role will be named after a nanosecond timestamp of this operation.
//
-// Window is the expiry window that will be subtracted from the expiry returned
-// by the role credential request. This is done so that the credentials will
-// expire sooner than their actual lifespan.
-func NewCredentials(client AssumeRoler, roleARN string, window time.Duration) *credentials.Credentials {
- return credentials.NewCredentials(&AssumeRoleProvider{
- Client: client,
- RoleARN: roleARN,
- ExpiryWindow: window,
- })
+// Takes an AssumeRoler which can be satisfiede by the STS client.
+func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
+ p := &AssumeRoleProvider{
+ Client: svc,
+ RoleARN: roleARN,
+ Duration: DefaultDuration,
+ }
+
+ for _, option := range options {
+ option(p)
+ }
+
+ return credentials.NewCredentials(p)
}
// Retrieve generates a new set of temporary credentials using STS.
func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
// Apply defaults where parameters are not set.
- if p.Client == nil {
- p.Client = sts.New(nil)
- }
if p.RoleSessionName == "" {
// Try to work out a role name that will hopefully end up unique.
p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano())
}
if p.Duration == 0 {
// Expire as often as AWS permits.
- p.Duration = 15 * time.Minute
+ p.Duration = DefaultDuration
}
roleOutput, err := p.Client.AssumeRole(&sts.AssumeRoleInput{
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go
index f5b97c0053b..6bd6e91973e 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go
@@ -48,12 +48,9 @@ func BenchmarkAssumeRoleProvider(b *testing.B) {
}
b.ResetTimer()
- b.RunParallel(func(pb *testing.PB) {
- for pb.Next() {
- _, err := p.Retrieve()
- if err != nil {
- b.Fatal(err)
- }
+ for i := 0; i < b.N; i++ {
+ if _, err := p.Retrieve(); err != nil {
+ b.Fatal(err)
}
- })
+ }
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
index 2f161b57f1d..b746783beca 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
@@ -1,3 +1,5 @@
+// Package defaults is a collection of helpers to retrieve the SDK's default
+// configuration and handlers.
package defaults
import (
@@ -6,34 +8,69 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
+ "github.com/aws/aws-sdk-go/aws/ec2metadata"
+ "github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/endpoints"
)
-// DefaultChainCredentials is a Credentials which will find the first available
-// credentials Value from the list of Providers.
-//
-// This should be used in the default case. Once the type of credentials are
-// known switching to the specific Credentials will be more efficient.
-var DefaultChainCredentials = credentials.NewChainCredentials(
- []credentials.Provider{
- &credentials.EnvProvider{},
- &credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
- &ec2rolecreds.EC2RoleProvider{ExpiryWindow: 5 * time.Minute},
- })
+// A Defaults provides a collection of default values for SDK clients.
+type Defaults struct {
+ Config *aws.Config
+ Handlers request.Handlers
+}
-// DefaultConfig is the default all service configuration will be based off of.
-// By default, all clients use this structure for initialization options unless
-// a custom configuration object is passed in.
-//
-// You may modify this global structure to change all default configuration
-// in the SDK. Note that configuration options are copied by value, so any
-// modifications must happen before constructing a client.
-var DefaultConfig = aws.NewConfig().
- WithCredentials(DefaultChainCredentials).
- WithRegion(os.Getenv("AWS_REGION")).
- WithHTTPClient(http.DefaultClient).
- WithMaxRetries(aws.DefaultRetries).
- WithLogger(aws.NewDefaultLogger()).
- WithLogLevel(aws.LogOff).
- WithSleepDelay(time.Sleep)
+// Get returns the SDK's default values with Config and handlers pre-configured.
+func Get() Defaults {
+ cfg := Config()
+ handlers := Handlers()
+ cfg.Credentials = CredChain(cfg, handlers)
+
+ return Defaults{
+ Config: cfg,
+ Handlers: handlers,
+ }
+}
+
+// Config returns the default configuration.
+func Config() *aws.Config {
+ return aws.NewConfig().
+ WithCredentials(credentials.AnonymousCredentials).
+ WithRegion(os.Getenv("AWS_REGION")).
+ WithHTTPClient(http.DefaultClient).
+ WithMaxRetries(aws.UseServiceDefaultRetries).
+ WithLogger(aws.NewDefaultLogger()).
+ WithLogLevel(aws.LogOff).
+ WithSleepDelay(time.Sleep)
+}
+
+// Handlers returns the default request handlers.
+func Handlers() request.Handlers {
+ var handlers request.Handlers
+
+ handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
+ handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
+ handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
+ handlers.Send.PushBackNamed(corehandlers.SendHandler)
+ handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)
+ handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)
+
+ return handlers
+}
+
+// CredChain returns the default credential chain.
+func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {
+ endpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName, *cfg.Region, true)
+
+ return credentials.NewChainCredentials(
+ []credentials.Provider{
+ &credentials.EnvProvider{},
+ &credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
+ &ec2rolecreds.EC2RoleProvider{
+ Client: ec2metadata.NewClient(*cfg, handlers, endpoint, signingRegion),
+ ExpiryWindow: 5 * time.Minute,
+ },
+ })
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
index 9d784b6e6ab..e5137ca17da 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
@@ -7,7 +7,7 @@ import (
)
// GetMetadata uses the path provided to request
-func (c *Client) GetMetadata(p string) (string, error) {
+func (c *EC2Metadata) GetMetadata(p string) (string, error) {
op := &request.Operation{
Name: "GetMetadata",
HTTPMethod: "GET",
@@ -15,13 +15,13 @@ func (c *Client) GetMetadata(p string) (string, error) {
}
output := &metadataOutput{}
- req := request.New(c.Service.ServiceInfo, c.Service.Handlers, c.Service.Retryer, op, nil, output)
+ req := c.NewRequest(op, nil, output)
return output.Content, req.Send()
}
// Region returns the region the instance is running in.
-func (c *Client) Region() (string, error) {
+func (c *EC2Metadata) Region() (string, error) {
resp, err := c.GetMetadata("placement/availability-zone")
if err != nil {
return "", err
@@ -34,7 +34,7 @@ func (c *Client) Region() (string, error) {
// Available returns if the application has access to the EC2 Metadata service.
// Can be used to determine if application is running within an EC2 Instance and
// the metadata service is available.
-func (c *Client) Available() bool {
+func (c *EC2Metadata) Available() bool {
if _, err := c.GetMetadata("instance-id"); err != nil {
return false
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go
index 61ab62a5305..c3c92972b7c 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go
@@ -14,6 +14,7 @@ import (
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/aws/session"
)
func initTestServer(path string, resp string) *httptest.Server {
@@ -28,15 +29,15 @@ func initTestServer(path string, resp string) *httptest.Server {
}
func TestEndpoint(t *testing.T) {
- c := ec2metadata.New(&ec2metadata.Config{})
+ c := ec2metadata.New(session.New())
op := &request.Operation{
Name: "GetMetadata",
HTTPMethod: "GET",
HTTPPath: path.Join("/", "meta-data", "testpath"),
}
- req := c.Service.NewRequest(op, nil, nil)
- assert.Equal(t, "http://169.254.169.254/latest", req.Service.Endpoint)
+ req := c.NewRequest(op, nil, nil)
+ assert.Equal(t, "http://169.254.169.254/latest", req.ClientInfo.Endpoint)
assert.Equal(t, "http://169.254.169.254/latest/meta-data/testpath", req.HTTPRequest.URL.String())
}
@@ -46,7 +47,7 @@ func TestGetMetadata(t *testing.T) {
"success", // real response includes suffix
)
defer server.Close()
- c := ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")})
+ c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")})
resp, err := c.GetMetadata("some/path")
@@ -60,7 +61,7 @@ func TestGetRegion(t *testing.T) {
"us-west-2a", // real response includes suffix
)
defer server.Close()
- c := ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")})
+ c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")})
region, err := c.Region()
@@ -74,7 +75,7 @@ func TestMetadataAvailable(t *testing.T) {
"instance-id",
)
defer server.Close()
- c := ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")})
+ c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")})
available := c.Available()
@@ -82,7 +83,7 @@ func TestMetadataAvailable(t *testing.T) {
}
func TestMetadataNotAvailable(t *testing.T) {
- c := ec2metadata.New(nil)
+ c := ec2metadata.New(session.New())
c.Handlers.Send.Clear()
c.Handlers.Send.PushBack(func(r *request.Request) {
r.HTTPResponse = &http.Response{
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
index 73a12c9129a..f0dc331e012 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
@@ -1,3 +1,5 @@
+// Package ec2metadata provides the client for making API calls to the
+// EC2 Metadata service.
package ec2metadata
import (
@@ -8,89 +10,41 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
- "github.com/aws/aws-sdk-go/aws/credentials"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
)
-// DefaultRetries states the default number of times the service client will
-// attempt to retry a failed request before failing.
-const DefaultRetries = 3
+// ServiceName is the name of the service.
+const ServiceName = "ec2metadata"
-// A Config provides the configuration for the EC2 Metadata service.
-type Config struct {
- // An optional endpoint URL (hostname only or fully qualified URI)
- // that overrides the default service endpoint for a client. Set this
- // to nil, or `""` to use the default service endpoint.
- Endpoint *string
-
- // The HTTP client to use when sending requests. Defaults to
- // `http.DefaultClient`.
- HTTPClient *http.Client
-
- // An integer value representing the logging level. The default log level
- // is zero (LogOff), which represents no logging. To enable logging set
- // to a LogLevel Value.
- Logger aws.Logger
-
- // The logger writer interface to write logging messages to. Defaults to
- // standard out.
- LogLevel *aws.LogLevelType
-
- // The maximum number of times that a request will be retried for failures.
- // Defaults to DefaultRetries for the number of retries to be performed
- // per request.
- MaxRetries *int
+// A EC2Metadata is an EC2 Metadata service Client.
+type EC2Metadata struct {
+ *client.Client
}
-// A Client is an EC2 Metadata service Client.
-type Client struct {
- *service.Service
-}
-
-// New creates a new instance of the EC2 Metadata service client.
+// New creates a new instance of the EC2Metadata client with a session.
+// This client is safe to use across multiple goroutines.
//
-// In the general use case the configuration for this service client should not
-// be needed and `nil` can be provided. Configuration is only needed if the
-// `ec2metadata.Config` defaults need to be overridden. Eg. Setting LogLevel.
+// Example:
+// // Create a EC2Metadata client from just a session.
+// svc := ec2metadata.New(mySession)
//
-// @note This configuration will NOT be merged with the default AWS service
-// client configuration `defaults.DefaultConfig`. Due to circular dependencies
-// with the defaults package and credentials EC2 Role Provider.
-func New(config *Config) *Client {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: copyConfig(config),
- ServiceName: "Client",
- Endpoint: "http://169.254.169.254/latest",
- APIVersion: "latest",
- },
- }
- service.Initialize()
- service.Handlers.Unmarshal.PushBack(unmarshalHandler)
- service.Handlers.UnmarshalError.PushBack(unmarshalError)
- service.Handlers.Validate.Clear()
- service.Handlers.Validate.PushBack(validateEndpointHandler)
-
- return &Client{service}
+// // Create a EC2Metadata client with additional configuration
+// svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody))
+func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata {
+ c := p.ClientConfig(ServiceName, cfgs...)
+ return NewClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
}
-func copyConfig(config *Config) *aws.Config {
- if config == nil {
- config = &Config{}
- }
- c := &aws.Config{
- Credentials: credentials.AnonymousCredentials,
- Endpoint: config.Endpoint,
- HTTPClient: config.HTTPClient,
- Logger: config.Logger,
- LogLevel: config.LogLevel,
- MaxRetries: config.MaxRetries,
- }
-
- if c.HTTPClient == nil {
- c.HTTPClient = &http.Client{
+// NewClient returns a new EC2Metadata client. Should be used to create
+// a client when not using a session. Generally using just New with a session
+// is preferred.
+func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata {
+ // If the default http client is provided, replace it with a custom
+ // client using default timeouts.
+ if cfg.HTTPClient == http.DefaultClient {
+ cfg.HTTPClient = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
@@ -104,17 +58,30 @@ func copyConfig(config *Config) *aws.Config {
},
}
}
- if c.Logger == nil {
- c.Logger = aws.NewDefaultLogger()
- }
- if c.LogLevel == nil {
- c.LogLevel = aws.LogLevel(aws.LogOff)
- }
- if c.MaxRetries == nil {
- c.MaxRetries = aws.Int(DefaultRetries)
+
+ svc := &EC2Metadata{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: ServiceName,
+ Endpoint: endpoint,
+ APIVersion: "latest",
+ },
+ handlers,
+ ),
}
- return c
+ svc.Handlers.Unmarshal.PushBack(unmarshalHandler)
+ svc.Handlers.UnmarshalError.PushBack(unmarshalError)
+ svc.Handlers.Validate.Clear()
+ svc.Handlers.Validate.PushBack(validateEndpointHandler)
+
+ // Add additional options to the service config
+ for _, option := range opts {
+ option(svc.Client)
+ }
+
+ return svc
}
type metadataOutput struct {
@@ -143,7 +110,7 @@ func unmarshalError(r *request.Request) {
}
func validateEndpointHandler(r *request.Request) {
- if r.Service.Endpoint == "" {
+ if r.ClientInfo.Endpoint == "" {
r.Error = aws.ErrMissingEndpoint
}
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go
index db2f481b01b..57663616868 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go
@@ -7,11 +7,11 @@ var (
// not found.
//
// @readonly
- ErrMissingRegion error = awserr.New("MissingRegion", "could not find region configuration", nil)
+ ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil)
// ErrMissingEndpoint is an error that is returned if an endpoint cannot be
// resolved for a service.
//
// @readonly
- ErrMissingEndpoint error = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil)
+ ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil)
)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go
index 85bc122e7b3..3e90a7976ae 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go
@@ -1,5 +1,10 @@
package request
+import (
+ "fmt"
+ "strings"
+)
+
// A Handlers provides a collection of request handlers for various
// stages of handling requests.
type Handlers struct {
@@ -110,3 +115,26 @@ func (l *HandlerList) Run(r *Request) {
f.Fn(r)
}
}
+
+// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request
+// header. If the extra parameters are provided they will be added as metadata to the
+// name/version pair resulting in the following format.
+// "name/version (extra0; extra1; ...)"
+// The user agent part will be concatenated with this current request's user agent string.
+func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) {
+ ua := fmt.Sprintf("%s/%s", name, version)
+ if len(extra) > 0 {
+ ua += fmt.Sprintf(" (%s)", strings.Join(extra, "; "))
+ }
+ return func(r *Request) {
+ AddToUserAgent(r, ua)
+ }
+}
+
+// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header.
+// The input string will be concatenated with the current request's user agent string.
+func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) {
+ return func(r *Request) {
+ AddToUserAgent(r, s)
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go
index 2ff05a8154e..16a1418283b 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go
@@ -35,8 +35,8 @@ func TestMultipleHandlers(t *testing.T) {
func TestNamedHandlers(t *testing.T) {
l := request.HandlerList{}
- named := request.NamedHandler{"Name", func(r *request.Request) {}}
- named2 := request.NamedHandler{"NotName", func(r *request.Request) {}}
+ named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) {}}
+ named2 := request.NamedHandler{Name: "NotName", Fn: func(r *request.Request) {}}
l.PushBackNamed(named)
l.PushBackNamed(named)
l.PushBackNamed(named2)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go
index 70c28b88316..3735d7fa533 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go
@@ -12,15 +12,16 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/awsutil"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
)
// A Request is the service request to be made.
type Request struct {
+ Config aws.Config
+ ClientInfo metadata.ClientInfo
+ Handlers Handlers
+
Retryer
- Service serviceinfo.ServiceInfo
- Handlers Handlers
Time time.Time
ExpireTime time.Duration
Operation *Operation
@@ -32,7 +33,7 @@ type Request struct {
Error error
Data interface{}
RequestID string
- RetryCount uint
+ RetryCount int
Retryable *bool
RetryDelay time.Duration
@@ -61,7 +62,9 @@ type Paginator struct {
// Params is any value of input parameters to be the request payload.
// Data is pointer value to an object which the request's response
// payload will be deserialized to.
-func New(service serviceinfo.ServiceInfo, handlers Handlers, retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request {
+func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
+ retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request {
+
method := operation.HTTPMethod
if method == "" {
method = "POST"
@@ -72,12 +75,14 @@ func New(service serviceinfo.ServiceInfo, handlers Handlers, retryer Retryer, op
}
httpReq, _ := http.NewRequest(method, "", nil)
- httpReq.URL, _ = url.Parse(service.Endpoint + p)
+ httpReq.URL, _ = url.Parse(clientInfo.Endpoint + p)
r := &Request{
+ Config: cfg,
+ ClientInfo: clientInfo,
+ Handlers: handlers.Copy(),
+
Retryer: retryer,
- Service: service,
- Handlers: handlers.Copy(),
Time: time.Now(),
ExpireTime: 0,
Operation: operation,
@@ -140,7 +145,7 @@ func (r *Request) Presign(expireTime time.Duration) (string, error) {
}
func debugLogReqError(r *Request, stage string, retrying bool, err error) {
- if !r.Service.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) {
+ if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) {
return
}
@@ -149,8 +154,8 @@ func debugLogReqError(r *Request, stage string, retrying bool, err error) {
retryStr = "will retry"
}
- r.Service.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v",
- stage, r.Service.ServiceName, r.Operation.Name, retryStr, err))
+ r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v",
+ stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err))
}
// Build will build the request's object so it can be signed and sent
@@ -205,9 +210,9 @@ func (r *Request) Send() error {
}
if aws.BoolValue(r.Retryable) {
- if r.Service.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
- r.Service.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
- r.Service.ServiceName, r.Operation.Name, r.RetryCount))
+ if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
+ r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
+ r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
}
// Re-seek the body back to the original point in for a retry so that
@@ -264,85 +269,11 @@ func (r *Request) Send() error {
return nil
}
-// HasNextPage returns true if this request has more pages of data available.
-func (r *Request) HasNextPage() bool {
- return r.nextPageTokens() != nil
-}
-
-// nextPageTokens returns the tokens to use when asking for the next page of
-// data.
-func (r *Request) nextPageTokens() []interface{} {
- if r.Operation.Paginator == nil {
- return nil
- }
-
- if r.Operation.TruncationToken != "" {
- tr := awsutil.ValuesAtAnyPath(r.Data, r.Operation.TruncationToken)
- if tr == nil || len(tr) == 0 {
- return nil
- }
- switch v := tr[0].(type) {
- case bool:
- if v == false {
- return nil
- }
- }
- }
-
- found := false
- tokens := make([]interface{}, len(r.Operation.OutputTokens))
-
- for i, outtok := range r.Operation.OutputTokens {
- v := awsutil.ValuesAtAnyPath(r.Data, outtok)
- if v != nil && len(v) > 0 {
- found = true
- tokens[i] = v[0]
- }
- }
-
- if found {
- return tokens
- }
- return nil
-}
-
-// NextPage returns a new Request that can be executed to return the next
-// page of result data. Call .Send() on this request to execute it.
-func (r *Request) NextPage() *Request {
- tokens := r.nextPageTokens()
- if tokens == nil {
- return nil
- }
-
- data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface()
- nr := New(r.Service, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data)
- for i, intok := range nr.Operation.InputTokens {
- awsutil.SetValueAtAnyPath(nr.Params, intok, tokens[i])
- }
- return nr
-}
-
-// EachPage iterates over each page of a paginated request object. The fn
-// parameter should be a function with the following sample signature:
-//
-// func(page *T, lastPage bool) bool {
-// return true // return false to stop iterating
-// }
-//
-// Where "T" is the structure type matching the output structure of the given
-// operation. For example, a request object generated by
-// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput
-// as the structure "T". The lastPage value represents whether the page is
-// the last page of data or not. The return value of this function should
-// return true to keep iterating or false to stop.
-func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {
- for page := r; page != nil; page = page.NextPage() {
- page.Send()
- shouldContinue := fn(page.Data, !page.HasNextPage())
- if page.Error != nil || !shouldContinue {
- return page.Error
- }
- }
-
- return nil
+// AddToUserAgent adds the string to the end of the request's current user agent.
+func AddToUserAgent(r *Request, s string) {
+ curUA := r.HTTPRequest.Header.Get("User-Agent")
+ if len(curUA) > 0 {
+ s = curUA + " " + s
+ }
+ r.HTTPRequest.Header.Set("User-Agent", s)
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
new file mode 100644
index 00000000000..b19fbd70b4a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
@@ -0,0 +1,96 @@
+package request
+
+import (
+ "reflect"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awsutil"
+)
+
+//type Paginater interface {
+// HasNextPage() bool
+// NextPage() *Request
+// EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error
+//}
+
+// HasNextPage returns true if this request has more pages of data available.
+func (r *Request) HasNextPage() bool {
+ return len(r.nextPageTokens()) > 0
+}
+
+// nextPageTokens returns the tokens to use when asking for the next page of
+// data.
+func (r *Request) nextPageTokens() []interface{} {
+ if r.Operation.Paginator == nil {
+ return nil
+ }
+
+ if r.Operation.TruncationToken != "" {
+ tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken)
+ if len(tr) == 0 {
+ return nil
+ }
+
+ switch v := tr[0].(type) {
+ case *bool:
+ if !aws.BoolValue(v) {
+ return nil
+ }
+ case bool:
+ if v == false {
+ return nil
+ }
+ }
+ }
+
+ tokens := []interface{}{}
+ for _, outToken := range r.Operation.OutputTokens {
+ v, _ := awsutil.ValuesAtPath(r.Data, outToken)
+ if len(v) > 0 {
+ tokens = append(tokens, v[0])
+ }
+ }
+
+ return tokens
+}
+
+// NextPage returns a new Request that can be executed to return the next
+// page of result data. Call .Send() on this request to execute it.
+func (r *Request) NextPage() *Request {
+ tokens := r.nextPageTokens()
+ if len(tokens) == 0 {
+ return nil
+ }
+
+ data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface()
+ nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data)
+ for i, intok := range nr.Operation.InputTokens {
+ awsutil.SetValueAtPath(nr.Params, intok, tokens[i])
+ }
+ return nr
+}
+
+// EachPage iterates over each page of a paginated request object. The fn
+// parameter should be a function with the following sample signature:
+//
+// func(page *T, lastPage bool) bool {
+// return true // return false to stop iterating
+// }
+//
+// Where "T" is the structure type matching the output structure of the given
+// operation. For example, a request object generated by
+// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput
+// as the structure "T". The lastPage value represents whether the page is
+// the last page of data or not. The return value of this function should
+// return true to keep iterating or false to stop.
+func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {
+ for page := r; page != nil; page = page.NextPage() {
+ page.Send()
+ shouldContinue := fn(page.Data, !page.HasNextPage())
+ if page.Error != nil || !shouldContinue {
+ return page.Error
+ }
+ }
+
+ return nil
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go
index 7869da89e3d..a9863eaf97f 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go
@@ -12,11 +12,97 @@ import (
"github.com/aws/aws-sdk-go/service/s3"
)
-var _ = unit.Imported
+// Use DynamoDB methods for simplicity
+func TestPaginationQueryPage(t *testing.T) {
+ db := dynamodb.New(unit.Session)
+ tokens, pages, numPages, gotToEnd := []map[string]*dynamodb.AttributeValue{}, []map[string]*dynamodb.AttributeValue{}, 0, false
+
+ reqNum := 0
+ resps := []*dynamodb.QueryOutput{
+ {
+ LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}},
+ Count: aws.Int64(1),
+ Items: []map[string]*dynamodb.AttributeValue{
+ map[string]*dynamodb.AttributeValue{
+ "key": {S: aws.String("key1")},
+ },
+ },
+ },
+ {
+ LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}},
+ Count: aws.Int64(1),
+ Items: []map[string]*dynamodb.AttributeValue{
+ map[string]*dynamodb.AttributeValue{
+ "key": {S: aws.String("key2")},
+ },
+ },
+ },
+ {
+ LastEvaluatedKey: map[string]*dynamodb.AttributeValue{},
+ Count: aws.Int64(1),
+ Items: []map[string]*dynamodb.AttributeValue{
+ map[string]*dynamodb.AttributeValue{
+ "key": {S: aws.String("key3")},
+ },
+ },
+ },
+ }
+
+ db.Handlers.Send.Clear() // mock sending
+ db.Handlers.Unmarshal.Clear()
+ db.Handlers.UnmarshalMeta.Clear()
+ db.Handlers.ValidateResponse.Clear()
+ db.Handlers.Build.PushBack(func(r *request.Request) {
+ in := r.Params.(*dynamodb.QueryInput)
+ if in == nil {
+ tokens = append(tokens, nil)
+ } else if len(in.ExclusiveStartKey) != 0 {
+ tokens = append(tokens, in.ExclusiveStartKey)
+ }
+ })
+ db.Handlers.Unmarshal.PushBack(func(r *request.Request) {
+ r.Data = resps[reqNum]
+ reqNum++
+ })
+
+ params := &dynamodb.QueryInput{
+ Limit: aws.Int64(2),
+ TableName: aws.String("tablename"),
+ }
+ err := db.QueryPages(params, func(p *dynamodb.QueryOutput, last bool) bool {
+ numPages++
+ for _, item := range p.Items {
+ pages = append(pages, item)
+ }
+ if last {
+ if gotToEnd {
+ assert.Fail(t, "last=true happened twice")
+ }
+ gotToEnd = true
+ }
+ return true
+ })
+ assert.Nil(t, err)
+
+ assert.Equal(t,
+ []map[string]*dynamodb.AttributeValue{
+ map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}},
+ map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}},
+ }, tokens)
+ assert.Equal(t,
+ []map[string]*dynamodb.AttributeValue{
+ map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}},
+ map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}},
+ map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key3")}},
+ }, pages)
+ assert.Equal(t, 3, numPages)
+ assert.True(t, gotToEnd)
+ assert.Nil(t, params.ExclusiveStartKey)
+}
// Use DynamoDB methods for simplicity
func TestPagination(t *testing.T) {
- db := dynamodb.New(nil)
+ db := dynamodb.New(unit.Session)
tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false
reqNum := 0
@@ -68,7 +154,7 @@ func TestPagination(t *testing.T) {
// Use DynamoDB methods for simplicity
func TestPaginationEachPage(t *testing.T) {
- db := dynamodb.New(nil)
+ db := dynamodb.New(unit.Session)
tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false
reqNum := 0
@@ -121,7 +207,7 @@ func TestPaginationEachPage(t *testing.T) {
// Use DynamoDB methods for simplicity
func TestPaginationEarlyExit(t *testing.T) {
- db := dynamodb.New(nil)
+ db := dynamodb.New(unit.Session)
numPages, gotToEnd := 0, false
reqNum := 0
@@ -161,7 +247,7 @@ func TestPaginationEarlyExit(t *testing.T) {
}
func TestSkipPagination(t *testing.T) {
- client := s3.New(nil)
+ client := s3.New(unit.Session)
client.Handlers.Send.Clear() // mock sending
client.Handlers.Unmarshal.Clear()
client.Handlers.UnmarshalMeta.Clear()
@@ -186,10 +272,9 @@ func TestSkipPagination(t *testing.T) {
// Use S3 for simplicity
func TestPaginationTruncation(t *testing.T) {
- count := 0
- client := s3.New(nil)
+ client := s3.New(unit.Session)
- reqNum := &count
+ reqNum := 0
resps := []*s3.ListObjectsOutput{
{IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key1")}}},
{IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key2")}}},
@@ -202,8 +287,8 @@ func TestPaginationTruncation(t *testing.T) {
client.Handlers.UnmarshalMeta.Clear()
client.Handlers.ValidateResponse.Clear()
client.Handlers.Unmarshal.PushBack(func(r *request.Request) {
- r.Data = resps[*reqNum]
- *reqNum++
+ r.Data = resps[reqNum]
+ reqNum++
})
params := &s3.ListObjectsInput{Bucket: aws.String("bucket")}
@@ -218,7 +303,7 @@ func TestPaginationTruncation(t *testing.T) {
assert.Nil(t, err)
// Try again without truncation token at all
- count = 0
+ reqNum = 0
resps[1].IsTruncated = nil
resps[2].IsTruncated = aws.Bool(true)
results = []string{}
@@ -251,7 +336,7 @@ var benchResps = []*dynamodb.ListTablesOutput{
}
var benchDb = func() *dynamodb.DynamoDB {
- db := dynamodb.New(nil)
+ db := dynamodb.New(unit.Session)
db.Handlers.Send.Clear() // mock sending
db.Handlers.Unmarshal.Clear()
db.Handlers.UnmarshalMeta.Clear()
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go
index 6cea0bd2fff..4828dff7fda 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go
@@ -7,15 +7,17 @@ import (
"io"
"io/ioutil"
"net/http"
+ "runtime"
"testing"
"time"
+ "github.com/stretchr/testify/assert"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/stretchr/testify/assert"
+ "github.com/aws/aws-sdk-go/awstesting"
)
type testData struct {
@@ -74,7 +76,7 @@ func TestRequestRecoverRetry5xx(t *testing.T) {
{StatusCode: 200, Body: body(`{"data":"valid"}`)},
}
- s := service.New(aws.NewConfig().WithMaxRetries(10))
+ s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
@@ -100,7 +102,7 @@ func TestRequestRecoverRetry4xxRetryable(t *testing.T) {
{StatusCode: 200, Body: body(`{"data":"valid"}`)},
}
- s := service.New(aws.NewConfig().WithMaxRetries(10))
+ s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
@@ -119,7 +121,7 @@ func TestRequestRecoverRetry4xxRetryable(t *testing.T) {
// test that retries don't occur for 4xx status codes with a response type that can't be retried
func TestRequest4xxUnretryable(t *testing.T) {
- s := service.New(aws.NewConfig().WithMaxRetries(10))
+ s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
@@ -155,7 +157,7 @@ func TestRequestExhaustRetries(t *testing.T) {
{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)},
}
- s := service.New(aws.NewConfig().WithMaxRetries(aws.DefaultRetries).WithSleepDelay(sleepDelay))
+ s := awstesting.NewClient(aws.NewConfig().WithSleepDelay(sleepDelay))
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
@@ -193,7 +195,7 @@ func TestRequestRecoverExpiredCreds(t *testing.T) {
{StatusCode: 200, Body: body(`{"data":"valid"}`)},
}
- s := service.New(&aws.Config{MaxRetries: aws.Int(10), Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")})
+ s := awstesting.NewClient(&aws.Config{MaxRetries: aws.Int(10), Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")})
s.Handlers.Validate.Clear()
s.Handlers.Unmarshal.PushBack(unmarshal)
s.Handlers.UnmarshalError.PushBack(unmarshalError)
@@ -202,12 +204,12 @@ func TestRequestRecoverExpiredCreds(t *testing.T) {
credExpiredAfterRetry := false
s.Handlers.AfterRetry.PushBack(func(r *request.Request) {
- credExpiredAfterRetry = r.Service.Config.Credentials.IsExpired()
+ credExpiredAfterRetry = r.Config.Credentials.IsExpired()
})
s.Handlers.Sign.Clear()
s.Handlers.Sign.PushBack(func(r *request.Request) {
- r.Service.Config.Credentials.Get()
+ r.Config.Credentials.Get()
})
s.Handlers.Send.Clear() // mock sending
s.Handlers.Send.PushBack(func(r *request.Request) {
@@ -226,3 +228,34 @@ func TestRequestRecoverExpiredCreds(t *testing.T) {
assert.Equal(t, 1, int(r.RetryCount))
assert.Equal(t, "valid", out.Data)
}
+
+func TestMakeAddtoUserAgentHandler(t *testing.T) {
+ fn := request.MakeAddToUserAgentHandler("name", "version", "extra1", "extra2")
+ r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}}
+ r.HTTPRequest.Header.Set("User-Agent", "foo/bar")
+ fn(r)
+
+ assert.Equal(t, "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent"))
+}
+
+func TestMakeAddtoUserAgentFreeFormHandler(t *testing.T) {
+ fn := request.MakeAddToUserAgentFreeFormHandler("name/version (extra1; extra2)")
+ r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}}
+ r.HTTPRequest.Header.Set("User-Agent", "foo/bar")
+ fn(r)
+
+ assert.Equal(t, "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent"))
+}
+
+func TestRequestUserAgent(t *testing.T) {
+ s := awstesting.NewClient(&aws.Config{Region: aws.String("us-east-1")})
+ // s.Handlers.Validate.Clear()
+
+ req := s.NewRequest(&request.Operation{Name: "Operation"}, nil, &testData{})
+ req.HTTPRequest.Header.Set("User-Agent", "foo/bar")
+ assert.NoError(t, req.Build())
+
+ expectUA := fmt.Sprintf("foo/bar %s/%s (%s; %s; %s)",
+ aws.SDKName, aws.SDKVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH)
+ assert.Equal(t, expectUA, req.HTTPRequest.Header.Get("User-Agent"))
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go
index 52667510257..b06143b8358 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go
@@ -12,13 +12,14 @@ import (
type Retryer interface {
RetryRules(*Request) time.Duration
ShouldRetry(*Request) bool
- MaxRetries() uint
+ MaxRetries() int
}
// retryableCodes is a collection of service response codes which are retry-able
// without any further action.
var retryableCodes = map[string]struct{}{
"RequestError": {},
+ "RequestTimeout": {},
"ProvisionedThroughputExceededException": {},
"Throttling": {},
"ThrottlingException": {},
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/service.go
deleted file mode 100644
index 38aa5d51484..00000000000
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/service.go
+++ /dev/null
@@ -1,133 +0,0 @@
-package service
-
-import (
- "fmt"
- "io/ioutil"
- "net/http"
- "net/http/httputil"
- "regexp"
- "time"
-
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/corehandlers"
- "github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
- "github.com/aws/aws-sdk-go/private/endpoints"
-)
-
-// A Service implements the base service request and response handling
-// used by all services.
-type Service struct {
- serviceinfo.ServiceInfo
- request.Retryer
- DefaultMaxRetries uint
- Handlers request.Handlers
-}
-
-var schemeRE = regexp.MustCompile("^([^:]+)://")
-
-// New will return a pointer to a new Server object initialized.
-func New(config *aws.Config) *Service {
- svc := &Service{ServiceInfo: serviceinfo.ServiceInfo{Config: config}}
- svc.Initialize()
- return svc
-}
-
-// Initialize initializes the service.
-func (s *Service) Initialize() {
- if s.Config == nil {
- s.Config = &aws.Config{}
- }
- if s.Config.HTTPClient == nil {
- s.Config.HTTPClient = http.DefaultClient
- }
- if s.Config.SleepDelay == nil {
- s.Config.SleepDelay = time.Sleep
- }
-
- s.Retryer = DefaultRetryer{s}
- s.DefaultMaxRetries = 3
- s.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
- s.Handlers.Build.PushBackNamed(corehandlers.UserAgentHandler)
- s.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
- s.Handlers.Send.PushBackNamed(corehandlers.SendHandler)
- s.Handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)
- s.Handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)
- if !aws.BoolValue(s.Config.DisableParamValidation) {
- s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)
- }
- s.AddDebugHandlers()
- s.buildEndpoint()
-}
-
-// NewRequest returns a new Request pointer for the service API
-// operation and parameters.
-func (s *Service) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request {
- return request.New(s.ServiceInfo, s.Handlers, s.Retryer, operation, params, data)
-}
-
-// buildEndpoint builds the endpoint values the service will use to make requests with.
-func (s *Service) buildEndpoint() {
- if aws.StringValue(s.Config.Endpoint) != "" {
- s.Endpoint = *s.Config.Endpoint
- } else if s.Endpoint == "" {
- s.Endpoint, s.SigningRegion =
- endpoints.EndpointForRegion(s.ServiceName, aws.StringValue(s.Config.Region))
- }
-
- if s.Endpoint != "" && !schemeRE.MatchString(s.Endpoint) {
- scheme := "https"
- if aws.BoolValue(s.Config.DisableSSL) {
- scheme = "http"
- }
- s.Endpoint = scheme + "://" + s.Endpoint
- }
-}
-
-// AddDebugHandlers injects debug logging handlers into the service to log request
-// debug information.
-func (s *Service) AddDebugHandlers() {
- if !s.Config.LogLevel.AtLeast(aws.LogDebug) {
- return
- }
-
- s.Handlers.Send.PushFront(logRequest)
- s.Handlers.Send.PushBack(logResponse)
-}
-
-const logReqMsg = `DEBUG: Request %s/%s Details:
----[ REQUEST POST-SIGN ]-----------------------------
-%s
------------------------------------------------------`
-
-func logRequest(r *request.Request) {
- logBody := r.Service.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
- dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody)
-
- if logBody {
- // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's
- // Body as a NoOpCloser and will not be reset after read by the HTTP
- // client reader.
- r.Body.Seek(r.BodyStart, 0)
- r.HTTPRequest.Body = ioutil.NopCloser(r.Body)
- }
-
- r.Service.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.Service.ServiceName, r.Operation.Name, string(dumpedBody)))
-}
-
-const logRespMsg = `DEBUG: Response %s/%s Details:
----[ RESPONSE ]--------------------------------------
-%s
------------------------------------------------------`
-
-func logResponse(r *request.Request) {
- var msg = "no reponse data"
- if r.HTTPResponse != nil {
- logBody := r.Service.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
- dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody)
- msg = string(dumpedBody)
- } else if r.Error != nil {
- msg = r.Error.Error()
- }
- r.Service.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.Service.ServiceName, r.Operation.Name, msg))
-}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/serviceinfo/service_info.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/serviceinfo/service_info.go
deleted file mode 100644
index a920e96a967..00000000000
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/serviceinfo/service_info.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package serviceinfo
-
-import "github.com/aws/aws-sdk-go/aws"
-
-// ServiceInfo wraps immutable data from the service.Service structure.
-type ServiceInfo struct {
- Config *aws.Config
- ServiceName string
- APIVersion string
- Endpoint string
- SigningName string
- SigningRegion string
- JSONVersion string
- TargetPrefix string
-}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session.go
new file mode 100644
index 00000000000..eb7fc2052f1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session.go
@@ -0,0 +1,105 @@
+// Package session provides a way to create service clients with shared configuration
+// and handlers.
+package session
+
+import (
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/corehandlers"
+ "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/endpoints"
+)
+
+// A Session provides a central location to create service clients from and
+// store configurations and request handlers for those services.
+//
+// Sessions are safe to create service clients concurrently, but it is not safe
+// to mutate the session concurrently.
+type Session struct {
+ Config *aws.Config
+ Handlers request.Handlers
+}
+
+// New creates a new instance of the handlers merging in the provided Configs
+// on top of the SDK's default configurations. Once the session is created it
+// can be mutated to modify Configs or Handlers. The session is safe to be read
+// concurrently, but it should not be written to concurrently.
+//
+// Example:
+// // Create a session with the default config and request handlers.
+// sess := session.New()
+//
+// // Create a session with a custom region
+// sess := session.New(&aws.Config{Region: aws.String("us-east-1")})
+//
+// // Create a session, and add additional handlers for all service
+// // clients created with the session to inherit. Adds logging handler.
+// sess := session.New()
+// sess.Handlers.Send.PushFront(func(r *request.Request) {
+// // Log every request made and its payload
+// logger.Println("Request: %s/%s, Payload: %s", r.ClientInfo.ServiceName, r.Operation, r.Params)
+// })
+//
+// // Create a S3 client instance from a session
+// sess := session.New()
+// svc := s3.New(sess)
+func New(cfgs ...*aws.Config) *Session {
+ def := defaults.Get()
+ s := &Session{
+ Config: def.Config,
+ Handlers: def.Handlers,
+ }
+ s.Config.MergeIn(cfgs...)
+
+ initHandlers(s)
+
+ return s
+}
+
+func initHandlers(s *Session) {
+ // Add the Validate parameter handler if it is not disabled.
+ s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)
+ if !aws.BoolValue(s.Config.DisableParamValidation) {
+ s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)
+ }
+}
+
+// Copy creates and returns a copy of the current session, coping the config
+// and handlers. If any additional configs are provided they will be merged
+// on top of the session's copied config.
+//
+// Example:
+// // Create a copy of the current session, configured for the us-west-2 region.
+// sess.Copy(&aws.Config{Region: aws.String("us-west-2"})
+func (s *Session) Copy(cfgs ...*aws.Config) *Session {
+ newSession := &Session{
+ Config: s.Config.Copy(cfgs...),
+ Handlers: s.Handlers.Copy(),
+ }
+
+ initHandlers(newSession)
+
+ return newSession
+}
+
+// ClientConfig satisfies the client.ConfigProvider interface and is used to
+// configure the service client instances. Passing the Session to the service
+// client's constructor (New) will use this method to configure the client.
+//
+// Example:
+// sess := session.New()
+// s3.New(sess)
+func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {
+ s = s.Copy(cfgs...)
+ endpoint, signingRegion := endpoints.NormalizeEndpoint(
+ aws.StringValue(s.Config.Endpoint), serviceName,
+ aws.StringValue(s.Config.Region), aws.BoolValue(s.Config.DisableSSL))
+
+ return client.Config{
+ Config: s.Config,
+ Handlers: s.Handlers,
+ Endpoint: endpoint,
+ SigningRegion: signingRegion,
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session_test.go
new file mode 100644
index 00000000000..e56c02fc661
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session_test.go
@@ -0,0 +1,20 @@
+package session_test
+
+import (
+ "net/http"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/session"
+)
+
+func TestNewDefaultSession(t *testing.T) {
+ s := session.New(&aws.Config{Region: aws.String("region")})
+
+ assert.Equal(t, "region", *s.Config.Region)
+ assert.Equal(t, http.DefaultClient, s.Config.HTTPClient)
+ assert.NotNil(t, s.Config.Logger)
+ assert.Equal(t, aws.LogOff, *s.Config.LogLevel)
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go
index 846b732dda1..0f067c57f4e 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go
@@ -5,7 +5,7 @@ import (
"sync"
)
-// ReadSeekCloser wraps a io.Reader returning a ReaderSeakerCloser
+// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser
func ReadSeekCloser(r io.Reader) ReaderSeekerCloser {
return ReaderSeekerCloser{r}
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go
index b7de9e35190..f4741adfb44 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "0.9.16"
+const SDKVersion = "0.10.4"
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
index d040cccd57d..2b279e65999 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
@@ -4,11 +4,27 @@ package endpoints
//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go
//go:generate gofmt -s -w endpoints_map.go
-import "strings"
+import (
+ "fmt"
+ "regexp"
+ "strings"
+)
+
+// NormalizeEndpoint takes and endpoint and service API information to return a
+// normalized endpoint and signing region. If the endpoint is not an empty string
+// the service name and region will be used to look up the service's API endpoint.
+// If the endpoint is provided the scheme will be added if it is not present.
+func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL bool) (normEndpoint, signingRegion string) {
+ if endpoint == "" {
+ return EndpointForRegion(serviceName, region, disableSSL)
+ }
+
+ return AddScheme(endpoint, disableSSL), ""
+}
// EndpointForRegion returns an endpoint and its signing region for a service and region.
// if the service and region pair are not found endpoint and signingRegion will be empty.
-func EndpointForRegion(svcName, region string) (endpoint, signingRegion string) {
+func EndpointForRegion(svcName, region string, disableSSL bool) (endpoint, signingRegion string) {
derivedKeys := []string{
region + "/" + svcName,
region + "/*",
@@ -24,8 +40,26 @@ func EndpointForRegion(svcName, region string) (endpoint, signingRegion string)
endpoint = ep
signingRegion = val.SigningRegion
- return
+ break
}
}
- return
+
+ return AddScheme(endpoint, disableSSL), signingRegion
+}
+
+// Regular expression to determine if the endpoint string is prefixed with a scheme.
+var schemeRE = regexp.MustCompile("^([^:]+)://")
+
+// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no
+// scheme. If disableSSL is true HTTP will be added instead of the default HTTPS.
+func AddScheme(endpoint string, disableSSL bool) string {
+ if endpoint != "" && !schemeRE.MatchString(endpoint) {
+ scheme := "https"
+ if disableSSL {
+ scheme = "http"
+ }
+ endpoint = fmt.Sprintf("%s://%s", scheme, endpoint)
+ }
+
+ return endpoint
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
index 62b8231d48b..ea819b1ec35 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
@@ -29,6 +29,10 @@
"endpoint": "",
"signingRegion": "us-east-1"
},
+ "*/ec2metadata": {
+ "endpoint": "http://169.254.169.254/latest",
+ "signingRegion": "us-east-1"
+ },
"*/iam": {
"endpoint": "iam.amazonaws.com",
"signingRegion": "us-east-1"
@@ -45,6 +49,10 @@
"endpoint": "sts.amazonaws.com",
"signingRegion": "us-east-1"
},
+ "*/waf": {
+ "endpoint": "waf.amazonaws.com",
+ "signingRegion": "us-east-1"
+ },
"us-east-1/sdb": {
"endpoint": "sdb.amazonaws.com",
"signingRegion": "us-east-1"
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
index 62fdc16bdd7..3fab91c7f19 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
@@ -30,6 +30,10 @@ var endpointsMap = endpointStruct{
Endpoint: "",
SigningRegion: "us-east-1",
},
+ "*/ec2metadata": {
+ Endpoint: "http://169.254.169.254/latest",
+ SigningRegion: "us-east-1",
+ },
"*/iam": {
Endpoint: "iam.amazonaws.com",
SigningRegion: "us-east-1",
@@ -46,6 +50,10 @@ var endpointsMap = endpointStruct{
Endpoint: "sts.amazonaws.com",
SigningRegion: "us-east-1",
},
+ "*/waf": {
+ Endpoint: "waf.amazonaws.com",
+ SigningRegion: "us-east-1",
+ },
"ap-northeast-1/s3": {
Endpoint: "s3-{region}.amazonaws.com",
},
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go
index 8af65879d40..2add48890b3 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go
@@ -1,28 +1,41 @@
-package endpoints
+package endpoints_test
import (
+ "fmt"
"testing"
"github.com/stretchr/testify/assert"
+
+ "github.com/aws/aws-sdk-go/private/endpoints"
)
+func TestGenericEndpoint(t *testing.T) {
+ name := "service"
+ region := "mock-region-1"
+
+ ep, sr := endpoints.EndpointForRegion(name, region, false)
+ assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com", name, region), ep)
+ assert.Empty(t, sr)
+}
+
func TestGlobalEndpoints(t *testing.T) {
region := "mock-region-1"
- svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts"}
+ svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "waf"}
for _, name := range svcs {
- ep, sr := EndpointForRegion(name, region)
- assert.Equal(t, name+".amazonaws.com", ep)
+ ep, sr := endpoints.EndpointForRegion(name, region, false)
+ assert.Equal(t, fmt.Sprintf("https://%s.amazonaws.com", name), ep)
assert.Equal(t, "us-east-1", sr)
}
}
func TestServicesInCN(t *testing.T) {
region := "cn-north-1"
- svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3"}
+ svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3", "waf"}
for _, name := range svcs {
- ep, _ := EndpointForRegion(name, region)
- assert.Equal(t, name+"."+region+".amazonaws.com.cn", ep)
+ ep, sr := endpoints.EndpointForRegion(name, region, false)
+ assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com.cn", name, region), ep)
+ assert.Empty(t, sr)
}
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
index 8e646140b30..0ead0126ee8 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
@@ -15,7 +15,7 @@ import (
func Build(r *request.Request) {
body := url.Values{
"Action": {r.Operation.Name},
- "Version": {r.Service.APIVersion},
+ "Version": {r.ClientInfo.APIVersion},
}
if err := queryutil.Parse(body, r.Params, true); err != nil {
r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go
index 6e563722edc..e135b93601d 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go
@@ -7,7 +7,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
+ "github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/service/ec2"
)
@@ -67,7 +67,7 @@ func BenchmarkEC2QueryBuild_Simple_ec2AttachNetworkInterface(b *testing.B) {
}
func benchEC2QueryBuild(b *testing.B, opName string, params interface{}) {
- svc := service.New(nil)
+ svc := awstesting.NewClient()
svc.ServiceName = "ec2"
svc.APIVersion = "2015-04-15"
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go
index a3846344d6b..887feeb1ea8 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go
@@ -12,10 +12,10 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
+ "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
@@ -35,30 +35,52 @@ var _ = ioutil.Discard
var _ = util.Trim("")
var _ = url.Values{}
var _ = io.EOF
+var _ = aws.String
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService1ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService1ProtocolTest client.
-func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice1protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService1ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService1ProtocolTest client from just a session.
+// svc := inputservice1protocoltest.New(mySession)
+//
+// // Create a InputService1ProtocolTest client with additional configuration
+// svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest {
+ c := p.ClientConfig("inputservice1protocoltest", cfgs...)
+ return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService1ProtocolTest {
+ svc := &InputService1ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice1protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService1ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService1ProtocolTest operation and runs any
@@ -113,29 +135,50 @@ type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService2ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService2ProtocolTest client.
-func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice2protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService2ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService2ProtocolTest client from just a session.
+// svc := inputservice2protocoltest.New(mySession)
+//
+// // Create a InputService2ProtocolTest client with additional configuration
+// svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest {
+ c := p.ClientConfig("inputservice2protocoltest", cfgs...)
+ return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService2ProtocolTest {
+ svc := &InputService2ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice2protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService2ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService2ProtocolTest operation and runs any
@@ -192,29 +235,50 @@ type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService3ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService3ProtocolTest client.
-func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice3protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService3ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService3ProtocolTest client from just a session.
+// svc := inputservice3protocoltest.New(mySession)
+//
+// // Create a InputService3ProtocolTest client with additional configuration
+// svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest {
+ c := p.ClientConfig("inputservice3protocoltest", cfgs...)
+ return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService3ProtocolTest {
+ svc := &InputService3ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice3protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService3ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService3ProtocolTest operation and runs any
@@ -277,29 +341,50 @@ type metadataInputService3TestShapeStructType struct {
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService4ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService4ProtocolTest client.
-func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice4protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService4ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService4ProtocolTest client from just a session.
+// svc := inputservice4protocoltest.New(mySession)
+//
+// // Create a InputService4ProtocolTest client with additional configuration
+// svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest {
+ c := p.ClientConfig("inputservice4protocoltest", cfgs...)
+ return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService4ProtocolTest {
+ svc := &InputService4ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice4protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService4ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService4ProtocolTest operation and runs any
@@ -352,29 +437,50 @@ type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService5ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService5ProtocolTest client.
-func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice5protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService5ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService5ProtocolTest client from just a session.
+// svc := inputservice5protocoltest.New(mySession)
+//
+// // Create a InputService5ProtocolTest client with additional configuration
+// svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest {
+ c := p.ClientConfig("inputservice5protocoltest", cfgs...)
+ return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService5ProtocolTest {
+ svc := &InputService5ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice5protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService5ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService5ProtocolTest operation and runs any
@@ -427,29 +533,50 @@ type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService6ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService6ProtocolTest client.
-func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice6protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService6ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService6ProtocolTest client from just a session.
+// svc := inputservice6protocoltest.New(mySession)
+//
+// // Create a InputService6ProtocolTest client with additional configuration
+// svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest {
+ c := p.ClientConfig("inputservice6protocoltest", cfgs...)
+ return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService6ProtocolTest {
+ svc := &InputService6ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice6protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService6ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService6ProtocolTest operation and runs any
@@ -502,29 +629,50 @@ type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService7ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService7ProtocolTest client.
-func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice7protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService7ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService7ProtocolTest client from just a session.
+// svc := inputservice7protocoltest.New(mySession)
+//
+// // Create a InputService7ProtocolTest client with additional configuration
+// svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest {
+ c := p.ClientConfig("inputservice7protocoltest", cfgs...)
+ return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService7ProtocolTest {
+ svc := &InputService7ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice7protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService7ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService7ProtocolTest operation and runs any
@@ -577,29 +725,50 @@ type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService8ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService8ProtocolTest client.
-func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice8protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService8ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService8ProtocolTest client from just a session.
+// svc := inputservice8protocoltest.New(mySession)
+//
+// // Create a InputService8ProtocolTest client with additional configuration
+// svc := inputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService8ProtocolTest {
+ c := p.ClientConfig("inputservice8protocoltest", cfgs...)
+ return newInputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService8ProtocolTest {
+ svc := &InputService8ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice8protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &InputService8ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService8ProtocolTest operation and runs any
@@ -657,8 +826,8 @@ type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct
//
func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
- svc := NewInputService1ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService1TestShapeInputService1TestCaseOperation1Input{
Bar: aws.String("val2"),
@@ -684,8 +853,8 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
}
func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedToMembersCase1(t *testing.T) {
- svc := NewInputService2ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService2TestShapeInputService2TestCaseOperation1Input{
Bar: aws.String("val2"),
@@ -712,8 +881,8 @@ func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedTo
}
func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) {
- svc := NewInputService3ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService3TestShapeInputService3TestCaseOperation1Input{
StructArg: &InputService3TestShapeStructType{
@@ -740,8 +909,8 @@ func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) {
}
func TestInputService4ProtocolTestListTypesCase1(t *testing.T) {
- svc := NewInputService4ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService4TestShapeInputService4TestCaseOperation1Input{
ListArg: []*string{
@@ -770,8 +939,8 @@ func TestInputService4ProtocolTestListTypesCase1(t *testing.T) {
}
func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *testing.T) {
- svc := NewInputService5ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService5TestShapeInputService5TestCaseOperation1Input{
ListArg: []*string{
@@ -800,8 +969,8 @@ func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *te
}
func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testing.T) {
- svc := NewInputService6ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService6TestShapeInputService6TestCaseOperation1Input{
ListArg: []*string{
@@ -830,8 +999,8 @@ func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testi
}
func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
- svc := NewInputService7ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService7TestShapeInputService7TestCaseOperation1Input{
BlobArg: []byte("foo"),
@@ -856,8 +1025,8 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
}
func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) {
- svc := NewInputService8ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService8TestShapeInputService8TestCaseOperation1Input{
TimeArg: aws.Time(time.Unix(1422172800, 0)),
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go
index b9ee3dc7667..c347c371c10 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go
@@ -12,10 +12,10 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
+ "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
@@ -35,30 +35,52 @@ var _ = ioutil.Discard
var _ = util.Trim("")
var _ = url.Values{}
var _ = io.EOF
+var _ = aws.String
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService1ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService1ProtocolTest client.
-func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice1protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService1ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService1ProtocolTest client from just a session.
+// svc := outputservice1protocoltest.New(mySession)
+//
+// // Create a OutputService1ProtocolTest client with additional configuration
+// svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest {
+ c := p.ClientConfig("outputservice1protocoltest", cfgs...)
+ return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService1ProtocolTest {
+ svc := &OutputService1ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice1protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService1ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any
@@ -125,29 +147,50 @@ type metadataOutputService1TestShapeOutputService1TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService2ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService2ProtocolTest client.
-func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice2protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService2ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService2ProtocolTest client from just a session.
+// svc := outputservice2protocoltest.New(mySession)
+//
+// // Create a OutputService2ProtocolTest client with additional configuration
+// svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest {
+ c := p.ClientConfig("outputservice2protocoltest", cfgs...)
+ return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService2ProtocolTest {
+ svc := &OutputService2ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice2protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService2ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any
@@ -200,29 +243,50 @@ type metadataOutputService2TestShapeOutputService2TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService3ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService3ProtocolTest client.
-func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice3protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService3ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService3ProtocolTest client from just a session.
+// svc := outputservice3protocoltest.New(mySession)
+//
+// // Create a OutputService3ProtocolTest client with additional configuration
+// svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest {
+ c := p.ClientConfig("outputservice3protocoltest", cfgs...)
+ return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService3ProtocolTest {
+ svc := &OutputService3ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice3protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService3ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any
@@ -275,29 +339,50 @@ type metadataOutputService3TestShapeOutputService3TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService4ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService4ProtocolTest client.
-func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice4protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService4ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService4ProtocolTest client from just a session.
+// svc := outputservice4protocoltest.New(mySession)
+//
+// // Create a OutputService4ProtocolTest client with additional configuration
+// svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest {
+ c := p.ClientConfig("outputservice4protocoltest", cfgs...)
+ return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService4ProtocolTest {
+ svc := &OutputService4ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice4protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService4ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any
@@ -350,29 +435,50 @@ type metadataOutputService4TestShapeOutputService4TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService5ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService5ProtocolTest client.
-func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice5protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService5ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService5ProtocolTest client from just a session.
+// svc := outputservice5protocoltest.New(mySession)
+//
+// // Create a OutputService5ProtocolTest client with additional configuration
+// svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest {
+ c := p.ClientConfig("outputservice5protocoltest", cfgs...)
+ return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService5ProtocolTest {
+ svc := &OutputService5ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice5protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService5ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any
@@ -425,29 +531,50 @@ type metadataOutputService5TestShapeOutputService5TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService6ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService6ProtocolTest client.
-func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice6protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService6ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService6ProtocolTest client from just a session.
+// svc := outputservice6protocoltest.New(mySession)
+//
+// // Create a OutputService6ProtocolTest client with additional configuration
+// svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest {
+ c := p.ClientConfig("outputservice6protocoltest", cfgs...)
+ return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService6ProtocolTest {
+ svc := &OutputService6ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice6protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService6ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any
@@ -510,29 +637,50 @@ type metadataOutputService6TestShapeStructureType struct {
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService7ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService7ProtocolTest client.
-func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice7protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService7ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService7ProtocolTest client from just a session.
+// svc := outputservice7protocoltest.New(mySession)
+//
+// // Create a OutputService7ProtocolTest client with additional configuration
+// svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest {
+ c := p.ClientConfig("outputservice7protocoltest", cfgs...)
+ return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService7ProtocolTest {
+ svc := &OutputService7ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice7protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService7ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any
@@ -585,29 +733,50 @@ type metadataOutputService7TestShapeOutputService7TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService8ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService8ProtocolTest client.
-func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice8protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService8ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService8ProtocolTest client from just a session.
+// svc := outputservice8protocoltest.New(mySession)
+//
+// // Create a OutputService8ProtocolTest client with additional configuration
+// svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest {
+ c := p.ClientConfig("outputservice8protocoltest", cfgs...)
+ return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService8ProtocolTest {
+ svc := &OutputService8ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice8protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- return &OutputService8ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any
@@ -660,12 +829,109 @@ type metadataOutputService8TestShapeOutputService8TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type OutputService9ProtocolTest struct {
+ *client.Client
+}
+
+// New creates a new instance of the OutputService9ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService9ProtocolTest client from just a session.
+// svc := outputservice9protocoltest.New(mySession)
+//
+// // Create a OutputService9ProtocolTest client with additional configuration
+// svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest {
+ c := p.ClientConfig("outputservice9protocoltest", cfgs...)
+ return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService9ProtocolTest {
+ svc := &OutputService9ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice9protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
+ }
+
+ // Handlers
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+
+ return svc
+}
+
+// newRequest creates a new request for a OutputService9ProtocolTest operation and runs any
+// custom request initialization.
+func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
+ req := c.NewRequest(op, params, data)
+
+ return req
+}
+
+const opOutputService9TestCaseOperation1 = "OperationName"
+
+// OutputService9TestCaseOperation1Request generates a request for the OutputService9TestCaseOperation1 operation.
+func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) {
+ op := &request.Operation{
+ Name: opOutputService9TestCaseOperation1,
+ }
+
+ if input == nil {
+ input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{}
+ req.Data = output
+ return
+}
+
+func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) {
+ req, out := c.OutputService9TestCaseOperation1Request(input)
+ err := req.Send()
+ return out, err
+}
+
+type OutputService9TestShapeOutputService9TestCaseOperation1Input struct {
+ metadataOutputService9TestShapeOutputService9TestCaseOperation1Input `json:"-" xml:"-"`
+}
+
+type metadataOutputService9TestShapeOutputService9TestCaseOperation1Input struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type OutputService9TestShapeOutputService9TestCaseOperation1Output struct {
+ Foo *string `type:"string"`
+
+ metadataOutputService9TestShapeOutputService9TestCaseOperation1Output `json:"-" xml:"-"`
+}
+
+type metadataOutputService9TestShapeOutputService9TestCaseOperation1Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
//
// Tests begin here
//
func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
- svc := NewOutputService1ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200arequest-id"))
req, out := svc.OutputService1TestCaseOperation1Request(nil)
@@ -692,7 +958,8 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
}
func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
- svc := NewOutputService2ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("dmFsdWU=requestid"))
req, out := svc.OutputService2TestCaseOperation1Request(nil)
@@ -712,7 +979,8 @@ func TestOutputService2ProtocolTestBlobCase1(t *testing.T) {
}
func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
- svc := NewOutputService3ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("abc123requestid"))
req, out := svc.OutputService3TestCaseOperation1Request(nil)
@@ -733,7 +1001,8 @@ func TestOutputService3ProtocolTestListsCase1(t *testing.T) {
}
func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
- svc := NewOutputService4ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("- abc
- 123
requestid"))
req, out := svc.OutputService4TestCaseOperation1Request(nil)
@@ -754,7 +1023,8 @@ func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
}
func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
- svc := NewOutputService5ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("abc123requestid"))
req, out := svc.OutputService5TestCaseOperation1Request(nil)
@@ -775,7 +1045,8 @@ func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) {
}
func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
- svc := NewOutputService6ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("requestid"))
req, out := svc.OutputService6TestCaseOperation1Request(nil)
@@ -796,7 +1067,8 @@ func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) {
}
func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
- svc := NewOutputService7ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("requestid"))
req, out := svc.OutputService7TestCaseOperation1Request(nil)
@@ -817,7 +1089,8 @@ func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) {
}
func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
- svc := NewOutputService8ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("requestid"))
req, out := svc.OutputService8TestCaseOperation1Request(nil)
@@ -836,3 +1109,24 @@ func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) {
assert.Equal(t, "bar", *out.Map["qux"])
}
+
+func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ buf := bytes.NewReader([]byte("requestid"))
+ req, out := svc.OutputService9TestCaseOperation1Request(nil)
+ req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
+
+ // set headers
+
+ // unmarshal response
+ ec2query.UnmarshalMeta(req)
+ ec2query.Unmarshal(req)
+ assert.NoError(t, req.Error)
+
+ // assert response
+ assert.NotNil(t, out) // ensure out variable is used
+ assert.Equal(t, "", *out.Foo)
+
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go
index b6b0b54d25d..2d78c35c241 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go
@@ -15,7 +15,7 @@ import (
func Build(r *request.Request) {
body := url.Values{
"Action": {r.Operation.Name},
- "Version": {r.Service.APIVersion},
+ "Version": {r.ClientInfo.APIVersion},
}
if err := queryutil.Parse(body, r.Params, false); err != nil {
r.Error = awserr.New("SerializationError", "failed encoding Query request", err)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go
index 824fb6c1703..535821b2fd4 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go
@@ -12,10 +12,10 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
+ "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/protocol/query"
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
@@ -35,30 +35,52 @@ var _ = ioutil.Discard
var _ = util.Trim("")
var _ = url.Values{}
var _ = io.EOF
+var _ = aws.String
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService1ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService1ProtocolTest client.
-func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice1protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService1ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService1ProtocolTest client from just a session.
+// svc := inputservice1protocoltest.New(mySession)
+//
+// // Create a InputService1ProtocolTest client with additional configuration
+// svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest {
+ c := p.ClientConfig("inputservice1protocoltest", cfgs...)
+ return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService1ProtocolTest {
+ svc := &InputService1ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice1protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService1ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService1ProtocolTest operation and runs any
@@ -72,13 +94,13 @@ func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, da
const opInputService1TestCaseOperation1 = "OperationName"
// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation.
-func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) {
+func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputShape) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) {
op := &request.Operation{
Name: opInputService1TestCaseOperation1,
}
if input == nil {
- input = &InputService1TestShapeInputService1TestCaseOperation1Input{}
+ input = &InputService1TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
@@ -87,22 +109,58 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input
return
}
-func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) {
+func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) {
req, out := c.InputService1TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
-type InputService1TestShapeInputService1TestCaseOperation1Input struct {
- Bar *string `type:"string"`
+const opInputService1TestCaseOperation2 = "OperationName"
- Foo *string `type:"string"`
+// InputService1TestCaseOperation2Request generates a request for the InputService1TestCaseOperation2 operation.
+func (c *InputService1ProtocolTest) InputService1TestCaseOperation2Request(input *InputService1TestShapeInputShape) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation2Output) {
+ op := &request.Operation{
+ Name: opInputService1TestCaseOperation2,
+ }
- metadataInputService1TestShapeInputService1TestCaseOperation1Input `json:"-" xml:"-"`
+ if input == nil {
+ input = &InputService1TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService1TestShapeInputService1TestCaseOperation2Output{}
+ req.Data = output
+ return
}
-type metadataInputService1TestShapeInputService1TestCaseOperation1Input struct {
- SDKShapeTraits bool `type:"structure"`
+func (c *InputService1ProtocolTest) InputService1TestCaseOperation2(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation2Output, error) {
+ req, out := c.InputService1TestCaseOperation2Request(input)
+ err := req.Send()
+ return out, err
+}
+
+const opInputService1TestCaseOperation3 = "OperationName"
+
+// InputService1TestCaseOperation3Request generates a request for the InputService1TestCaseOperation3 operation.
+func (c *InputService1ProtocolTest) InputService1TestCaseOperation3Request(input *InputService1TestShapeInputShape) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation3Output) {
+ op := &request.Operation{
+ Name: opInputService1TestCaseOperation3,
+ }
+
+ if input == nil {
+ input = &InputService1TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService1TestShapeInputService1TestCaseOperation3Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService1ProtocolTest) InputService1TestCaseOperation3(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation3Output, error) {
+ req, out := c.InputService1TestCaseOperation3Request(input)
+ err := req.Send()
+ return out, err
}
type InputService1TestShapeInputService1TestCaseOperation1Output struct {
@@ -113,29 +171,80 @@ type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
-type InputService2ProtocolTest struct {
- *service.Service
+type InputService1TestShapeInputService1TestCaseOperation2Output struct {
+ metadataInputService1TestShapeInputService1TestCaseOperation2Output `json:"-" xml:"-"`
}
-// New returns a new InputService2ProtocolTest client.
-func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice2protocoltest",
- APIVersion: "2014-01-01",
- },
+type metadataInputService1TestShapeInputService1TestCaseOperation2Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService1TestShapeInputService1TestCaseOperation3Output struct {
+ metadataInputService1TestShapeInputService1TestCaseOperation3Output `json:"-" xml:"-"`
+}
+
+type metadataInputService1TestShapeInputService1TestCaseOperation3Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService1TestShapeInputShape struct {
+ Bar *string `type:"string"`
+
+ Baz *bool `type:"boolean"`
+
+ Foo *string `type:"string"`
+
+ metadataInputService1TestShapeInputShape `json:"-" xml:"-"`
+}
+
+type metadataInputService1TestShapeInputShape struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type InputService2ProtocolTest struct {
+ *client.Client
+}
+
+// New creates a new instance of the InputService2ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService2ProtocolTest client from just a session.
+// svc := inputservice2protocoltest.New(mySession)
+//
+// // Create a InputService2ProtocolTest client with additional configuration
+// svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest {
+ c := p.ClientConfig("inputservice2protocoltest", cfgs...)
+ return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService2ProtocolTest {
+ svc := &InputService2ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice2protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService2ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService2ProtocolTest operation and runs any
@@ -198,29 +307,50 @@ type metadataInputService2TestShapeStructType struct {
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService3ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService3ProtocolTest client.
-func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice3protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService3ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService3ProtocolTest client from just a session.
+// svc := inputservice3protocoltest.New(mySession)
+//
+// // Create a InputService3ProtocolTest client with additional configuration
+// svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest {
+ c := p.ClientConfig("inputservice3protocoltest", cfgs...)
+ return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService3ProtocolTest {
+ svc := &InputService3ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice3protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService3ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService3ProtocolTest operation and runs any
@@ -234,13 +364,13 @@ func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, da
const opInputService3TestCaseOperation1 = "OperationName"
// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation.
-func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputService3TestCaseOperation1Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) {
+func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputShape) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) {
op := &request.Operation{
Name: opInputService3TestCaseOperation1,
}
if input == nil {
- input = &InputService3TestShapeInputService3TestCaseOperation1Input{}
+ input = &InputService3TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
@@ -249,20 +379,34 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input
return
}
-func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputService3TestCaseOperation1Input) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) {
+func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) {
req, out := c.InputService3TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
-type InputService3TestShapeInputService3TestCaseOperation1Input struct {
- ListArg []*string `type:"list"`
+const opInputService3TestCaseOperation2 = "OperationName"
- metadataInputService3TestShapeInputService3TestCaseOperation1Input `json:"-" xml:"-"`
+// InputService3TestCaseOperation2Request generates a request for the InputService3TestCaseOperation2 operation.
+func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input *InputService3TestShapeInputShape) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation2Output) {
+ op := &request.Operation{
+ Name: opInputService3TestCaseOperation2,
+ }
+
+ if input == nil {
+ input = &InputService3TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService3TestShapeInputService3TestCaseOperation2Output{}
+ req.Data = output
+ return
}
-type metadataInputService3TestShapeInputService3TestCaseOperation1Input struct {
- SDKShapeTraits bool `type:"structure"`
+func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) {
+ req, out := c.InputService3TestCaseOperation2Request(input)
+ err := req.Send()
+ return out, err
}
type InputService3TestShapeInputService3TestCaseOperation1Output struct {
@@ -273,29 +417,68 @@ type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
-type InputService4ProtocolTest struct {
- *service.Service
+type InputService3TestShapeInputService3TestCaseOperation2Output struct {
+ metadataInputService3TestShapeInputService3TestCaseOperation2Output `json:"-" xml:"-"`
}
-// New returns a new InputService4ProtocolTest client.
-func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice4protocoltest",
- APIVersion: "2014-01-01",
- },
+type metadataInputService3TestShapeInputService3TestCaseOperation2Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService3TestShapeInputShape struct {
+ ListArg []*string `type:"list"`
+
+ metadataInputService3TestShapeInputShape `json:"-" xml:"-"`
+}
+
+type metadataInputService3TestShapeInputShape struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type InputService4ProtocolTest struct {
+ *client.Client
+}
+
+// New creates a new instance of the InputService4ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService4ProtocolTest client from just a session.
+// svc := inputservice4protocoltest.New(mySession)
+//
+// // Create a InputService4ProtocolTest client with additional configuration
+// svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest {
+ c := p.ClientConfig("inputservice4protocoltest", cfgs...)
+ return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService4ProtocolTest {
+ svc := &InputService4ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice4protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService4ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService4ProtocolTest operation and runs any
@@ -309,13 +492,13 @@ func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, da
const opInputService4TestCaseOperation1 = "OperationName"
// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation.
-func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) {
+func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputShape) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) {
op := &request.Operation{
Name: opInputService4TestCaseOperation1,
}
if input == nil {
- input = &InputService4TestShapeInputService4TestCaseOperation1Input{}
+ input = &InputService4TestShapeInputShape{}
}
req = c.newRequest(op, input, output)
@@ -324,22 +507,34 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input
return
}
-func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) {
+func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) {
req, out := c.InputService4TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
-type InputService4TestShapeInputService4TestCaseOperation1Input struct {
- ListArg []*string `type:"list" flattened:"true"`
+const opInputService4TestCaseOperation2 = "OperationName"
- ScalarArg *string `type:"string"`
+// InputService4TestCaseOperation2Request generates a request for the InputService4TestCaseOperation2 operation.
+func (c *InputService4ProtocolTest) InputService4TestCaseOperation2Request(input *InputService4TestShapeInputShape) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation2Output) {
+ op := &request.Operation{
+ Name: opInputService4TestCaseOperation2,
+ }
- metadataInputService4TestShapeInputService4TestCaseOperation1Input `json:"-" xml:"-"`
+ if input == nil {
+ input = &InputService4TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService4TestShapeInputService4TestCaseOperation2Output{}
+ req.Data = output
+ return
}
-type metadataInputService4TestShapeInputService4TestCaseOperation1Input struct {
- SDKShapeTraits bool `type:"structure"`
+func (c *InputService4ProtocolTest) InputService4TestCaseOperation2(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation2Output, error) {
+ req, out := c.InputService4TestCaseOperation2Request(input)
+ err := req.Send()
+ return out, err
}
type InputService4TestShapeInputService4TestCaseOperation1Output struct {
@@ -350,29 +545,72 @@ type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
-type InputService5ProtocolTest struct {
- *service.Service
+type InputService4TestShapeInputService4TestCaseOperation2Output struct {
+ metadataInputService4TestShapeInputService4TestCaseOperation2Output `json:"-" xml:"-"`
}
-// New returns a new InputService5ProtocolTest client.
-func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice5protocoltest",
- APIVersion: "2014-01-01",
- },
+type metadataInputService4TestShapeInputService4TestCaseOperation2Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService4TestShapeInputShape struct {
+ ListArg []*string `type:"list" flattened:"true"`
+
+ NamedListArg []*string `locationNameList:"Foo" type:"list" flattened:"true"`
+
+ ScalarArg *string `type:"string"`
+
+ metadataInputService4TestShapeInputShape `json:"-" xml:"-"`
+}
+
+type metadataInputService4TestShapeInputShape struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type InputService5ProtocolTest struct {
+ *client.Client
+}
+
+// New creates a new instance of the InputService5ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService5ProtocolTest client from just a session.
+// svc := inputservice5protocoltest.New(mySession)
+//
+// // Create a InputService5ProtocolTest client with additional configuration
+// svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest {
+ c := p.ClientConfig("inputservice5protocoltest", cfgs...)
+ return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService5ProtocolTest {
+ svc := &InputService5ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice5protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService5ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService5ProtocolTest operation and runs any
@@ -408,9 +646,7 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *Input
}
type InputService5TestShapeInputService5TestCaseOperation1Input struct {
- ListArg []*string `locationNameList:"ListArgLocation" type:"list" flattened:"true"`
-
- ScalarArg *string `type:"string"`
+ MapArg map[string]*string `type:"map" flattened:"true"`
metadataInputService5TestShapeInputService5TestCaseOperation1Input `json:"-" xml:"-"`
}
@@ -427,29 +663,50 @@ type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService6ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService6ProtocolTest client.
-func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice6protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService6ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService6ProtocolTest client from just a session.
+// svc := inputservice6protocoltest.New(mySession)
+//
+// // Create a InputService6ProtocolTest client with additional configuration
+// svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest {
+ c := p.ClientConfig("inputservice6protocoltest", cfgs...)
+ return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService6ProtocolTest {
+ svc := &InputService6ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice6protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService6ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService6ProtocolTest operation and runs any
@@ -485,7 +742,7 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *Input
}
type InputService6TestShapeInputService6TestCaseOperation1Input struct {
- MapArg map[string]*string `type:"map"`
+ ListArg []*string `locationNameList:"item" type:"list"`
metadataInputService6TestShapeInputService6TestCaseOperation1Input `json:"-" xml:"-"`
}
@@ -502,29 +759,50 @@ type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService7ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService7ProtocolTest client.
-func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice7protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService7ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService7ProtocolTest client from just a session.
+// svc := inputservice7protocoltest.New(mySession)
+//
+// // Create a InputService7ProtocolTest client with additional configuration
+// svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest {
+ c := p.ClientConfig("inputservice7protocoltest", cfgs...)
+ return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService7ProtocolTest {
+ svc := &InputService7ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice7protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService7ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService7ProtocolTest operation and runs any
@@ -560,7 +838,9 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *Input
}
type InputService7TestShapeInputService7TestCaseOperation1Input struct {
- MapArg map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"`
+ ListArg []*string `locationNameList:"ListArgLocation" type:"list" flattened:"true"`
+
+ ScalarArg *string `type:"string"`
metadataInputService7TestShapeInputService7TestCaseOperation1Input `json:"-" xml:"-"`
}
@@ -577,29 +857,50 @@ type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService8ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService8ProtocolTest client.
-func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice8protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService8ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService8ProtocolTest client from just a session.
+// svc := inputservice8protocoltest.New(mySession)
+//
+// // Create a InputService8ProtocolTest client with additional configuration
+// svc := inputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService8ProtocolTest {
+ c := p.ClientConfig("inputservice8protocoltest", cfgs...)
+ return newInputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService8ProtocolTest {
+ svc := &InputService8ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice8protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService8ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService8ProtocolTest operation and runs any
@@ -635,7 +936,7 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *Input
}
type InputService8TestShapeInputService8TestCaseOperation1Input struct {
- BlobArg []byte `type:"blob"`
+ MapArg map[string]*string `type:"map"`
metadataInputService8TestShapeInputService8TestCaseOperation1Input `json:"-" xml:"-"`
}
@@ -652,29 +953,50 @@ type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService9ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService9ProtocolTest client.
-func NewInputService9ProtocolTest(config *aws.Config) *InputService9ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice9protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService9ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService9ProtocolTest client from just a session.
+// svc := inputservice9protocoltest.New(mySession)
+//
+// // Create a InputService9ProtocolTest client with additional configuration
+// svc := inputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService9ProtocolTest {
+ c := p.ClientConfig("inputservice9protocoltest", cfgs...)
+ return newInputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService9ProtocolTest {
+ svc := &InputService9ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice9protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService9ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService9ProtocolTest operation and runs any
@@ -710,7 +1032,7 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *Input
}
type InputService9TestShapeInputService9TestCaseOperation1Input struct {
- TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ MapArg map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"`
metadataInputService9TestShapeInputService9TestCaseOperation1Input `json:"-" xml:"-"`
}
@@ -727,29 +1049,50 @@ type metadataInputService9TestShapeInputService9TestCaseOperation1Output struct
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type InputService10ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new InputService10ProtocolTest client.
-func NewInputService10ProtocolTest(config *aws.Config) *InputService10ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "inputservice10protocoltest",
- APIVersion: "2014-01-01",
- },
+// New creates a new instance of the InputService10ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService10ProtocolTest client from just a session.
+// svc := inputservice10protocoltest.New(mySession)
+//
+// // Create a InputService10ProtocolTest client with additional configuration
+// svc := inputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService10ProtocolTest {
+ c := p.ClientConfig("inputservice10protocoltest", cfgs...)
+ return newInputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService10ProtocolTest {
+ svc := &InputService10ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice10protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &InputService10ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a InputService10ProtocolTest operation and runs any
@@ -763,13 +1106,13 @@ func (c *InputService10ProtocolTest) newRequest(op *request.Operation, params, d
const opInputService10TestCaseOperation1 = "OperationName"
// InputService10TestCaseOperation1Request generates a request for the InputService10TestCaseOperation1 operation.
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputShape) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) {
+func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation1Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) {
op := &request.Operation{
Name: opInputService10TestCaseOperation1,
}
if input == nil {
- input = &InputService10TestShapeInputShape{}
+ input = &InputService10TestShapeInputService10TestCaseOperation1Input{}
}
req = c.newRequest(op, input, output)
@@ -778,130 +1121,20 @@ func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(inp
return
}
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputShape) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
+func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation1Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) {
req, out := c.InputService10TestCaseOperation1Request(input)
err := req.Send()
return out, err
}
-const opInputService10TestCaseOperation2 = "OperationName"
+type InputService10TestShapeInputService10TestCaseOperation1Input struct {
+ BlobArg []byte `type:"blob"`
-// InputService10TestCaseOperation2Request generates a request for the InputService10TestCaseOperation2 operation.
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation2Request(input *InputService10TestShapeInputShape) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation2Output) {
- op := &request.Operation{
- Name: opInputService10TestCaseOperation2,
- }
-
- if input == nil {
- input = &InputService10TestShapeInputShape{}
- }
-
- req = c.newRequest(op, input, output)
- output = &InputService10TestShapeInputService10TestCaseOperation2Output{}
- req.Data = output
- return
+ metadataInputService10TestShapeInputService10TestCaseOperation1Input `json:"-" xml:"-"`
}
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation2(input *InputService10TestShapeInputShape) (*InputService10TestShapeInputService10TestCaseOperation2Output, error) {
- req, out := c.InputService10TestCaseOperation2Request(input)
- err := req.Send()
- return out, err
-}
-
-const opInputService10TestCaseOperation3 = "OperationName"
-
-// InputService10TestCaseOperation3Request generates a request for the InputService10TestCaseOperation3 operation.
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation3Request(input *InputService10TestShapeInputShape) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation3Output) {
- op := &request.Operation{
- Name: opInputService10TestCaseOperation3,
- }
-
- if input == nil {
- input = &InputService10TestShapeInputShape{}
- }
-
- req = c.newRequest(op, input, output)
- output = &InputService10TestShapeInputService10TestCaseOperation3Output{}
- req.Data = output
- return
-}
-
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation3(input *InputService10TestShapeInputShape) (*InputService10TestShapeInputService10TestCaseOperation3Output, error) {
- req, out := c.InputService10TestCaseOperation3Request(input)
- err := req.Send()
- return out, err
-}
-
-const opInputService10TestCaseOperation4 = "OperationName"
-
-// InputService10TestCaseOperation4Request generates a request for the InputService10TestCaseOperation4 operation.
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation4Request(input *InputService10TestShapeInputShape) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation4Output) {
- op := &request.Operation{
- Name: opInputService10TestCaseOperation4,
- }
-
- if input == nil {
- input = &InputService10TestShapeInputShape{}
- }
-
- req = c.newRequest(op, input, output)
- output = &InputService10TestShapeInputService10TestCaseOperation4Output{}
- req.Data = output
- return
-}
-
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation4(input *InputService10TestShapeInputShape) (*InputService10TestShapeInputService10TestCaseOperation4Output, error) {
- req, out := c.InputService10TestCaseOperation4Request(input)
- err := req.Send()
- return out, err
-}
-
-const opInputService10TestCaseOperation5 = "OperationName"
-
-// InputService10TestCaseOperation5Request generates a request for the InputService10TestCaseOperation5 operation.
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation5Request(input *InputService10TestShapeInputShape) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation5Output) {
- op := &request.Operation{
- Name: opInputService10TestCaseOperation5,
- }
-
- if input == nil {
- input = &InputService10TestShapeInputShape{}
- }
-
- req = c.newRequest(op, input, output)
- output = &InputService10TestShapeInputService10TestCaseOperation5Output{}
- req.Data = output
- return
-}
-
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation5(input *InputService10TestShapeInputShape) (*InputService10TestShapeInputService10TestCaseOperation5Output, error) {
- req, out := c.InputService10TestCaseOperation5Request(input)
- err := req.Send()
- return out, err
-}
-
-const opInputService10TestCaseOperation6 = "OperationName"
-
-// InputService10TestCaseOperation6Request generates a request for the InputService10TestCaseOperation6 operation.
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation6Request(input *InputService10TestShapeInputShape) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation6Output) {
- op := &request.Operation{
- Name: opInputService10TestCaseOperation6,
- }
-
- if input == nil {
- input = &InputService10TestShapeInputShape{}
- }
-
- req = c.newRequest(op, input, output)
- output = &InputService10TestShapeInputService10TestCaseOperation6Output{}
- req.Data = output
- return
-}
-
-func (c *InputService10ProtocolTest) InputService10TestCaseOperation6(input *InputService10TestShapeInputShape) (*InputService10TestShapeInputService10TestCaseOperation6Output, error) {
- req, out := c.InputService10TestCaseOperation6Request(input)
- err := req.Send()
- return out, err
+type metadataInputService10TestShapeInputService10TestCaseOperation1Input struct {
+ SDKShapeTraits bool `type:"structure"`
}
type InputService10TestShapeInputService10TestCaseOperation1Output struct {
@@ -912,69 +1145,371 @@ type metadataInputService10TestShapeInputService10TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeInputService10TestCaseOperation2Output struct {
- metadataInputService10TestShapeInputService10TestCaseOperation2Output `json:"-" xml:"-"`
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type InputService11ProtocolTest struct {
+ *client.Client
}
-type metadataInputService10TestShapeInputService10TestCaseOperation2Output struct {
+// New creates a new instance of the InputService11ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService11ProtocolTest client from just a session.
+// svc := inputservice11protocoltest.New(mySession)
+//
+// // Create a InputService11ProtocolTest client with additional configuration
+// svc := inputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService11ProtocolTest {
+ c := p.ClientConfig("inputservice11protocoltest", cfgs...)
+ return newInputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService11ProtocolTest {
+ svc := &InputService11ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice11protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
+ }
+
+ // Handlers
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+
+ return svc
+}
+
+// newRequest creates a new request for a InputService11ProtocolTest operation and runs any
+// custom request initialization.
+func (c *InputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
+ req := c.NewRequest(op, params, data)
+
+ return req
+}
+
+const opInputService11TestCaseOperation1 = "OperationName"
+
+// InputService11TestCaseOperation1Request generates a request for the InputService11TestCaseOperation1 operation.
+func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(input *InputService11TestShapeInputService11TestCaseOperation1Input) (req *request.Request, output *InputService11TestShapeInputService11TestCaseOperation1Output) {
+ op := &request.Operation{
+ Name: opInputService11TestCaseOperation1,
+ }
+
+ if input == nil {
+ input = &InputService11TestShapeInputService11TestCaseOperation1Input{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService11TestShapeInputService11TestCaseOperation1Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService11ProtocolTest) InputService11TestCaseOperation1(input *InputService11TestShapeInputService11TestCaseOperation1Input) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) {
+ req, out := c.InputService11TestCaseOperation1Request(input)
+ err := req.Send()
+ return out, err
+}
+
+type InputService11TestShapeInputService11TestCaseOperation1Input struct {
+ TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+
+ metadataInputService11TestShapeInputService11TestCaseOperation1Input `json:"-" xml:"-"`
+}
+
+type metadataInputService11TestShapeInputService11TestCaseOperation1Input struct {
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeInputService10TestCaseOperation3Output struct {
- metadataInputService10TestShapeInputService10TestCaseOperation3Output `json:"-" xml:"-"`
+type InputService11TestShapeInputService11TestCaseOperation1Output struct {
+ metadataInputService11TestShapeInputService11TestCaseOperation1Output `json:"-" xml:"-"`
}
-type metadataInputService10TestShapeInputService10TestCaseOperation3Output struct {
+type metadataInputService11TestShapeInputService11TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeInputService10TestCaseOperation4Output struct {
- metadataInputService10TestShapeInputService10TestCaseOperation4Output `json:"-" xml:"-"`
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type InputService12ProtocolTest struct {
+ *client.Client
}
-type metadataInputService10TestShapeInputService10TestCaseOperation4Output struct {
+// New creates a new instance of the InputService12ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a InputService12ProtocolTest client from just a session.
+// svc := inputservice12protocoltest.New(mySession)
+//
+// // Create a InputService12ProtocolTest client with additional configuration
+// svc := inputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewInputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService12ProtocolTest {
+ c := p.ClientConfig("inputservice12protocoltest", cfgs...)
+ return newInputService12ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService12ProtocolTest {
+ svc := &InputService12ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "inputservice12protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2014-01-01",
+ },
+ handlers,
+ ),
+ }
+
+ // Handlers
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+
+ return svc
+}
+
+// newRequest creates a new request for a InputService12ProtocolTest operation and runs any
+// custom request initialization.
+func (c *InputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
+ req := c.NewRequest(op, params, data)
+
+ return req
+}
+
+const opInputService12TestCaseOperation1 = "OperationName"
+
+// InputService12TestCaseOperation1Request generates a request for the InputService12TestCaseOperation1 operation.
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation1Output) {
+ op := &request.Operation{
+ Name: opInputService12TestCaseOperation1,
+ }
+
+ if input == nil {
+ input = &InputService12TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService12TestShapeInputService12TestCaseOperation1Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation1(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) {
+ req, out := c.InputService12TestCaseOperation1Request(input)
+ err := req.Send()
+ return out, err
+}
+
+const opInputService12TestCaseOperation2 = "OperationName"
+
+// InputService12TestCaseOperation2Request generates a request for the InputService12TestCaseOperation2 operation.
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation2Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation2Output) {
+ op := &request.Operation{
+ Name: opInputService12TestCaseOperation2,
+ }
+
+ if input == nil {
+ input = &InputService12TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService12TestShapeInputService12TestCaseOperation2Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation2(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation2Output, error) {
+ req, out := c.InputService12TestCaseOperation2Request(input)
+ err := req.Send()
+ return out, err
+}
+
+const opInputService12TestCaseOperation3 = "OperationName"
+
+// InputService12TestCaseOperation3Request generates a request for the InputService12TestCaseOperation3 operation.
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation3Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation3Output) {
+ op := &request.Operation{
+ Name: opInputService12TestCaseOperation3,
+ }
+
+ if input == nil {
+ input = &InputService12TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService12TestShapeInputService12TestCaseOperation3Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation3(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation3Output, error) {
+ req, out := c.InputService12TestCaseOperation3Request(input)
+ err := req.Send()
+ return out, err
+}
+
+const opInputService12TestCaseOperation4 = "OperationName"
+
+// InputService12TestCaseOperation4Request generates a request for the InputService12TestCaseOperation4 operation.
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation4Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation4Output) {
+ op := &request.Operation{
+ Name: opInputService12TestCaseOperation4,
+ }
+
+ if input == nil {
+ input = &InputService12TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService12TestShapeInputService12TestCaseOperation4Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation4(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation4Output, error) {
+ req, out := c.InputService12TestCaseOperation4Request(input)
+ err := req.Send()
+ return out, err
+}
+
+const opInputService12TestCaseOperation5 = "OperationName"
+
+// InputService12TestCaseOperation5Request generates a request for the InputService12TestCaseOperation5 operation.
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation5Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation5Output) {
+ op := &request.Operation{
+ Name: opInputService12TestCaseOperation5,
+ }
+
+ if input == nil {
+ input = &InputService12TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService12TestShapeInputService12TestCaseOperation5Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation5(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation5Output, error) {
+ req, out := c.InputService12TestCaseOperation5Request(input)
+ err := req.Send()
+ return out, err
+}
+
+const opInputService12TestCaseOperation6 = "OperationName"
+
+// InputService12TestCaseOperation6Request generates a request for the InputService12TestCaseOperation6 operation.
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation6Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation6Output) {
+ op := &request.Operation{
+ Name: opInputService12TestCaseOperation6,
+ }
+
+ if input == nil {
+ input = &InputService12TestShapeInputShape{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &InputService12TestShapeInputService12TestCaseOperation6Output{}
+ req.Data = output
+ return
+}
+
+func (c *InputService12ProtocolTest) InputService12TestCaseOperation6(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation6Output, error) {
+ req, out := c.InputService12TestCaseOperation6Request(input)
+ err := req.Send()
+ return out, err
+}
+
+type InputService12TestShapeInputService12TestCaseOperation1Output struct {
+ metadataInputService12TestShapeInputService12TestCaseOperation1Output `json:"-" xml:"-"`
+}
+
+type metadataInputService12TestShapeInputService12TestCaseOperation1Output struct {
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeInputService10TestCaseOperation5Output struct {
- metadataInputService10TestShapeInputService10TestCaseOperation5Output `json:"-" xml:"-"`
+type InputService12TestShapeInputService12TestCaseOperation2Output struct {
+ metadataInputService12TestShapeInputService12TestCaseOperation2Output `json:"-" xml:"-"`
}
-type metadataInputService10TestShapeInputService10TestCaseOperation5Output struct {
+type metadataInputService12TestShapeInputService12TestCaseOperation2Output struct {
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeInputService10TestCaseOperation6Output struct {
- metadataInputService10TestShapeInputService10TestCaseOperation6Output `json:"-" xml:"-"`
+type InputService12TestShapeInputService12TestCaseOperation3Output struct {
+ metadataInputService12TestShapeInputService12TestCaseOperation3Output `json:"-" xml:"-"`
}
-type metadataInputService10TestShapeInputService10TestCaseOperation6Output struct {
+type metadataInputService12TestShapeInputService12TestCaseOperation3Output struct {
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeInputShape struct {
- RecursiveStruct *InputService10TestShapeRecursiveStructType `type:"structure"`
-
- metadataInputService10TestShapeInputShape `json:"-" xml:"-"`
+type InputService12TestShapeInputService12TestCaseOperation4Output struct {
+ metadataInputService12TestShapeInputService12TestCaseOperation4Output `json:"-" xml:"-"`
}
-type metadataInputService10TestShapeInputShape struct {
+type metadataInputService12TestShapeInputService12TestCaseOperation4Output struct {
SDKShapeTraits bool `type:"structure"`
}
-type InputService10TestShapeRecursiveStructType struct {
+type InputService12TestShapeInputService12TestCaseOperation5Output struct {
+ metadataInputService12TestShapeInputService12TestCaseOperation5Output `json:"-" xml:"-"`
+}
+
+type metadataInputService12TestShapeInputService12TestCaseOperation5Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService12TestShapeInputService12TestCaseOperation6Output struct {
+ metadataInputService12TestShapeInputService12TestCaseOperation6Output `json:"-" xml:"-"`
+}
+
+type metadataInputService12TestShapeInputService12TestCaseOperation6Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService12TestShapeInputShape struct {
+ RecursiveStruct *InputService12TestShapeRecursiveStructType `type:"structure"`
+
+ metadataInputService12TestShapeInputShape `json:"-" xml:"-"`
+}
+
+type metadataInputService12TestShapeInputShape struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type InputService12TestShapeRecursiveStructType struct {
NoRecurse *string `type:"string"`
- RecursiveList []*InputService10TestShapeRecursiveStructType `type:"list"`
+ RecursiveList []*InputService12TestShapeRecursiveStructType `type:"list"`
- RecursiveMap map[string]*InputService10TestShapeRecursiveStructType `type:"map"`
+ RecursiveMap map[string]*InputService12TestShapeRecursiveStructType `type:"map"`
- RecursiveStruct *InputService10TestShapeRecursiveStructType `type:"structure"`
+ RecursiveStruct *InputService12TestShapeRecursiveStructType `type:"structure"`
- metadataInputService10TestShapeRecursiveStructType `json:"-" xml:"-"`
+ metadataInputService12TestShapeRecursiveStructType `json:"-" xml:"-"`
}
-type metadataInputService10TestShapeRecursiveStructType struct {
+type metadataInputService12TestShapeRecursiveStructType struct {
SDKShapeTraits bool `type:"structure"`
}
@@ -983,10 +1518,10 @@ type metadataInputService10TestShapeRecursiveStructType struct {
//
func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
- svc := NewInputService1ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService1TestShapeInputService1TestCaseOperation1Input{
+ input := &InputService1TestShapeInputShape{
Bar: aws.String("val2"),
Foo: aws.String("val1"),
}
@@ -1009,9 +1544,61 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) {
}
+func TestInputService1ProtocolTestScalarMembersCase2(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ input := &InputService1TestShapeInputShape{
+ Baz: aws.Bool(true),
+ }
+ req, _ := svc.InputService1TestCaseOperation2Request(input)
+ r := req.HTTPRequest
+
+ // build request
+ query.Build(req)
+ assert.NoError(t, req.Error)
+
+ // assert body
+ assert.NotNil(t, r.Body)
+ body, _ := ioutil.ReadAll(r.Body)
+ awstesting.AssertQuery(t, `Action=OperationName&Baz=true&Version=2014-01-01`, util.Trim(string(body)))
+
+ // assert URL
+ awstesting.AssertURL(t, "https://test/", r.URL.String())
+
+ // assert headers
+
+}
+
+func TestInputService1ProtocolTestScalarMembersCase3(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ input := &InputService1TestShapeInputShape{
+ Baz: aws.Bool(false),
+ }
+ req, _ := svc.InputService1TestCaseOperation3Request(input)
+ r := req.HTTPRequest
+
+ // build request
+ query.Build(req)
+ assert.NoError(t, req.Error)
+
+ // assert body
+ assert.NotNil(t, r.Body)
+ body, _ := ioutil.ReadAll(r.Body)
+ awstesting.AssertQuery(t, `Action=OperationName&Baz=false&Version=2014-01-01`, util.Trim(string(body)))
+
+ // assert URL
+ awstesting.AssertURL(t, "https://test/", r.URL.String())
+
+ // assert headers
+
+}
+
func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) {
- svc := NewInputService2ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService2TestShapeInputService2TestCaseOperation1Input{
StructArg: &InputService2TestShapeStructType{
@@ -1038,10 +1625,10 @@ func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) {
}
func TestInputService3ProtocolTestListTypesCase1(t *testing.T) {
- svc := NewInputService3ProtocolTest(nil)
- svc.Endpoint = "https://test"
+ sess := session.New()
+ svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService3TestShapeInputService3TestCaseOperation1Input{
+ input := &InputService3TestShapeInputShape{
ListArg: []*string{
aws.String("foo"),
aws.String("bar"),
@@ -1067,11 +1654,37 @@ func TestInputService3ProtocolTestListTypesCase1(t *testing.T) {
}
-func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) {
- svc := NewInputService4ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService3ProtocolTestListTypesCase2(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService4TestShapeInputService4TestCaseOperation1Input{
+ input := &InputService3TestShapeInputShape{
+ ListArg: []*string{},
+ }
+ req, _ := svc.InputService3TestCaseOperation2Request(input)
+ r := req.HTTPRequest
+
+ // build request
+ query.Build(req)
+ assert.NoError(t, req.Error)
+
+ // assert body
+ assert.NotNil(t, r.Body)
+ body, _ := ioutil.ReadAll(r.Body)
+ awstesting.AssertQuery(t, `Action=OperationName&ListArg=&Version=2014-01-01`, util.Trim(string(body)))
+
+ // assert URL
+ awstesting.AssertURL(t, "https://test/", r.URL.String())
+
+ // assert headers
+
+}
+
+func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ input := &InputService4TestShapeInputShape{
ListArg: []*string{
aws.String("a"),
aws.String("b"),
@@ -1098,11 +1711,98 @@ func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) {
}
-func TestInputService5ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) {
- svc := NewInputService5ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService4ProtocolTestFlattenedListCase2(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ input := &InputService4TestShapeInputShape{
+ NamedListArg: []*string{
+ aws.String("a"),
+ },
+ }
+ req, _ := svc.InputService4TestCaseOperation2Request(input)
+ r := req.HTTPRequest
+
+ // build request
+ query.Build(req)
+ assert.NoError(t, req.Error)
+
+ // assert body
+ assert.NotNil(t, r.Body)
+ body, _ := ioutil.ReadAll(r.Body)
+ awstesting.AssertQuery(t, `Action=OperationName&Foo.1=a&Version=2014-01-01`, util.Trim(string(body)))
+
+ // assert URL
+ awstesting.AssertURL(t, "https://test/", r.URL.String())
+
+ // assert headers
+
+}
+
+func TestInputService5ProtocolTestSerializeFlattenedMapTypeCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
input := &InputService5TestShapeInputService5TestCaseOperation1Input{
+ MapArg: map[string]*string{
+ "key1": aws.String("val1"),
+ "key2": aws.String("val2"),
+ },
+ }
+ req, _ := svc.InputService5TestCaseOperation1Request(input)
+ r := req.HTTPRequest
+
+ // build request
+ query.Build(req)
+ assert.NoError(t, req.Error)
+
+ // assert body
+ assert.NotNil(t, r.Body)
+ body, _ := ioutil.ReadAll(r.Body)
+ awstesting.AssertQuery(t, `Action=OperationName&MapArg.1.key=key1&MapArg.1.value=val1&MapArg.2.key=key2&MapArg.2.value=val2&Version=2014-01-01`, util.Trim(string(body)))
+
+ // assert URL
+ awstesting.AssertURL(t, "https://test/", r.URL.String())
+
+ // assert headers
+
+}
+
+func TestInputService6ProtocolTestNonFlattenedListWithLocationNameCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ input := &InputService6TestShapeInputService6TestCaseOperation1Input{
+ ListArg: []*string{
+ aws.String("a"),
+ aws.String("b"),
+ aws.String("c"),
+ },
+ }
+ req, _ := svc.InputService6TestCaseOperation1Request(input)
+ r := req.HTTPRequest
+
+ // build request
+ query.Build(req)
+ assert.NoError(t, req.Error)
+
+ // assert body
+ assert.NotNil(t, r.Body)
+ body, _ := ioutil.ReadAll(r.Body)
+ awstesting.AssertQuery(t, `Action=OperationName&ListArg.item.1=a&ListArg.item.2=b&ListArg.item.3=c&Version=2014-01-01`, util.Trim(string(body)))
+
+ // assert URL
+ awstesting.AssertURL(t, "https://test/", r.URL.String())
+
+ // assert headers
+
+}
+
+func TestInputService7ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ input := &InputService7TestShapeInputService7TestCaseOperation1Input{
ListArg: []*string{
aws.String("a"),
aws.String("b"),
@@ -1110,7 +1810,7 @@ func TestInputService5ProtocolTestFlattenedListWithLocationNameCase1(t *testing.
},
ScalarArg: aws.String("foo"),
}
- req, _ := svc.InputService5TestCaseOperation1Request(input)
+ req, _ := svc.InputService7TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
@@ -1129,17 +1829,17 @@ func TestInputService5ProtocolTestFlattenedListWithLocationNameCase1(t *testing.
}
-func TestInputService6ProtocolTestSerializeMapTypeCase1(t *testing.T) {
- svc := NewInputService6ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService8ProtocolTestSerializeMapTypeCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService6TestShapeInputService6TestCaseOperation1Input{
+ input := &InputService8TestShapeInputService8TestCaseOperation1Input{
MapArg: map[string]*string{
"key1": aws.String("val1"),
"key2": aws.String("val2"),
},
}
- req, _ := svc.InputService6TestCaseOperation1Request(input)
+ req, _ := svc.InputService8TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
@@ -1158,17 +1858,17 @@ func TestInputService6ProtocolTestSerializeMapTypeCase1(t *testing.T) {
}
-func TestInputService7ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testing.T) {
- svc := NewInputService7ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService9ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService7TestShapeInputService7TestCaseOperation1Input{
+ input := &InputService9TestShapeInputService9TestCaseOperation1Input{
MapArg: map[string]*string{
"key1": aws.String("val1"),
"key2": aws.String("val2"),
},
}
- req, _ := svc.InputService7TestCaseOperation1Request(input)
+ req, _ := svc.InputService9TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
@@ -1187,14 +1887,14 @@ func TestInputService7ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testi
}
-func TestInputService8ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
- svc := NewInputService8ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService10ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService8TestShapeInputService8TestCaseOperation1Input{
+ input := &InputService10TestShapeInputService10TestCaseOperation1Input{
BlobArg: []byte("foo"),
}
- req, _ := svc.InputService8TestCaseOperation1Request(input)
+ req, _ := svc.InputService10TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
@@ -1213,14 +1913,14 @@ func TestInputService8ProtocolTestBase64EncodedBlobsCase1(t *testing.T) {
}
-func TestInputService9ProtocolTestTimestampValuesCase1(t *testing.T) {
- svc := NewInputService9ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService11ProtocolTestTimestampValuesCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService9TestShapeInputService9TestCaseOperation1Input{
+ input := &InputService11TestShapeInputService11TestCaseOperation1Input{
TimeArg: aws.Time(time.Unix(1422172800, 0)),
}
- req, _ := svc.InputService9TestCaseOperation1Request(input)
+ req, _ := svc.InputService11TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
@@ -1239,16 +1939,16 @@ func TestInputService9ProtocolTestTimestampValuesCase1(t *testing.T) {
}
-func TestInputService10ProtocolTestRecursiveShapesCase1(t *testing.T) {
- svc := NewInputService10ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService12ProtocolTestRecursiveShapesCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService10TestShapeInputShape{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
+ input := &InputService12TestShapeInputShape{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
NoRecurse: aws.String("foo"),
},
}
- req, _ := svc.InputService10TestCaseOperation1Request(input)
+ req, _ := svc.InputService12TestCaseOperation1Request(input)
r := req.HTTPRequest
// build request
@@ -1267,18 +1967,18 @@ func TestInputService10ProtocolTestRecursiveShapesCase1(t *testing.T) {
}
-func TestInputService10ProtocolTestRecursiveShapesCase2(t *testing.T) {
- svc := NewInputService10ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService12ProtocolTestRecursiveShapesCase2(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService10TestShapeInputShape{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
+ input := &InputService12TestShapeInputShape{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
NoRecurse: aws.String("foo"),
},
},
}
- req, _ := svc.InputService10TestCaseOperation2Request(input)
+ req, _ := svc.InputService12TestCaseOperation2Request(input)
r := req.HTTPRequest
// build request
@@ -1297,22 +1997,22 @@ func TestInputService10ProtocolTestRecursiveShapesCase2(t *testing.T) {
}
-func TestInputService10ProtocolTestRecursiveShapesCase3(t *testing.T) {
- svc := NewInputService10ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService12ProtocolTestRecursiveShapesCase3(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService10TestShapeInputShape{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
+ input := &InputService12TestShapeInputShape{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
NoRecurse: aws.String("foo"),
},
},
},
},
}
- req, _ := svc.InputService10TestCaseOperation3Request(input)
+ req, _ := svc.InputService12TestCaseOperation3Request(input)
r := req.HTTPRequest
// build request
@@ -1331,13 +2031,13 @@ func TestInputService10ProtocolTestRecursiveShapesCase3(t *testing.T) {
}
-func TestInputService10ProtocolTestRecursiveShapesCase4(t *testing.T) {
- svc := NewInputService10ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService12ProtocolTestRecursiveShapesCase4(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService10TestShapeInputShape{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveList: []*InputService10TestShapeRecursiveStructType{
+ input := &InputService12TestShapeInputShape{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveList: []*InputService12TestShapeRecursiveStructType{
{
NoRecurse: aws.String("foo"),
},
@@ -1347,7 +2047,7 @@ func TestInputService10ProtocolTestRecursiveShapesCase4(t *testing.T) {
},
},
}
- req, _ := svc.InputService10TestCaseOperation4Request(input)
+ req, _ := svc.InputService12TestCaseOperation4Request(input)
r := req.HTTPRequest
// build request
@@ -1366,25 +2066,25 @@ func TestInputService10ProtocolTestRecursiveShapesCase4(t *testing.T) {
}
-func TestInputService10ProtocolTestRecursiveShapesCase5(t *testing.T) {
- svc := NewInputService10ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService12ProtocolTestRecursiveShapesCase5(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService10TestShapeInputShape{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveList: []*InputService10TestShapeRecursiveStructType{
+ input := &InputService12TestShapeInputShape{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveList: []*InputService12TestShapeRecursiveStructType{
{
NoRecurse: aws.String("foo"),
},
{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
NoRecurse: aws.String("bar"),
},
},
},
},
}
- req, _ := svc.InputService10TestCaseOperation5Request(input)
+ req, _ := svc.InputService12TestCaseOperation5Request(input)
r := req.HTTPRequest
// build request
@@ -1403,13 +2103,13 @@ func TestInputService10ProtocolTestRecursiveShapesCase5(t *testing.T) {
}
-func TestInputService10ProtocolTestRecursiveShapesCase6(t *testing.T) {
- svc := NewInputService10ProtocolTest(nil)
- svc.Endpoint = "https://test"
+func TestInputService12ProtocolTestRecursiveShapesCase6(t *testing.T) {
+ sess := session.New()
+ svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
- input := &InputService10TestShapeInputShape{
- RecursiveStruct: &InputService10TestShapeRecursiveStructType{
- RecursiveMap: map[string]*InputService10TestShapeRecursiveStructType{
+ input := &InputService12TestShapeInputShape{
+ RecursiveStruct: &InputService12TestShapeRecursiveStructType{
+ RecursiveMap: map[string]*InputService12TestShapeRecursiveStructType{
"bar": {
NoRecurse: aws.String("bar"),
},
@@ -1419,7 +2119,7 @@ func TestInputService10ProtocolTestRecursiveShapesCase6(t *testing.T) {
},
},
}
- req, _ := svc.InputService10TestCaseOperation6Request(input)
+ req, _ := svc.InputService12TestCaseOperation6Request(input)
r := req.HTTPRequest
// build request
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
index 3b417a89f71..4afa4cf0eed 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
@@ -72,7 +72,7 @@ func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix stri
continue // ignore unexported fields
}
- value := elemOf(value.Field(i))
+ elemValue := elemOf(value.Field(i))
field := t.Field(i)
var name string
@@ -97,7 +97,7 @@ func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix stri
name = prefix + "." + name
}
- if err := q.parseValue(v, value, name, field.Tag); err != nil {
+ if err := q.parseValue(v, elemValue, name, field.Tag); err != nil {
return err
}
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go
index a3d08a1a2f0..fe2a58e3650 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go
@@ -12,10 +12,10 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
+ "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/private/protocol/query"
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
@@ -35,30 +35,52 @@ var _ = ioutil.Discard
var _ = util.Trim("")
var _ = url.Values{}
var _ = io.EOF
+var _ = aws.String
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService1ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService1ProtocolTest client.
-func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice1protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService1ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService1ProtocolTest client from just a session.
+// svc := outputservice1protocoltest.New(mySession)
+//
+// // Create a OutputService1ProtocolTest client with additional configuration
+// svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest {
+ c := p.ClientConfig("outputservice1protocoltest", cfgs...)
+ return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService1ProtocolTest {
+ svc := &OutputService1ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice1protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService1ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any
@@ -127,29 +149,50 @@ type metadataOutputService1TestShapeOutputService1TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService2ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService2ProtocolTest client.
-func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice2protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService2ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService2ProtocolTest client from just a session.
+// svc := outputservice2protocoltest.New(mySession)
+//
+// // Create a OutputService2ProtocolTest client with additional configuration
+// svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest {
+ c := p.ClientConfig("outputservice2protocoltest", cfgs...)
+ return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService2ProtocolTest {
+ svc := &OutputService2ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice2protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService2ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any
@@ -204,29 +247,50 @@ type metadataOutputService2TestShapeOutputService2TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService3ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService3ProtocolTest client.
-func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice3protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService3ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService3ProtocolTest client from just a session.
+// svc := outputservice3protocoltest.New(mySession)
+//
+// // Create a OutputService3ProtocolTest client with additional configuration
+// svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest {
+ c := p.ClientConfig("outputservice3protocoltest", cfgs...)
+ return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService3ProtocolTest {
+ svc := &OutputService3ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice3protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService3ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any
@@ -279,29 +343,50 @@ type metadataOutputService3TestShapeOutputService3TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService4ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService4ProtocolTest client.
-func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice4protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService4ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService4ProtocolTest client from just a session.
+// svc := outputservice4protocoltest.New(mySession)
+//
+// // Create a OutputService4ProtocolTest client with additional configuration
+// svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest {
+ c := p.ClientConfig("outputservice4protocoltest", cfgs...)
+ return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService4ProtocolTest {
+ svc := &OutputService4ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice4protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService4ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any
@@ -354,29 +439,50 @@ type metadataOutputService4TestShapeOutputService4TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService5ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService5ProtocolTest client.
-func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice5protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService5ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService5ProtocolTest client from just a session.
+// svc := outputservice5protocoltest.New(mySession)
+//
+// // Create a OutputService5ProtocolTest client with additional configuration
+// svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest {
+ c := p.ClientConfig("outputservice5protocoltest", cfgs...)
+ return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService5ProtocolTest {
+ svc := &OutputService5ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice5protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService5ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any
@@ -429,29 +535,50 @@ type metadataOutputService5TestShapeOutputService5TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService6ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService6ProtocolTest client.
-func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice6protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService6ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService6ProtocolTest client from just a session.
+// svc := outputservice6protocoltest.New(mySession)
+//
+// // Create a OutputService6ProtocolTest client with additional configuration
+// svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest {
+ c := p.ClientConfig("outputservice6protocoltest", cfgs...)
+ return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService6ProtocolTest {
+ svc := &OutputService6ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice6protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService6ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any
@@ -504,29 +631,50 @@ type metadataOutputService6TestShapeOutputService6TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService7ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService7ProtocolTest client.
-func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice7protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService7ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService7ProtocolTest client from just a session.
+// svc := outputservice7protocoltest.New(mySession)
+//
+// // Create a OutputService7ProtocolTest client with additional configuration
+// svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest {
+ c := p.ClientConfig("outputservice7protocoltest", cfgs...)
+ return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService7ProtocolTest {
+ svc := &OutputService7ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice7protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService7ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any
@@ -579,29 +727,50 @@ type metadataOutputService7TestShapeOutputService7TestCaseOperation1Output struc
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService8ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService8ProtocolTest client.
-func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice8protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService8ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService8ProtocolTest client from just a session.
+// svc := outputservice8protocoltest.New(mySession)
+//
+// // Create a OutputService8ProtocolTest client with additional configuration
+// svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest {
+ c := p.ClientConfig("outputservice8protocoltest", cfgs...)
+ return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService8ProtocolTest {
+ svc := &OutputService8ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice8protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService8ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any
@@ -668,29 +837,50 @@ type metadataOutputService8TestShapeStructureShape struct {
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService9ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService9ProtocolTest client.
-func NewOutputService9ProtocolTest(config *aws.Config) *OutputService9ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice9protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService9ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService9ProtocolTest client from just a session.
+// svc := outputservice9protocoltest.New(mySession)
+//
+// // Create a OutputService9ProtocolTest client with additional configuration
+// svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest {
+ c := p.ClientConfig("outputservice9protocoltest", cfgs...)
+ return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService9ProtocolTest {
+ svc := &OutputService9ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice9protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService9ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService9ProtocolTest operation and runs any
@@ -757,29 +947,50 @@ type metadataOutputService9TestShapeStructureShape struct {
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService10ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService10ProtocolTest client.
-func NewOutputService10ProtocolTest(config *aws.Config) *OutputService10ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice10protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService10ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService10ProtocolTest client from just a session.
+// svc := outputservice10protocoltest.New(mySession)
+//
+// // Create a OutputService10ProtocolTest client with additional configuration
+// svc := outputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService10ProtocolTest {
+ c := p.ClientConfig("outputservice10protocoltest", cfgs...)
+ return newOutputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService10ProtocolTest {
+ svc := &OutputService10ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice10protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService10ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService10ProtocolTest operation and runs any
@@ -832,29 +1043,50 @@ type metadataOutputService10TestShapeOutputService10TestCaseOperation1Output str
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService11ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService11ProtocolTest client.
-func NewOutputService11ProtocolTest(config *aws.Config) *OutputService11ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice11protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService11ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService11ProtocolTest client from just a session.
+// svc := outputservice11protocoltest.New(mySession)
+//
+// // Create a OutputService11ProtocolTest client with additional configuration
+// svc := outputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService11ProtocolTest {
+ c := p.ClientConfig("outputservice11protocoltest", cfgs...)
+ return newOutputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService11ProtocolTest {
+ svc := &OutputService11ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice11protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService11ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService11ProtocolTest operation and runs any
@@ -917,29 +1149,50 @@ type metadataOutputService11TestShapeStructType struct {
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService12ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService12ProtocolTest client.
-func NewOutputService12ProtocolTest(config *aws.Config) *OutputService12ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice12protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService12ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService12ProtocolTest client from just a session.
+// svc := outputservice12protocoltest.New(mySession)
+//
+// // Create a OutputService12ProtocolTest client with additional configuration
+// svc := outputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService12ProtocolTest {
+ c := p.ClientConfig("outputservice12protocoltest", cfgs...)
+ return newOutputService12ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService12ProtocolTest {
+ svc := &OutputService12ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice12protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService12ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService12ProtocolTest operation and runs any
@@ -992,29 +1245,50 @@ type metadataOutputService12TestShapeOutputService12TestCaseOperation1Output str
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService13ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService13ProtocolTest client.
-func NewOutputService13ProtocolTest(config *aws.Config) *OutputService13ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice13protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService13ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService13ProtocolTest client from just a session.
+// svc := outputservice13protocoltest.New(mySession)
+//
+// // Create a OutputService13ProtocolTest client with additional configuration
+// svc := outputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService13ProtocolTest {
+ c := p.ClientConfig("outputservice13protocoltest", cfgs...)
+ return newOutputService13ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService13ProtocolTest {
+ svc := &OutputService13ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice13protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService13ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService13ProtocolTest operation and runs any
@@ -1067,29 +1341,50 @@ type metadataOutputService13TestShapeOutputService13TestCaseOperation1Output str
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type OutputService14ProtocolTest struct {
- *service.Service
+ *client.Client
}
-// New returns a new OutputService14ProtocolTest client.
-func NewOutputService14ProtocolTest(config *aws.Config) *OutputService14ProtocolTest {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "outputservice14protocoltest",
- APIVersion: "",
- },
+// New creates a new instance of the OutputService14ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService14ProtocolTest client from just a session.
+// svc := outputservice14protocoltest.New(mySession)
+//
+// // Create a OutputService14ProtocolTest client with additional configuration
+// svc := outputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService14ProtocolTest {
+ c := p.ClientConfig("outputservice14protocoltest", cfgs...)
+ return newOutputService14ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService14ProtocolTest {
+ svc := &OutputService14ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice14protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- return &OutputService14ProtocolTest{service}
+ return svc
}
// newRequest creates a new request for a OutputService14ProtocolTest operation and runs any
@@ -1142,12 +1437,109 @@ type metadataOutputService14TestShapeOutputService14TestCaseOperation1Output str
SDKShapeTraits bool `type:"structure"`
}
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
+type OutputService15ProtocolTest struct {
+ *client.Client
+}
+
+// New creates a new instance of the OutputService15ProtocolTest client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a OutputService15ProtocolTest client from just a session.
+// svc := outputservice15protocoltest.New(mySession)
+//
+// // Create a OutputService15ProtocolTest client with additional configuration
+// svc := outputservice15protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func NewOutputService15ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService15ProtocolTest {
+ c := p.ClientConfig("outputservice15protocoltest", cfgs...)
+ return newOutputService15ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService15ProtocolTest {
+ svc := &OutputService15ProtocolTest{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: "outputservice15protocoltest",
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "",
+ },
+ handlers,
+ ),
+ }
+
+ // Handlers
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+
+ return svc
+}
+
+// newRequest creates a new request for a OutputService15ProtocolTest operation and runs any
+// custom request initialization.
+func (c *OutputService15ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request {
+ req := c.NewRequest(op, params, data)
+
+ return req
+}
+
+const opOutputService15TestCaseOperation1 = "OperationName"
+
+// OutputService15TestCaseOperation1Request generates a request for the OutputService15TestCaseOperation1 operation.
+func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1Request(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (req *request.Request, output *OutputService15TestShapeOutputService15TestCaseOperation1Output) {
+ op := &request.Operation{
+ Name: opOutputService15TestCaseOperation1,
+ }
+
+ if input == nil {
+ input = &OutputService15TestShapeOutputService15TestCaseOperation1Input{}
+ }
+
+ req = c.newRequest(op, input, output)
+ output = &OutputService15TestShapeOutputService15TestCaseOperation1Output{}
+ req.Data = output
+ return
+}
+
+func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (*OutputService15TestShapeOutputService15TestCaseOperation1Output, error) {
+ req, out := c.OutputService15TestCaseOperation1Request(input)
+ err := req.Send()
+ return out, err
+}
+
+type OutputService15TestShapeOutputService15TestCaseOperation1Input struct {
+ metadataOutputService15TestShapeOutputService15TestCaseOperation1Input `json:"-" xml:"-"`
+}
+
+type metadataOutputService15TestShapeOutputService15TestCaseOperation1Input struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
+type OutputService15TestShapeOutputService15TestCaseOperation1Output struct {
+ Foo *string `type:"string"`
+
+ metadataOutputService15TestShapeOutputService15TestCaseOperation1Output `json:"-" xml:"-"`
+}
+
+type metadataOutputService15TestShapeOutputService15TestCaseOperation1Output struct {
+ SDKShapeTraits bool `type:"structure"`
+}
+
//
// Tests begin here
//
func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
- svc := NewOutputService1ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200a2015-01-25T08:00:00Zrequest-id"))
req, out := svc.OutputService1TestCaseOperation1Request(nil)
@@ -1175,7 +1567,8 @@ func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) {
}
func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) {
- svc := NewOutputService2ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("mynamerequest-id"))
req, out := svc.OutputService2TestCaseOperation1Request(nil)
@@ -1195,7 +1588,8 @@ func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) {
}
func TestOutputService3ProtocolTestBlobCase1(t *testing.T) {
- svc := NewOutputService3ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("dmFsdWU=requestid"))
req, out := svc.OutputService3TestCaseOperation1Request(nil)
@@ -1215,7 +1609,8 @@ func TestOutputService3ProtocolTestBlobCase1(t *testing.T) {
}
func TestOutputService4ProtocolTestListsCase1(t *testing.T) {
- svc := NewOutputService4ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("abc123requestid"))
req, out := svc.OutputService4TestCaseOperation1Request(nil)
@@ -1236,7 +1631,8 @@ func TestOutputService4ProtocolTestListsCase1(t *testing.T) {
}
func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
- svc := NewOutputService5ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("- abc
- 123
requestid"))
req, out := svc.OutputService5TestCaseOperation1Request(nil)
@@ -1257,7 +1653,8 @@ func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) {
}
func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) {
- svc := NewOutputService6ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("abc123requestid"))
req, out := svc.OutputService6TestCaseOperation1Request(nil)
@@ -1278,7 +1675,8 @@ func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) {
}
func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T) {
- svc := NewOutputService7ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("abcrequestid"))
req, out := svc.OutputService7TestCaseOperation1Request(nil)
@@ -1298,7 +1696,8 @@ func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T)
}
func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) {
- svc := NewOutputService8ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbaz
requestid"))
req, out := svc.OutputService8TestCaseOperation1Request(nil)
@@ -1323,7 +1722,8 @@ func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) {
}
func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T) {
- svc := NewOutputService9ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("firstfoofirstbarfirstbaz
secondfoosecondbarsecondbaz
requestid"))
req, out := svc.OutputService9TestCaseOperation1Request(nil)
@@ -1348,7 +1748,8 @@ func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T)
}
func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) {
- svc := NewOutputService10ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("abrequestid"))
req, out := svc.OutputService10TestCaseOperation1Request(nil)
@@ -1369,7 +1770,8 @@ func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testin
}
func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) {
- svc := NewOutputService11ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("requestid"))
req, out := svc.OutputService11TestCaseOperation1Request(nil)
@@ -1390,7 +1792,8 @@ func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) {
}
func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) {
- svc := NewOutputService12ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("requestid"))
req, out := svc.OutputService12TestCaseOperation1Request(nil)
@@ -1411,7 +1814,8 @@ func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) {
}
func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testing.T) {
- svc := NewOutputService13ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("quxbarrequestid"))
req, out := svc.OutputService13TestCaseOperation1Request(nil)
@@ -1431,7 +1835,8 @@ func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testin
}
func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) {
- svc := NewOutputService14ProtocolTest(nil)
+ sess := session.New()
+ svc := NewOutputService14ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
buf := bytes.NewReader([]byte("requestid"))
req, out := svc.OutputService14TestCaseOperation1Request(nil)
@@ -1450,3 +1855,24 @@ func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) {
assert.Equal(t, "bar", *out.Map["qux"])
}
+
+func TestOutputService15ProtocolTestEmptyStringCase1(t *testing.T) {
+ sess := session.New()
+ svc := NewOutputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")})
+
+ buf := bytes.NewReader([]byte("requestid"))
+ req, out := svc.OutputService15TestCaseOperation1Request(nil)
+ req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}}
+
+ // set headers
+
+ // unmarshal response
+ query.UnmarshalMeta(req)
+ query.Unmarshal(req)
+ assert.NoError(t, req.Error)
+
+ // assert response
+ assert.NotNil(t, out) // ensure out variable is used
+ assert.Equal(t, "", *out.Foo)
+
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go
index e7e7bd521d2..51a26d6ade6 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go
@@ -5,16 +5,15 @@ import (
"testing"
"time"
+ "github.com/stretchr/testify/assert"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/awstesting/unit"
"github.com/aws/aws-sdk-go/service/s3"
- "github.com/stretchr/testify/assert"
)
-var _ = unit.Imported
-
func TestPresignHandler(t *testing.T) {
- svc := s3.New(nil)
+ svc := s3.New(unit.Session)
req, _ := svc.PutObjectRequest(&s3.PutObjectInput{
Bucket: aws.String("bucket"),
Key: aws.String("key"),
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go
index ac7adfc959d..dc176f312ba 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go
@@ -67,18 +67,18 @@ type signer struct {
func Sign(req *request.Request) {
// If the request does not need to be signed ignore the signing of the
// request if the AnonymousCredentials object is used.
- if req.Service.Config.Credentials == credentials.AnonymousCredentials {
+ if req.Config.Credentials == credentials.AnonymousCredentials {
return
}
- region := req.Service.SigningRegion
+ region := req.ClientInfo.SigningRegion
if region == "" {
- region = aws.StringValue(req.Service.Config.Region)
+ region = aws.StringValue(req.Config.Region)
}
- name := req.Service.SigningName
+ name := req.ClientInfo.SigningName
if name == "" {
- name = req.Service.ServiceName
+ name = req.ClientInfo.ServiceName
}
s := signer{
@@ -89,9 +89,9 @@ func Sign(req *request.Request) {
Body: req.Body,
ServiceName: name,
Region: region,
- Credentials: req.Service.Config.Credentials,
- Debug: req.Service.Config.LogLevel.Value(),
- Logger: req.Service.Config.Logger,
+ Credentials: req.Config.Credentials,
+ Debug: req.Config.LogLevel.Value(),
+ Logger: req.Config.Logger,
}
req.Error = s.sign()
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go
index 0ba9ff25f73..f39414fcf91 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go
@@ -6,11 +6,12 @@ import (
"testing"
"time"
+ "github.com/stretchr/testify/assert"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/stretchr/testify/assert"
+ "github.com/aws/aws-sdk-go/awstesting"
)
func buildSigner(serviceName string, region string, signTime time.Time, expireTime time.Duration, body string) signer {
@@ -118,7 +119,7 @@ func TestSignPrecomputedBodyChecksum(t *testing.T) {
}
func TestAnonymousCredentials(t *testing.T) {
- svc := service.New(&aws.Config{Credentials: credentials.AnonymousCredentials})
+ svc := awstesting.NewClient(&aws.Config{Credentials: credentials.AnonymousCredentials})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
@@ -142,7 +143,7 @@ func TestAnonymousCredentials(t *testing.T) {
}
func TestIgnoreResignRequestWithValidCreds(t *testing.T) {
- svc := service.New(&aws.Config{
+ svc := awstesting.NewClient(&aws.Config{
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
Region: aws.String("us-west-2"),
})
@@ -164,7 +165,7 @@ func TestIgnoreResignRequestWithValidCreds(t *testing.T) {
}
func TestIgnorePreResignRequestWithValidCreds(t *testing.T) {
- svc := service.New(&aws.Config{
+ svc := awstesting.NewClient(&aws.Config{
Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"),
Region: aws.String("us-west-2"),
})
@@ -188,7 +189,7 @@ func TestIgnorePreResignRequestWithValidCreds(t *testing.T) {
func TestResignRequestExpiredCreds(t *testing.T) {
creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION")
- svc := service.New(&aws.Config{Credentials: creds})
+ svc := awstesting.NewClient(&aws.Config{Credentials: creds})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
@@ -208,9 +209,13 @@ func TestResignRequestExpiredCreds(t *testing.T) {
}
func TestPreResignRequestExpiredCreds(t *testing.T) {
- provider := &credentials.StaticProvider{credentials.Value{"AKID", "SECRET", "SESSION"}}
+ provider := &credentials.StaticProvider{Value: credentials.Value{
+ AccessKeyID: "AKID",
+ SecretAccessKey: "SECRET",
+ SessionToken: "SESSION",
+ }}
creds := credentials.NewCredentials(provider)
- svc := service.New(&aws.Config{Credentials: creds})
+ svc := awstesting.NewClient(&aws.Config{Credentials: creds})
r := svc.NewRequest(
&request.Operation{
Name: "BatchGetItem",
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go
new file mode 100644
index 00000000000..335af91dc61
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go
@@ -0,0 +1,103 @@
+package waiter
+
+import (
+ "fmt"
+ "reflect"
+ "time"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/awsutil"
+ "github.com/aws/aws-sdk-go/aws/request"
+)
+
+// A Config provides a collection of configuration values to setup a generated
+// waiter code with.
+type Config struct {
+ Name string
+ Delay int
+ MaxAttempts int
+ Operation string
+ Acceptors []WaitAcceptor
+}
+
+// A WaitAcceptor provides the information needed to wait for an API operation
+// to complete.
+type WaitAcceptor struct {
+ Expected interface{}
+ Matcher string
+ State string
+ Argument string
+}
+
+// A Waiter provides waiting for an operation to complete.
+type Waiter struct {
+ Config
+ Client interface{}
+ Input interface{}
+}
+
+// Wait waits for an operation to complete, expire max attempts, or fail. Error
+// is returned if the operation fails.
+func (w *Waiter) Wait() error {
+ client := reflect.ValueOf(w.Client)
+ in := reflect.ValueOf(w.Input)
+ method := client.MethodByName(w.Config.Operation + "Request")
+
+ for i := 0; i < w.MaxAttempts; i++ {
+ res := method.Call([]reflect.Value{in})
+ req := res[0].Interface().(*request.Request)
+ req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter"))
+ if err := req.Send(); err != nil {
+ return err
+ }
+
+ for _, a := range w.Acceptors {
+ result := false
+ switch a.Matcher {
+ case "pathAll":
+ if vals, _ := awsutil.ValuesAtPath(req.Data, a.Argument); req.Error == nil && vals != nil {
+ result = true
+ for _, val := range vals {
+ if !awsutil.DeepEqual(val, a.Expected) {
+ result = false
+ break
+ }
+ }
+ }
+ case "pathAny":
+ if vals, _ := awsutil.ValuesAtPath(req.Data, a.Argument); req.Error == nil && vals != nil {
+ for _, val := range vals {
+ if awsutil.DeepEqual(val, a.Expected) {
+ result = true
+ break
+ }
+ }
+ }
+ case "status":
+ s := a.Expected.(int)
+ result = s == req.HTTPResponse.StatusCode
+ }
+
+ if result {
+ switch a.State {
+ case "success":
+ return nil // waiter completed
+ case "failure":
+ if req.Error == nil {
+ return awserr.New("ResourceNotReady",
+ fmt.Sprintf("failed waiting for successful resource state"), nil)
+ }
+ return req.Error // waiter failed
+ case "retry":
+ // do nothing, just retry
+ }
+ break
+ }
+ }
+
+ time.Sleep(time.Second * time.Duration(w.Delay))
+ }
+
+ return awserr.New("ResourceNotReady",
+ fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil)
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go
new file mode 100644
index 00000000000..58267295b11
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go
@@ -0,0 +1,183 @@
+package waiter_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/awstesting"
+ "github.com/aws/aws-sdk-go/private/waiter"
+)
+
+type mockClient struct {
+ *client.Client
+}
+type MockInput struct{}
+type MockOutput struct {
+ States []*MockState
+}
+type MockState struct {
+ State *string
+}
+
+func (c *mockClient) MockRequest(input *MockInput) (*request.Request, *MockOutput) {
+ op := &request.Operation{
+ Name: "Mock",
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &MockInput{}
+ }
+
+ output := &MockOutput{}
+ req := c.NewRequest(op, input, output)
+ req.Data = output
+ return req, output
+}
+
+var mockAcceptors = []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "States[].State",
+ Expected: "running",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "States[].State",
+ Expected: "stopping",
+ },
+}
+
+func TestWaiter(t *testing.T) {
+ svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
+ Region: aws.String("mock-region"),
+ })}
+ svc.Handlers.Send.Clear() // mock sending
+ svc.Handlers.Unmarshal.Clear()
+ svc.Handlers.UnmarshalMeta.Clear()
+ svc.Handlers.ValidateResponse.Clear()
+
+ reqNum := 0
+ resps := []*MockOutput{
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("pending")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("running")},
+ },
+ },
+ }
+
+ numBuiltReq := 0
+ svc.Handlers.Build.PushBack(func(r *request.Request) {
+ numBuiltReq++
+ })
+ svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
+ if reqNum >= len(resps) {
+ assert.Fail(t, "too many polling requests made")
+ return
+ }
+ r.Data = resps[reqNum]
+ reqNum++
+ })
+
+ waiterCfg := waiter.Config{
+ Operation: "Mock",
+ Delay: 0,
+ MaxAttempts: 10,
+ Acceptors: mockAcceptors,
+ }
+ w := waiter.Waiter{
+ Client: svc,
+ Input: &MockInput{},
+ Config: waiterCfg,
+ }
+
+ err := w.Wait()
+ assert.NoError(t, err)
+ assert.Equal(t, 3, numBuiltReq)
+ assert.Equal(t, 3, reqNum)
+}
+
+func TestWaiterFailure(t *testing.T) {
+ svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
+ Region: aws.String("mock-region"),
+ })}
+ svc.Handlers.Send.Clear() // mock sending
+ svc.Handlers.Unmarshal.Clear()
+ svc.Handlers.UnmarshalMeta.Clear()
+ svc.Handlers.ValidateResponse.Clear()
+
+ reqNum := 0
+ resps := []*MockOutput{
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("pending")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("stopping")},
+ },
+ },
+ }
+
+ numBuiltReq := 0
+ svc.Handlers.Build.PushBack(func(r *request.Request) {
+ numBuiltReq++
+ })
+ svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
+ if reqNum >= len(resps) {
+ assert.Fail(t, "too many polling requests made")
+ return
+ }
+ r.Data = resps[reqNum]
+ reqNum++
+ })
+
+ waiterCfg := waiter.Config{
+ Operation: "Mock",
+ Delay: 0,
+ MaxAttempts: 10,
+ Acceptors: mockAcceptors,
+ }
+ w := waiter.Waiter{
+ Client: svc,
+ Input: &MockInput{},
+ Config: waiterCfg,
+ }
+
+ err := w.Wait().(awserr.Error)
+ assert.Error(t, err)
+ assert.Equal(t, "ResourceNotReady", err.Code())
+ assert.Equal(t, "failed waiting for successful resource state", err.Message())
+ assert.Equal(t, 3, numBuiltReq)
+ assert.Equal(t, 3, reqNum)
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
index 94df50a7c96..2099e40491d 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
@@ -74,6 +74,7 @@ func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*De
func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(p *DescribeAlarmHistoryOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeAlarmHistoryRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeAlarmHistoryOutput), lastPage)
})
@@ -116,6 +117,7 @@ func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarms
func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(p *DescribeAlarmsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeAlarmsRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeAlarmsOutput), lastPage)
})
@@ -293,6 +295,7 @@ func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, e
func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(p *ListMetricsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.ListMetricsRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*ListMetricsOutput), lastPage)
})
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
index d73332aa0c0..140dc9e9832 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
@@ -60,3 +60,5 @@ type CloudWatchAPI interface {
SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error)
}
+
+var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface_test.go
deleted file mode 100644
index cdc377249db..00000000000
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface_test.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
-
-package cloudwatchiface_test
-
-import (
- "testing"
-
- "github.com/aws/aws-sdk-go/service/cloudwatch"
- "github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface"
- "github.com/stretchr/testify/assert"
-)
-
-func TestInterface(t *testing.T) {
- assert.Implements(t, (*cloudwatchiface.CloudWatchAPI)(nil), cloudwatch.New(nil))
-}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go
index fbfc3f516df..07b010852b9 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go
@@ -8,6 +8,7 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
)
@@ -15,7 +16,7 @@ var _ time.Duration
var _ bytes.Buffer
func ExampleCloudWatch_DeleteAlarms() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.DeleteAlarmsInput{
AlarmNames: []*string{ // Required
@@ -37,7 +38,7 @@ func ExampleCloudWatch_DeleteAlarms() {
}
func ExampleCloudWatch_DescribeAlarmHistory() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.DescribeAlarmHistoryInput{
AlarmName: aws.String("AlarmName"),
@@ -61,7 +62,7 @@ func ExampleCloudWatch_DescribeAlarmHistory() {
}
func ExampleCloudWatch_DescribeAlarms() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.DescribeAlarmsInput{
ActionPrefix: aws.String("ActionPrefix"),
@@ -88,7 +89,7 @@ func ExampleCloudWatch_DescribeAlarms() {
}
func ExampleCloudWatch_DescribeAlarmsForMetric() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.DescribeAlarmsForMetricInput{
MetricName: aws.String("MetricName"), // Required
@@ -118,7 +119,7 @@ func ExampleCloudWatch_DescribeAlarmsForMetric() {
}
func ExampleCloudWatch_DisableAlarmActions() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.DisableAlarmActionsInput{
AlarmNames: []*string{ // Required
@@ -140,7 +141,7 @@ func ExampleCloudWatch_DisableAlarmActions() {
}
func ExampleCloudWatch_EnableAlarmActions() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.EnableAlarmActionsInput{
AlarmNames: []*string{ // Required
@@ -162,7 +163,7 @@ func ExampleCloudWatch_EnableAlarmActions() {
}
func ExampleCloudWatch_GetMetricStatistics() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.GetMetricStatisticsInput{
EndTime: aws.Time(time.Now()), // Required
@@ -197,7 +198,7 @@ func ExampleCloudWatch_GetMetricStatistics() {
}
func ExampleCloudWatch_ListMetrics() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.ListMetricsInput{
Dimensions: []*cloudwatch.DimensionFilter{
@@ -225,7 +226,7 @@ func ExampleCloudWatch_ListMetrics() {
}
func ExampleCloudWatch_PutMetricAlarm() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.PutMetricAlarmInput{
AlarmName: aws.String("AlarmName"), // Required
@@ -273,7 +274,7 @@ func ExampleCloudWatch_PutMetricAlarm() {
}
func ExampleCloudWatch_PutMetricData() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.PutMetricDataInput{
MetricData: []*cloudwatch.MetricDatum{ // Required
@@ -314,7 +315,7 @@ func ExampleCloudWatch_PutMetricData() {
}
func ExampleCloudWatch_SetAlarmState() {
- svc := cloudwatch.New(nil)
+ svc := cloudwatch.New(session.New())
params := &cloudwatch.SetAlarmStateInput{
AlarmName: aws.String("AlarmName"), // Required
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
index 17a6f3f7524..e6f85068460 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
@@ -4,10 +4,9 @@ package cloudwatch
import (
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
"github.com/aws/aws-sdk-go/private/protocol/query"
"github.com/aws/aws-sdk-go/private/signer/v4"
)
@@ -52,40 +51,64 @@ import (
// Center (http://aws.amazon.com/php/) AWS Python Developer Center (http://aws.amazon.com/python/)
// AWS Ruby Developer Center (http://aws.amazon.com/ruby/) AWS Windows and .NET
// Developer Center (http://aws.amazon.com/net/)
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type CloudWatch struct {
- *service.Service
+ *client.Client
}
-// Used for custom service initialization logic
-var initService func(*service.Service)
+// Used for custom client initialization logic
+var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
-// New returns a new CloudWatch client.
-func New(config *aws.Config) *CloudWatch {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "monitoring",
- APIVersion: "2010-08-01",
- },
+// A ServiceName is the name of the service the client will make API calls to.
+const ServiceName = "monitoring"
+
+// New creates a new instance of the CloudWatch client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a CloudWatch client from just a session.
+// svc := cloudwatch.New(mySession)
+//
+// // Create a CloudWatch client with additional configuration
+// svc := cloudwatch.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatch {
+ c := p.ClientConfig(ServiceName, cfgs...)
+ return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *CloudWatch {
+ svc := &CloudWatch{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: ServiceName,
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2010-08-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(query.Build)
- service.Handlers.Unmarshal.PushBack(query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(query.Build)
+ svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
- // Run custom service initialization if present
- if initService != nil {
- initService(service)
+ // Run custom client initialization if present
+ if initClient != nil {
+ initClient(svc.Client)
}
- return &CloudWatch{service}
+ return svc
}
// newRequest creates a new request for a CloudWatch operation and runs any
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go
index b4c238a5fb0..337392a86f2 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go
@@ -871,7 +871,7 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r
// gateway is the appliance at your end of the VPN connection. (The device on
// the AWS side of the VPN connection is the virtual private gateway.) You must
// provide the Internet-routable IP address of the customer gateway's external
-// interface. The IP address must be static and can't be behind a device performing
+// interface. The IP address must be static and may be behind a device performing
// network address translation (NAT).
//
// For devices that use Border Gateway Protocol (BGP), you can also provide
@@ -1598,6 +1598,9 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, o
// of a key and optional value. Tag keys must be unique per resource.
//
// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
+// in the Amazon Elastic Compute Cloud User Guide. For more information about
+// creating IAM policies that control users' access to resources based on tags,
+// see Supported Resource-Level Permissions for Amazon EC2 API Actions (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html)
// in the Amazon Elastic Compute Cloud User Guide.
func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) {
req, out := c.CreateTagsRequest(input)
@@ -3100,6 +3103,7 @@ func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*Descr
func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(p *DescribeInstanceStatusOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeInstanceStatusRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeInstanceStatusOutput), lastPage)
})
@@ -3149,6 +3153,7 @@ func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstanc
func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(p *DescribeInstancesOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeInstancesRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeInstancesOutput), lastPage)
})
@@ -3534,6 +3539,7 @@ func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInst
func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(p *DescribeReservedInstancesModificationsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeReservedInstancesModificationsRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeReservedInstancesModificationsOutput), lastPage)
})
@@ -3581,6 +3587,7 @@ func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstance
func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(p *DescribeReservedInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeReservedInstancesOfferingsRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeReservedInstancesOfferingsOutput), lastPage)
})
@@ -3697,7 +3704,7 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
- LimitToken: "",
+ LimitToken: "MaxResults",
TruncationToken: "",
},
}
@@ -3760,6 +3767,7 @@ func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapsho
func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeSnapshotsRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeSnapshotsOutput), lastPage)
})
@@ -3961,6 +3969,7 @@ func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*D
func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(p *DescribeSpotPriceHistoryOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeSpotPriceHistoryRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeSpotPriceHistoryOutput), lastPage)
})
@@ -4004,6 +4013,12 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques
Name: opDescribeTags,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -4026,6 +4041,14 @@ func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error
return out, err
}
+func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(p *DescribeTagsOutput, lastPage bool) (shouldContinue bool)) error {
+ page, _ := c.DescribeTagsRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
+ return page.EachPage(func(p interface{}, lastPage bool) bool {
+ return fn(p.(*DescribeTagsOutput), lastPage)
+ })
+}
+
const opDescribeVolumeAttribute = "DescribeVolumeAttribute"
// DescribeVolumeAttributeRequest generates a request for the DescribeVolumeAttribute operation.
@@ -4126,6 +4149,7 @@ func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeV
func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(p *DescribeVolumeStatusOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeVolumeStatusRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeVolumeStatusOutput), lastPage)
})
@@ -4176,6 +4200,7 @@ func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutp
func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(p *DescribeVolumesOutput, lastPage bool) (shouldContinue bool)) error {
page, _ := c.DescribeVolumesRequest(input)
+ page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
return page.EachPage(func(p interface{}, lastPage bool) bool {
return fn(p.(*DescribeVolumesOutput), lastPage)
})
@@ -9206,7 +9231,8 @@ func (s CreateSpotDatafeedSubscriptionOutput) GoString() string {
type CreateSubnetInput struct {
// The Availability Zone for the subnet.
//
- // Default: Amazon EC2 selects one for you (recommended).
+ // Default: AWS selects one for you. If you create more than one subnet in
+ // your VPC, we may not necessarily select a different zone for each subnet.
AvailabilityZone *string `type:"string"`
// The network range for the subnet, in CIDR notation. For example, 10.0.0.0/24.
@@ -12262,7 +12288,7 @@ type DescribeInstancesInput struct {
//
// network-interface.vpc-id - The ID of the VPC for the network interface.
//
- // network-interface.network-interface.id - The ID of the network interface.
+ // network-interface.network-interface-id - The ID of the network interface.
//
// network-interface.owner-id - The ID of the owner of the network interface.
//
@@ -14153,7 +14179,7 @@ type DescribeSpotInstanceRequestsInput struct {
//
// launch.image-id - The ID of the AMI.
//
- // launch.instance-type - The type of instance (for example, m1.small).
+ // launch.instance-type - The type of instance (for example, m3.medium).
//
// launch.kernel-id - The kernel ID.
//
@@ -14291,7 +14317,7 @@ type DescribeSpotPriceHistoryInput struct {
//
// availability-zone - The Availability Zone for which prices should be returned.
//
- // instance-type - The type of instance (for example, m1.small).
+ // instance-type - The type of instance (for example, m3.medium).
//
// product-description - The product description for the Spot price (Linux/UNIX
// | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC)
@@ -17491,7 +17517,7 @@ type Instance struct {
// Any block device mapping entries for the instance.
BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"`
- // The idempotency token you provided when you launched the instance.
+ // The idempotency token you provided when you launched the instance, if applicable.
ClientToken *string `locationName:"clientToken" type:"string"`
// Indicates whether the instance is optimized for EBS I/O. This optimization
@@ -17504,7 +17530,7 @@ type Instance struct {
// The hypervisor type of the instance.
Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"`
- // The IAM instance profile associated with the instance.
+ // The IAM instance profile associated with the instance, if applicable.
IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"`
// The ID of the AMI used to launch the instance.
@@ -17519,7 +17545,7 @@ type Instance struct {
// The instance type.
InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
- // The kernel associated with this instance.
+ // The kernel associated with this instance, if applicable.
KernelId *string `locationName:"kernelId" type:"string"`
// The name of the key pair, if this instance was launched with an associated
@@ -17535,7 +17561,7 @@ type Instance struct {
// [EC2-VPC] One or more network interfaces for the instance.
NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"`
- // The location where the instance launched.
+ // The location where the instance launched, if applicable.
Placement *Placement `locationName:"placement" type:"structure"`
// The value is Windows for Windows instances; otherwise blank.
@@ -17543,23 +17569,25 @@ type Instance struct {
// The private DNS name assigned to the instance. This DNS name can only be
// used inside the Amazon EC2 network. This name is not available until the
- // instance enters the running state.
+ // instance enters the running state. For EC2-VPC, this name is only available
+ // if you've enabled DNS hostnames for your VPC.
PrivateDnsName *string `locationName:"privateDnsName" type:"string"`
// The private IP address assigned to the instance.
PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"`
- // The product codes attached to this instance.
+ // The product codes attached to this instance, if applicable.
ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"`
// The public DNS name assigned to the instance. This name is not available
- // until the instance enters the running state.
+ // until the instance enters the running state. For EC2-VPC, this name is only
+ // available if you've enabled DNS hostnames for your VPC.
PublicDnsName *string `locationName:"dnsName" type:"string"`
- // The public IP address assigned to the instance.
+ // The public IP address assigned to the instance, if applicable.
PublicIpAddress *string `locationName:"ipAddress" type:"string"`
- // The RAM disk associated with this instance.
+ // The RAM disk associated with this instance, if applicable.
RamdiskId *string `locationName:"ramdiskId" type:"string"`
// The root device name (for example, /dev/sda1 or /dev/xvda).
@@ -17580,7 +17608,7 @@ type Instance struct {
// in the Amazon Virtual Private Cloud User Guide.
SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"`
- // The ID of the Spot Instance request.
+ // If the request is a Spot instance request, the ID of the request.
SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"`
// Specifies whether enhanced networking is enabled.
@@ -17595,7 +17623,7 @@ type Instance struct {
// The reason for the most recent state transition. This might be an empty string.
StateTransitionReason *string `locationName:"reason" type:"string"`
- // The ID of the subnet in which the instance is running.
+ // [EC2-VPC] The ID of the subnet in which the instance is running.
SubnetId *string `locationName:"subnetId" type:"string"`
// Any tags assigned to the instance.
@@ -17604,7 +17632,7 @@ type Instance struct {
// The virtualization type of the instance.
VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"`
- // The ID of the VPC in which the instance is running.
+ // [EC2-VPC] The ID of the VPC in which the instance is running.
VpcId *string `locationName:"vpcId" type:"string"`
metadataInstance `json:"-" xml:"-"`
@@ -18960,7 +18988,9 @@ type ModifyVpcAttributeInput struct {
// Indicates whether the instances launched in the VPC get DNS hostnames. If
// enabled, instances in the VPC get DNS hostnames; otherwise, they do not.
//
- // You can only enable DNS hostnames if you also enable DNS support.
+ // You cannot modify the DNS resolution and DNS hostnames attributes in the
+ // same request. Use separate requests for each attribute. You can only enable
+ // DNS hostnames if you've enabled DNS support.
EnableDnsHostnames *AttributeBooleanValue `type:"structure"`
// Indicates whether the DNS resolution is supported for the VPC. If enabled,
@@ -18968,6 +18998,9 @@ type ModifyVpcAttributeInput struct {
// or the reserved IP address at the base of the VPC network range "plus two"
// will succeed. If disabled, the Amazon provided DNS service in the VPC that
// resolves public DNS hostnames to IP addresses is not enabled.
+ //
+ // You cannot modify the DNS resolution and DNS hostnames attributes in the
+ // same request. Use separate requests for each attribute.
EnableDnsSupport *AttributeBooleanValue `type:"structure"`
// The ID of the VPC.
@@ -20589,7 +20622,7 @@ type RequestSpotInstancesInput struct {
// the instance a two-minute warning before it terminates.
//
// Note that you can't specify an Availability Zone group or a launch group
- // if you specify a required duration.
+ // if you specify a duration.
BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
@@ -22348,8 +22381,8 @@ func (s SpotFleetRequestConfigData) GoString() string {
// Describes a Spot instance request.
type SpotInstanceRequest struct {
- // If you specified a required duration and your request was fulfilled, this
- // is the fixed hourly price in effect for the Spot instance while it runs.
+ // If you specified a duration and your Spot instance request was fulfilled,
+ // this is the fixed hourly price in effect for the Spot instance while it runs.
ActualBlockHourlyPrice *string `locationName:"actualBlockHourlyPrice" type:"string"`
// The Availability Zone group. If you specify the same Availability Zone group
@@ -22357,7 +22390,7 @@ type SpotInstanceRequest struct {
// Availability Zone.
AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"`
- // The required duration for the Spot instance, in minutes.
+ // The duration for the Spot instance, in minutes.
BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"`
// The date and time when the Spot instance request was created, in UTC format
@@ -22460,7 +22493,8 @@ func (s SpotInstanceStateFault) GoString() string {
// Describes the status of a Spot instance request.
type SpotInstanceStatus struct {
- // The status code.
+ // The status code. For a list of status codes, see Spot Bid Status Codes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand)
+ // in the Amazon Elastic Compute Cloud User Guide.
Code *string `locationName:"code" type:"string"`
// The description for the status code.
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go
index 99f0820477e..9e94fe671ce 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go
@@ -3,8 +3,10 @@ package ec2
import (
"time"
+ "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/endpoints"
)
func init() {
@@ -20,38 +22,34 @@ func fillPresignedURL(r *request.Request) {
return
}
- params := r.Params.(*CopySnapshotInput)
+ origParams := r.Params.(*CopySnapshotInput)
// Stop if PresignedURL/DestinationRegion is set
- if params.PresignedUrl != nil || params.DestinationRegion != nil {
+ if origParams.PresignedUrl != nil || origParams.DestinationRegion != nil {
return
}
- // First generate a copy of parameters
- r.Params = awsutil.CopyOf(r.Params)
- params = r.Params.(*CopySnapshotInput)
+ origParams.DestinationRegion = r.Config.Region
+ newParams := awsutil.CopyOf(r.Params).(*CopySnapshotInput)
- // Set destination region. Avoids infinite handler loop.
- // Also needed to sign sub-request.
- params.DestinationRegion = r.Service.Config.Region
-
- // Create a new client pointing at source region.
- // We will use this to presign the CopySnapshot request against
- // the source region
- config := r.Service.Config.Copy().
+ // Create a new request based on the existing request. We will use this to
+ // presign the CopySnapshot request against the source region.
+ cfg := r.Config.Copy(aws.NewConfig().
WithEndpoint("").
- WithRegion(*params.SourceRegion)
+ WithRegion(aws.StringValue(origParams.SourceRegion)))
- client := New(config)
+ clientInfo := r.ClientInfo
+ clientInfo.Endpoint, clientInfo.SigningRegion = endpoints.EndpointForRegion(
+ clientInfo.ServiceName, aws.StringValue(cfg.Region), aws.BoolValue(cfg.DisableSSL))
// Presign a CopySnapshot request with modified params
- req, _ := client.CopySnapshotRequest(params)
- url, err := req.Presign(300 * time.Second) // 5 minutes should be enough.
-
- if err != nil { // bubble error back up to original request
+ req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data)
+ url, err := req.Presign(5 * time.Minute) // 5 minutes should be enough.
+ if err != nil { // bubble error back up to original request
r.Error = err
+ return
}
// We have our URL, set it on params
- params.PresignedUrl = &url
+ origParams.PresignedUrl = &url
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go
index 0fbd49b9a2c..195d9b55b8d 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go
@@ -11,10 +11,8 @@ import (
"github.com/stretchr/testify/assert"
)
-var _ = unit.Imported
-
func TestCopySnapshotPresignedURL(t *testing.T) {
- svc := ec2.New(&aws.Config{Region: aws.String("us-west-2")})
+ svc := ec2.New(unit.Session, &aws.Config{Region: aws.String("us-west-2")})
assert.NotPanics(t, func() {
// Doesn't panic on nil input
@@ -30,7 +28,8 @@ func TestCopySnapshotPresignedURL(t *testing.T) {
b, _ := ioutil.ReadAll(req.HTTPRequest.Body)
q, _ := url.ParseQuery(string(b))
- url, _ := url.QueryUnescape(q.Get("PresignedUrl"))
+ u, _ := url.QueryUnescape(q.Get("PresignedUrl"))
assert.Equal(t, "us-west-2", q.Get("DestinationRegion"))
- assert.Regexp(t, `^https://ec2\.us-west-1\.amazon.+&DestinationRegion=us-west-2`, url)
+ assert.Equal(t, "us-west-1", q.Get("SourceRegion"))
+ assert.Regexp(t, `^https://ec2\.us-west-1\.amazonaws\.com/.+&DestinationRegion=us-west-2`, u)
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
index 88a209d1608..5bcf93248ae 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
@@ -486,6 +486,8 @@ type EC2API interface {
DescribeTags(*ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error)
+ DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error
+
DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput)
DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error)
@@ -758,3 +760,5 @@ type EC2API interface {
UnmonitorInstances(*ec2.UnmonitorInstancesInput) (*ec2.UnmonitorInstancesOutput, error)
}
+
+var _ EC2API = (*ec2.EC2)(nil)
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go
deleted file mode 100644
index 3941d260db0..00000000000
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
-
-package ec2iface_test
-
-import (
- "testing"
-
- "github.com/aws/aws-sdk-go/service/ec2"
- "github.com/aws/aws-sdk-go/service/ec2/ec2iface"
- "github.com/stretchr/testify/assert"
-)
-
-func TestInterface(t *testing.T) {
- assert.Implements(t, (*ec2iface.EC2API)(nil), ec2.New(nil))
-}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go
index 3a827ef3f23..86557fc15d0 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go
@@ -8,6 +8,7 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
)
@@ -15,7 +16,7 @@ var _ time.Duration
var _ bytes.Buffer
func ExampleEC2_AcceptVpcPeeringConnection() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AcceptVpcPeeringConnectionInput{
DryRun: aws.Bool(true),
@@ -35,7 +36,7 @@ func ExampleEC2_AcceptVpcPeeringConnection() {
}
func ExampleEC2_AllocateAddress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AllocateAddressInput{
Domain: aws.String("DomainType"),
@@ -55,7 +56,7 @@ func ExampleEC2_AllocateAddress() {
}
func ExampleEC2_AssignPrivateIpAddresses() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AssignPrivateIpAddressesInput{
NetworkInterfaceId: aws.String("String"), // Required
@@ -80,7 +81,7 @@ func ExampleEC2_AssignPrivateIpAddresses() {
}
func ExampleEC2_AssociateAddress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AssociateAddressInput{
AllocationId: aws.String("String"),
@@ -105,7 +106,7 @@ func ExampleEC2_AssociateAddress() {
}
func ExampleEC2_AssociateDhcpOptions() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AssociateDhcpOptionsInput{
DhcpOptionsId: aws.String("String"), // Required
@@ -126,7 +127,7 @@ func ExampleEC2_AssociateDhcpOptions() {
}
func ExampleEC2_AssociateRouteTable() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AssociateRouteTableInput{
RouteTableId: aws.String("String"), // Required
@@ -147,7 +148,7 @@ func ExampleEC2_AssociateRouteTable() {
}
func ExampleEC2_AttachClassicLinkVpc() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AttachClassicLinkVpcInput{
Groups: []*string{ // Required
@@ -172,7 +173,7 @@ func ExampleEC2_AttachClassicLinkVpc() {
}
func ExampleEC2_AttachInternetGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AttachInternetGatewayInput{
InternetGatewayId: aws.String("String"), // Required
@@ -193,7 +194,7 @@ func ExampleEC2_AttachInternetGateway() {
}
func ExampleEC2_AttachNetworkInterface() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AttachNetworkInterfaceInput{
DeviceIndex: aws.Int64(1), // Required
@@ -215,7 +216,7 @@ func ExampleEC2_AttachNetworkInterface() {
}
func ExampleEC2_AttachVolume() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AttachVolumeInput{
Device: aws.String("String"), // Required
@@ -237,7 +238,7 @@ func ExampleEC2_AttachVolume() {
}
func ExampleEC2_AttachVpnGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AttachVpnGatewayInput{
VpcId: aws.String("String"), // Required
@@ -258,7 +259,7 @@ func ExampleEC2_AttachVpnGateway() {
}
func ExampleEC2_AuthorizeSecurityGroupEgress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AuthorizeSecurityGroupEgressInput{
GroupId: aws.String("String"), // Required
@@ -312,7 +313,7 @@ func ExampleEC2_AuthorizeSecurityGroupEgress() {
}
func ExampleEC2_AuthorizeSecurityGroupIngress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.AuthorizeSecurityGroupIngressInput{
CidrIp: aws.String("String"),
@@ -367,7 +368,7 @@ func ExampleEC2_AuthorizeSecurityGroupIngress() {
}
func ExampleEC2_BundleInstance() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.BundleInstanceInput{
InstanceId: aws.String("String"), // Required
@@ -396,7 +397,7 @@ func ExampleEC2_BundleInstance() {
}
func ExampleEC2_CancelBundleTask() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelBundleTaskInput{
BundleId: aws.String("String"), // Required
@@ -416,7 +417,7 @@ func ExampleEC2_CancelBundleTask() {
}
func ExampleEC2_CancelConversionTask() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelConversionTaskInput{
ConversionTaskId: aws.String("String"), // Required
@@ -437,7 +438,7 @@ func ExampleEC2_CancelConversionTask() {
}
func ExampleEC2_CancelExportTask() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelExportTaskInput{
ExportTaskId: aws.String("String"), // Required
@@ -456,7 +457,7 @@ func ExampleEC2_CancelExportTask() {
}
func ExampleEC2_CancelImportTask() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelImportTaskInput{
CancelReason: aws.String("String"),
@@ -477,7 +478,7 @@ func ExampleEC2_CancelImportTask() {
}
func ExampleEC2_CancelReservedInstancesListing() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelReservedInstancesListingInput{
ReservedInstancesListingId: aws.String("String"), // Required
@@ -496,7 +497,7 @@ func ExampleEC2_CancelReservedInstancesListing() {
}
func ExampleEC2_CancelSpotFleetRequests() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelSpotFleetRequestsInput{
SpotFleetRequestIds: []*string{ // Required
@@ -520,7 +521,7 @@ func ExampleEC2_CancelSpotFleetRequests() {
}
func ExampleEC2_CancelSpotInstanceRequests() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CancelSpotInstanceRequestsInput{
SpotInstanceRequestIds: []*string{ // Required
@@ -543,7 +544,7 @@ func ExampleEC2_CancelSpotInstanceRequests() {
}
func ExampleEC2_ConfirmProductInstance() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ConfirmProductInstanceInput{
InstanceId: aws.String("String"), // Required
@@ -564,7 +565,7 @@ func ExampleEC2_ConfirmProductInstance() {
}
func ExampleEC2_CopyImage() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CopyImageInput{
Name: aws.String("String"), // Required
@@ -588,7 +589,7 @@ func ExampleEC2_CopyImage() {
}
func ExampleEC2_CopySnapshot() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CopySnapshotInput{
SourceRegion: aws.String("String"), // Required
@@ -614,7 +615,7 @@ func ExampleEC2_CopySnapshot() {
}
func ExampleEC2_CreateCustomerGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateCustomerGatewayInput{
BgpAsn: aws.Int64(1), // Required
@@ -636,7 +637,7 @@ func ExampleEC2_CreateCustomerGateway() {
}
func ExampleEC2_CreateDhcpOptions() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateDhcpOptionsInput{
DhcpConfigurations: []*ec2.NewDhcpConfiguration{ // Required
@@ -665,7 +666,7 @@ func ExampleEC2_CreateDhcpOptions() {
}
func ExampleEC2_CreateFlowLogs() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateFlowLogsInput{
DeliverLogsPermissionArn: aws.String("String"), // Required
@@ -692,7 +693,7 @@ func ExampleEC2_CreateFlowLogs() {
}
func ExampleEC2_CreateImage() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateImageInput{
InstanceId: aws.String("String"), // Required
@@ -731,7 +732,7 @@ func ExampleEC2_CreateImage() {
}
func ExampleEC2_CreateInstanceExportTask() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateInstanceExportTaskInput{
InstanceId: aws.String("String"), // Required
@@ -758,7 +759,7 @@ func ExampleEC2_CreateInstanceExportTask() {
}
func ExampleEC2_CreateInternetGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateInternetGatewayInput{
DryRun: aws.Bool(true),
@@ -777,7 +778,7 @@ func ExampleEC2_CreateInternetGateway() {
}
func ExampleEC2_CreateKeyPair() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateKeyPairInput{
KeyName: aws.String("String"), // Required
@@ -797,7 +798,7 @@ func ExampleEC2_CreateKeyPair() {
}
func ExampleEC2_CreateNetworkAcl() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateNetworkAclInput{
VpcId: aws.String("String"), // Required
@@ -817,7 +818,7 @@ func ExampleEC2_CreateNetworkAcl() {
}
func ExampleEC2_CreateNetworkAclEntry() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateNetworkAclEntryInput{
CidrBlock: aws.String("String"), // Required
@@ -850,7 +851,7 @@ func ExampleEC2_CreateNetworkAclEntry() {
}
func ExampleEC2_CreateNetworkInterface() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateNetworkInterfaceInput{
SubnetId: aws.String("String"), // Required
@@ -884,7 +885,7 @@ func ExampleEC2_CreateNetworkInterface() {
}
func ExampleEC2_CreatePlacementGroup() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreatePlacementGroupInput{
GroupName: aws.String("String"), // Required
@@ -905,7 +906,7 @@ func ExampleEC2_CreatePlacementGroup() {
}
func ExampleEC2_CreateReservedInstancesListing() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateReservedInstancesListingInput{
ClientToken: aws.String("String"), // Required
@@ -934,7 +935,7 @@ func ExampleEC2_CreateReservedInstancesListing() {
}
func ExampleEC2_CreateRoute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateRouteInput{
DestinationCidrBlock: aws.String("String"), // Required
@@ -959,7 +960,7 @@ func ExampleEC2_CreateRoute() {
}
func ExampleEC2_CreateRouteTable() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateRouteTableInput{
VpcId: aws.String("String"), // Required
@@ -979,7 +980,7 @@ func ExampleEC2_CreateRouteTable() {
}
func ExampleEC2_CreateSecurityGroup() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateSecurityGroupInput{
Description: aws.String("String"), // Required
@@ -1001,7 +1002,7 @@ func ExampleEC2_CreateSecurityGroup() {
}
func ExampleEC2_CreateSnapshot() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateSnapshotInput{
VolumeId: aws.String("String"), // Required
@@ -1022,7 +1023,7 @@ func ExampleEC2_CreateSnapshot() {
}
func ExampleEC2_CreateSpotDatafeedSubscription() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateSpotDatafeedSubscriptionInput{
Bucket: aws.String("String"), // Required
@@ -1043,7 +1044,7 @@ func ExampleEC2_CreateSpotDatafeedSubscription() {
}
func ExampleEC2_CreateSubnet() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateSubnetInput{
CidrBlock: aws.String("String"), // Required
@@ -1065,7 +1066,7 @@ func ExampleEC2_CreateSubnet() {
}
func ExampleEC2_CreateTags() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateTagsInput{
Resources: []*string{ // Required
@@ -1095,7 +1096,7 @@ func ExampleEC2_CreateTags() {
}
func ExampleEC2_CreateVolume() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVolumeInput{
AvailabilityZone: aws.String("String"), // Required
@@ -1121,7 +1122,7 @@ func ExampleEC2_CreateVolume() {
}
func ExampleEC2_CreateVpc() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVpcInput{
CidrBlock: aws.String("String"), // Required
@@ -1142,7 +1143,7 @@ func ExampleEC2_CreateVpc() {
}
func ExampleEC2_CreateVpcEndpoint() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVpcEndpointInput{
ServiceName: aws.String("String"), // Required
@@ -1169,7 +1170,7 @@ func ExampleEC2_CreateVpcEndpoint() {
}
func ExampleEC2_CreateVpcPeeringConnection() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVpcPeeringConnectionInput{
DryRun: aws.Bool(true),
@@ -1191,7 +1192,7 @@ func ExampleEC2_CreateVpcPeeringConnection() {
}
func ExampleEC2_CreateVpnConnection() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVpnConnectionInput{
CustomerGatewayId: aws.String("String"), // Required
@@ -1216,7 +1217,7 @@ func ExampleEC2_CreateVpnConnection() {
}
func ExampleEC2_CreateVpnConnectionRoute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVpnConnectionRouteInput{
DestinationCidrBlock: aws.String("String"), // Required
@@ -1236,7 +1237,7 @@ func ExampleEC2_CreateVpnConnectionRoute() {
}
func ExampleEC2_CreateVpnGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.CreateVpnGatewayInput{
Type: aws.String("GatewayType"), // Required
@@ -1257,7 +1258,7 @@ func ExampleEC2_CreateVpnGateway() {
}
func ExampleEC2_DeleteCustomerGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteCustomerGatewayInput{
CustomerGatewayId: aws.String("String"), // Required
@@ -1277,7 +1278,7 @@ func ExampleEC2_DeleteCustomerGateway() {
}
func ExampleEC2_DeleteDhcpOptions() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteDhcpOptionsInput{
DhcpOptionsId: aws.String("String"), // Required
@@ -1297,7 +1298,7 @@ func ExampleEC2_DeleteDhcpOptions() {
}
func ExampleEC2_DeleteFlowLogs() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteFlowLogsInput{
FlowLogIds: []*string{ // Required
@@ -1319,7 +1320,7 @@ func ExampleEC2_DeleteFlowLogs() {
}
func ExampleEC2_DeleteInternetGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteInternetGatewayInput{
InternetGatewayId: aws.String("String"), // Required
@@ -1339,7 +1340,7 @@ func ExampleEC2_DeleteInternetGateway() {
}
func ExampleEC2_DeleteKeyPair() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteKeyPairInput{
KeyName: aws.String("String"), // Required
@@ -1359,7 +1360,7 @@ func ExampleEC2_DeleteKeyPair() {
}
func ExampleEC2_DeleteNetworkAcl() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteNetworkAclInput{
NetworkAclId: aws.String("String"), // Required
@@ -1379,7 +1380,7 @@ func ExampleEC2_DeleteNetworkAcl() {
}
func ExampleEC2_DeleteNetworkAclEntry() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteNetworkAclEntryInput{
Egress: aws.Bool(true), // Required
@@ -1401,7 +1402,7 @@ func ExampleEC2_DeleteNetworkAclEntry() {
}
func ExampleEC2_DeleteNetworkInterface() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteNetworkInterfaceInput{
NetworkInterfaceId: aws.String("String"), // Required
@@ -1421,7 +1422,7 @@ func ExampleEC2_DeleteNetworkInterface() {
}
func ExampleEC2_DeletePlacementGroup() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeletePlacementGroupInput{
GroupName: aws.String("String"), // Required
@@ -1441,7 +1442,7 @@ func ExampleEC2_DeletePlacementGroup() {
}
func ExampleEC2_DeleteRoute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteRouteInput{
DestinationCidrBlock: aws.String("String"), // Required
@@ -1462,7 +1463,7 @@ func ExampleEC2_DeleteRoute() {
}
func ExampleEC2_DeleteRouteTable() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteRouteTableInput{
RouteTableId: aws.String("String"), // Required
@@ -1482,7 +1483,7 @@ func ExampleEC2_DeleteRouteTable() {
}
func ExampleEC2_DeleteSecurityGroup() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteSecurityGroupInput{
DryRun: aws.Bool(true),
@@ -1503,7 +1504,7 @@ func ExampleEC2_DeleteSecurityGroup() {
}
func ExampleEC2_DeleteSnapshot() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteSnapshotInput{
SnapshotId: aws.String("String"), // Required
@@ -1523,7 +1524,7 @@ func ExampleEC2_DeleteSnapshot() {
}
func ExampleEC2_DeleteSpotDatafeedSubscription() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteSpotDatafeedSubscriptionInput{
DryRun: aws.Bool(true),
@@ -1542,7 +1543,7 @@ func ExampleEC2_DeleteSpotDatafeedSubscription() {
}
func ExampleEC2_DeleteSubnet() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteSubnetInput{
SubnetId: aws.String("String"), // Required
@@ -1562,7 +1563,7 @@ func ExampleEC2_DeleteSubnet() {
}
func ExampleEC2_DeleteTags() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteTagsInput{
Resources: []*string{ // Required
@@ -1592,7 +1593,7 @@ func ExampleEC2_DeleteTags() {
}
func ExampleEC2_DeleteVolume() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVolumeInput{
VolumeId: aws.String("String"), // Required
@@ -1612,7 +1613,7 @@ func ExampleEC2_DeleteVolume() {
}
func ExampleEC2_DeleteVpc() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVpcInput{
VpcId: aws.String("String"), // Required
@@ -1632,7 +1633,7 @@ func ExampleEC2_DeleteVpc() {
}
func ExampleEC2_DeleteVpcEndpoints() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVpcEndpointsInput{
VpcEndpointIds: []*string{ // Required
@@ -1655,7 +1656,7 @@ func ExampleEC2_DeleteVpcEndpoints() {
}
func ExampleEC2_DeleteVpcPeeringConnection() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVpcPeeringConnectionInput{
VpcPeeringConnectionId: aws.String("String"), // Required
@@ -1675,7 +1676,7 @@ func ExampleEC2_DeleteVpcPeeringConnection() {
}
func ExampleEC2_DeleteVpnConnection() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVpnConnectionInput{
VpnConnectionId: aws.String("String"), // Required
@@ -1695,7 +1696,7 @@ func ExampleEC2_DeleteVpnConnection() {
}
func ExampleEC2_DeleteVpnConnectionRoute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVpnConnectionRouteInput{
DestinationCidrBlock: aws.String("String"), // Required
@@ -1715,7 +1716,7 @@ func ExampleEC2_DeleteVpnConnectionRoute() {
}
func ExampleEC2_DeleteVpnGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeleteVpnGatewayInput{
VpnGatewayId: aws.String("String"), // Required
@@ -1735,7 +1736,7 @@ func ExampleEC2_DeleteVpnGateway() {
}
func ExampleEC2_DeregisterImage() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DeregisterImageInput{
ImageId: aws.String("String"), // Required
@@ -1755,7 +1756,7 @@ func ExampleEC2_DeregisterImage() {
}
func ExampleEC2_DescribeAccountAttributes() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeAccountAttributesInput{
AttributeNames: []*string{
@@ -1778,7 +1779,7 @@ func ExampleEC2_DescribeAccountAttributes() {
}
func ExampleEC2_DescribeAddresses() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeAddressesInput{
AllocationIds: []*string{
@@ -1815,7 +1816,7 @@ func ExampleEC2_DescribeAddresses() {
}
func ExampleEC2_DescribeAvailabilityZones() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeAvailabilityZonesInput{
DryRun: aws.Bool(true),
@@ -1848,7 +1849,7 @@ func ExampleEC2_DescribeAvailabilityZones() {
}
func ExampleEC2_DescribeBundleTasks() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeBundleTasksInput{
BundleIds: []*string{
@@ -1881,7 +1882,7 @@ func ExampleEC2_DescribeBundleTasks() {
}
func ExampleEC2_DescribeClassicLinkInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeClassicLinkInstancesInput{
DryRun: aws.Bool(true),
@@ -1916,7 +1917,7 @@ func ExampleEC2_DescribeClassicLinkInstances() {
}
func ExampleEC2_DescribeConversionTasks() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeConversionTasksInput{
ConversionTaskIds: []*string{
@@ -1949,7 +1950,7 @@ func ExampleEC2_DescribeConversionTasks() {
}
func ExampleEC2_DescribeCustomerGateways() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeCustomerGatewaysInput{
CustomerGatewayIds: []*string{
@@ -1982,7 +1983,7 @@ func ExampleEC2_DescribeCustomerGateways() {
}
func ExampleEC2_DescribeDhcpOptions() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeDhcpOptionsInput{
DhcpOptionsIds: []*string{
@@ -2015,7 +2016,7 @@ func ExampleEC2_DescribeDhcpOptions() {
}
func ExampleEC2_DescribeExportTasks() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeExportTasksInput{
ExportTaskIds: []*string{
@@ -2037,7 +2038,7 @@ func ExampleEC2_DescribeExportTasks() {
}
func ExampleEC2_DescribeFlowLogs() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeFlowLogsInput{
Filter: []*ec2.Filter{
@@ -2071,7 +2072,7 @@ func ExampleEC2_DescribeFlowLogs() {
}
func ExampleEC2_DescribeImageAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeImageAttributeInput{
Attribute: aws.String("ImageAttributeName"), // Required
@@ -2092,7 +2093,7 @@ func ExampleEC2_DescribeImageAttribute() {
}
func ExampleEC2_DescribeImages() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeImagesInput{
DryRun: aws.Bool(true),
@@ -2133,7 +2134,7 @@ func ExampleEC2_DescribeImages() {
}
func ExampleEC2_DescribeImportImageTasks() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeImportImageTasksInput{
DryRun: aws.Bool(true),
@@ -2168,7 +2169,7 @@ func ExampleEC2_DescribeImportImageTasks() {
}
func ExampleEC2_DescribeImportSnapshotTasks() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeImportSnapshotTasksInput{
DryRun: aws.Bool(true),
@@ -2203,7 +2204,7 @@ func ExampleEC2_DescribeImportSnapshotTasks() {
}
func ExampleEC2_DescribeInstanceAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeInstanceAttributeInput{
Attribute: aws.String("InstanceAttributeName"), // Required
@@ -2224,7 +2225,7 @@ func ExampleEC2_DescribeInstanceAttribute() {
}
func ExampleEC2_DescribeInstanceStatus() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeInstanceStatusInput{
DryRun: aws.Bool(true),
@@ -2260,7 +2261,7 @@ func ExampleEC2_DescribeInstanceStatus() {
}
func ExampleEC2_DescribeInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeInstancesInput{
DryRun: aws.Bool(true),
@@ -2295,7 +2296,7 @@ func ExampleEC2_DescribeInstances() {
}
func ExampleEC2_DescribeInternetGateways() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeInternetGatewaysInput{
DryRun: aws.Bool(true),
@@ -2328,7 +2329,7 @@ func ExampleEC2_DescribeInternetGateways() {
}
func ExampleEC2_DescribeKeyPairs() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeKeyPairsInput{
DryRun: aws.Bool(true),
@@ -2361,7 +2362,7 @@ func ExampleEC2_DescribeKeyPairs() {
}
func ExampleEC2_DescribeMovingAddresses() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeMovingAddressesInput{
DryRun: aws.Bool(true),
@@ -2396,7 +2397,7 @@ func ExampleEC2_DescribeMovingAddresses() {
}
func ExampleEC2_DescribeNetworkAcls() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeNetworkAclsInput{
DryRun: aws.Bool(true),
@@ -2429,7 +2430,7 @@ func ExampleEC2_DescribeNetworkAcls() {
}
func ExampleEC2_DescribeNetworkInterfaceAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeNetworkInterfaceAttributeInput{
NetworkInterfaceId: aws.String("String"), // Required
@@ -2450,7 +2451,7 @@ func ExampleEC2_DescribeNetworkInterfaceAttribute() {
}
func ExampleEC2_DescribeNetworkInterfaces() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeNetworkInterfacesInput{
DryRun: aws.Bool(true),
@@ -2483,7 +2484,7 @@ func ExampleEC2_DescribeNetworkInterfaces() {
}
func ExampleEC2_DescribePlacementGroups() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribePlacementGroupsInput{
DryRun: aws.Bool(true),
@@ -2516,7 +2517,7 @@ func ExampleEC2_DescribePlacementGroups() {
}
func ExampleEC2_DescribePrefixLists() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribePrefixListsInput{
DryRun: aws.Bool(true),
@@ -2551,7 +2552,7 @@ func ExampleEC2_DescribePrefixLists() {
}
func ExampleEC2_DescribeRegions() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeRegionsInput{
DryRun: aws.Bool(true),
@@ -2584,7 +2585,7 @@ func ExampleEC2_DescribeRegions() {
}
func ExampleEC2_DescribeReservedInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeReservedInstancesInput{
DryRun: aws.Bool(true),
@@ -2618,7 +2619,7 @@ func ExampleEC2_DescribeReservedInstances() {
}
func ExampleEC2_DescribeReservedInstancesListings() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeReservedInstancesListingsInput{
Filters: []*ec2.Filter{
@@ -2648,7 +2649,7 @@ func ExampleEC2_DescribeReservedInstancesListings() {
}
func ExampleEC2_DescribeReservedInstancesModifications() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeReservedInstancesModificationsInput{
Filters: []*ec2.Filter{
@@ -2681,7 +2682,7 @@ func ExampleEC2_DescribeReservedInstancesModifications() {
}
func ExampleEC2_DescribeReservedInstancesOfferings() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeReservedInstancesOfferingsInput{
AvailabilityZone: aws.String("String"),
@@ -2725,7 +2726,7 @@ func ExampleEC2_DescribeReservedInstancesOfferings() {
}
func ExampleEC2_DescribeRouteTables() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeRouteTablesInput{
DryRun: aws.Bool(true),
@@ -2758,7 +2759,7 @@ func ExampleEC2_DescribeRouteTables() {
}
func ExampleEC2_DescribeSecurityGroups() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSecurityGroupsInput{
DryRun: aws.Bool(true),
@@ -2795,7 +2796,7 @@ func ExampleEC2_DescribeSecurityGroups() {
}
func ExampleEC2_DescribeSnapshotAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSnapshotAttributeInput{
Attribute: aws.String("SnapshotAttributeName"), // Required
@@ -2816,7 +2817,7 @@ func ExampleEC2_DescribeSnapshotAttribute() {
}
func ExampleEC2_DescribeSnapshots() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSnapshotsInput{
DryRun: aws.Bool(true),
@@ -2859,7 +2860,7 @@ func ExampleEC2_DescribeSnapshots() {
}
func ExampleEC2_DescribeSpotDatafeedSubscription() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSpotDatafeedSubscriptionInput{
DryRun: aws.Bool(true),
@@ -2878,7 +2879,7 @@ func ExampleEC2_DescribeSpotDatafeedSubscription() {
}
func ExampleEC2_DescribeSpotFleetInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSpotFleetInstancesInput{
SpotFleetRequestId: aws.String("String"), // Required
@@ -2900,7 +2901,7 @@ func ExampleEC2_DescribeSpotFleetInstances() {
}
func ExampleEC2_DescribeSpotFleetRequestHistory() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSpotFleetRequestHistoryInput{
SpotFleetRequestId: aws.String("String"), // Required
@@ -2924,7 +2925,7 @@ func ExampleEC2_DescribeSpotFleetRequestHistory() {
}
func ExampleEC2_DescribeSpotFleetRequests() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSpotFleetRequestsInput{
DryRun: aws.Bool(true),
@@ -2949,7 +2950,7 @@ func ExampleEC2_DescribeSpotFleetRequests() {
}
func ExampleEC2_DescribeSpotInstanceRequests() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSpotInstanceRequestsInput{
DryRun: aws.Bool(true),
@@ -2982,7 +2983,7 @@ func ExampleEC2_DescribeSpotInstanceRequests() {
}
func ExampleEC2_DescribeSpotPriceHistory() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSpotPriceHistoryInput{
AvailabilityZone: aws.String("String"),
@@ -3024,7 +3025,7 @@ func ExampleEC2_DescribeSpotPriceHistory() {
}
func ExampleEC2_DescribeSubnets() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeSubnetsInput{
DryRun: aws.Bool(true),
@@ -3057,7 +3058,7 @@ func ExampleEC2_DescribeSubnets() {
}
func ExampleEC2_DescribeTags() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeTagsInput{
DryRun: aws.Bool(true),
@@ -3088,7 +3089,7 @@ func ExampleEC2_DescribeTags() {
}
func ExampleEC2_DescribeVolumeAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVolumeAttributeInput{
VolumeId: aws.String("String"), // Required
@@ -3109,7 +3110,7 @@ func ExampleEC2_DescribeVolumeAttribute() {
}
func ExampleEC2_DescribeVolumeStatus() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVolumeStatusInput{
DryRun: aws.Bool(true),
@@ -3144,7 +3145,7 @@ func ExampleEC2_DescribeVolumeStatus() {
}
func ExampleEC2_DescribeVolumes() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVolumesInput{
DryRun: aws.Bool(true),
@@ -3179,7 +3180,7 @@ func ExampleEC2_DescribeVolumes() {
}
func ExampleEC2_DescribeVpcAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpcAttributeInput{
VpcId: aws.String("String"), // Required
@@ -3200,7 +3201,7 @@ func ExampleEC2_DescribeVpcAttribute() {
}
func ExampleEC2_DescribeVpcClassicLink() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpcClassicLinkInput{
DryRun: aws.Bool(true),
@@ -3233,7 +3234,7 @@ func ExampleEC2_DescribeVpcClassicLink() {
}
func ExampleEC2_DescribeVpcEndpointServices() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpcEndpointServicesInput{
DryRun: aws.Bool(true),
@@ -3254,7 +3255,7 @@ func ExampleEC2_DescribeVpcEndpointServices() {
}
func ExampleEC2_DescribeVpcEndpoints() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpcEndpointsInput{
DryRun: aws.Bool(true),
@@ -3289,7 +3290,7 @@ func ExampleEC2_DescribeVpcEndpoints() {
}
func ExampleEC2_DescribeVpcPeeringConnections() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpcPeeringConnectionsInput{
DryRun: aws.Bool(true),
@@ -3322,7 +3323,7 @@ func ExampleEC2_DescribeVpcPeeringConnections() {
}
func ExampleEC2_DescribeVpcs() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpcsInput{
DryRun: aws.Bool(true),
@@ -3355,7 +3356,7 @@ func ExampleEC2_DescribeVpcs() {
}
func ExampleEC2_DescribeVpnConnections() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpnConnectionsInput{
DryRun: aws.Bool(true),
@@ -3388,7 +3389,7 @@ func ExampleEC2_DescribeVpnConnections() {
}
func ExampleEC2_DescribeVpnGateways() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DescribeVpnGatewaysInput{
DryRun: aws.Bool(true),
@@ -3421,7 +3422,7 @@ func ExampleEC2_DescribeVpnGateways() {
}
func ExampleEC2_DetachClassicLinkVpc() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DetachClassicLinkVpcInput{
InstanceId: aws.String("String"), // Required
@@ -3442,7 +3443,7 @@ func ExampleEC2_DetachClassicLinkVpc() {
}
func ExampleEC2_DetachInternetGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DetachInternetGatewayInput{
InternetGatewayId: aws.String("String"), // Required
@@ -3463,7 +3464,7 @@ func ExampleEC2_DetachInternetGateway() {
}
func ExampleEC2_DetachNetworkInterface() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DetachNetworkInterfaceInput{
AttachmentId: aws.String("String"), // Required
@@ -3484,7 +3485,7 @@ func ExampleEC2_DetachNetworkInterface() {
}
func ExampleEC2_DetachVolume() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DetachVolumeInput{
VolumeId: aws.String("String"), // Required
@@ -3507,7 +3508,7 @@ func ExampleEC2_DetachVolume() {
}
func ExampleEC2_DetachVpnGateway() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DetachVpnGatewayInput{
VpcId: aws.String("String"), // Required
@@ -3528,7 +3529,7 @@ func ExampleEC2_DetachVpnGateway() {
}
func ExampleEC2_DisableVgwRoutePropagation() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DisableVgwRoutePropagationInput{
GatewayId: aws.String("String"), // Required
@@ -3548,7 +3549,7 @@ func ExampleEC2_DisableVgwRoutePropagation() {
}
func ExampleEC2_DisableVpcClassicLink() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DisableVpcClassicLinkInput{
VpcId: aws.String("String"), // Required
@@ -3568,7 +3569,7 @@ func ExampleEC2_DisableVpcClassicLink() {
}
func ExampleEC2_DisassociateAddress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DisassociateAddressInput{
AssociationId: aws.String("String"),
@@ -3589,7 +3590,7 @@ func ExampleEC2_DisassociateAddress() {
}
func ExampleEC2_DisassociateRouteTable() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.DisassociateRouteTableInput{
AssociationId: aws.String("String"), // Required
@@ -3609,7 +3610,7 @@ func ExampleEC2_DisassociateRouteTable() {
}
func ExampleEC2_EnableVgwRoutePropagation() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.EnableVgwRoutePropagationInput{
GatewayId: aws.String("String"), // Required
@@ -3629,7 +3630,7 @@ func ExampleEC2_EnableVgwRoutePropagation() {
}
func ExampleEC2_EnableVolumeIO() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.EnableVolumeIOInput{
VolumeId: aws.String("String"), // Required
@@ -3649,7 +3650,7 @@ func ExampleEC2_EnableVolumeIO() {
}
func ExampleEC2_EnableVpcClassicLink() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.EnableVpcClassicLinkInput{
VpcId: aws.String("String"), // Required
@@ -3669,7 +3670,7 @@ func ExampleEC2_EnableVpcClassicLink() {
}
func ExampleEC2_GetConsoleOutput() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.GetConsoleOutputInput{
InstanceId: aws.String("String"), // Required
@@ -3689,7 +3690,7 @@ func ExampleEC2_GetConsoleOutput() {
}
func ExampleEC2_GetPasswordData() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.GetPasswordDataInput{
InstanceId: aws.String("String"), // Required
@@ -3709,7 +3710,7 @@ func ExampleEC2_GetPasswordData() {
}
func ExampleEC2_ImportImage() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ImportImageInput{
Architecture: aws.String("String"),
@@ -3755,7 +3756,7 @@ func ExampleEC2_ImportImage() {
}
func ExampleEC2_ImportInstance() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ImportInstanceInput{
Platform: aws.String("PlatformValues"), // Required
@@ -3815,7 +3816,7 @@ func ExampleEC2_ImportInstance() {
}
func ExampleEC2_ImportKeyPair() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ImportKeyPairInput{
KeyName: aws.String("String"), // Required
@@ -3836,7 +3837,7 @@ func ExampleEC2_ImportKeyPair() {
}
func ExampleEC2_ImportSnapshot() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ImportSnapshotInput{
ClientData: &ec2.ClientData{
@@ -3873,7 +3874,7 @@ func ExampleEC2_ImportSnapshot() {
}
func ExampleEC2_ImportVolume() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ImportVolumeInput{
AvailabilityZone: aws.String("String"), // Required
@@ -3902,7 +3903,7 @@ func ExampleEC2_ImportVolume() {
}
func ExampleEC2_ModifyImageAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyImageAttributeInput{
ImageId: aws.String("String"), // Required
@@ -3956,7 +3957,7 @@ func ExampleEC2_ModifyImageAttribute() {
}
func ExampleEC2_ModifyInstanceAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyInstanceAttributeInput{
InstanceId: aws.String("String"), // Required
@@ -4021,7 +4022,7 @@ func ExampleEC2_ModifyInstanceAttribute() {
}
func ExampleEC2_ModifyNetworkInterfaceAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyNetworkInterfaceAttributeInput{
NetworkInterfaceId: aws.String("String"), // Required
@@ -4055,7 +4056,7 @@ func ExampleEC2_ModifyNetworkInterfaceAttribute() {
}
func ExampleEC2_ModifyReservedInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyReservedInstancesInput{
ReservedInstancesIds: []*string{ // Required
@@ -4087,7 +4088,7 @@ func ExampleEC2_ModifyReservedInstances() {
}
func ExampleEC2_ModifySnapshotAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifySnapshotAttributeInput{
SnapshotId: aws.String("String"), // Required
@@ -4133,7 +4134,7 @@ func ExampleEC2_ModifySnapshotAttribute() {
}
func ExampleEC2_ModifySpotFleetRequest() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifySpotFleetRequestInput{
SpotFleetRequestId: aws.String("String"), // Required
@@ -4154,7 +4155,7 @@ func ExampleEC2_ModifySpotFleetRequest() {
}
func ExampleEC2_ModifySubnetAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifySubnetAttributeInput{
SubnetId: aws.String("String"), // Required
@@ -4176,7 +4177,7 @@ func ExampleEC2_ModifySubnetAttribute() {
}
func ExampleEC2_ModifyVolumeAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyVolumeAttributeInput{
VolumeId: aws.String("String"), // Required
@@ -4199,7 +4200,7 @@ func ExampleEC2_ModifyVolumeAttribute() {
}
func ExampleEC2_ModifyVpcAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyVpcAttributeInput{
VpcId: aws.String("String"), // Required
@@ -4224,7 +4225,7 @@ func ExampleEC2_ModifyVpcAttribute() {
}
func ExampleEC2_ModifyVpcEndpoint() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ModifyVpcEndpointInput{
VpcEndpointId: aws.String("String"), // Required
@@ -4254,7 +4255,7 @@ func ExampleEC2_ModifyVpcEndpoint() {
}
func ExampleEC2_MonitorInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.MonitorInstancesInput{
InstanceIds: []*string{ // Required
@@ -4277,7 +4278,7 @@ func ExampleEC2_MonitorInstances() {
}
func ExampleEC2_MoveAddressToVpc() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.MoveAddressToVpcInput{
PublicIp: aws.String("String"), // Required
@@ -4297,7 +4298,7 @@ func ExampleEC2_MoveAddressToVpc() {
}
func ExampleEC2_PurchaseReservedInstancesOffering() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.PurchaseReservedInstancesOfferingInput{
InstanceCount: aws.Int64(1), // Required
@@ -4322,7 +4323,7 @@ func ExampleEC2_PurchaseReservedInstancesOffering() {
}
func ExampleEC2_RebootInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RebootInstancesInput{
InstanceIds: []*string{ // Required
@@ -4345,7 +4346,7 @@ func ExampleEC2_RebootInstances() {
}
func ExampleEC2_RegisterImage() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RegisterImageInput{
Name: aws.String("String"), // Required
@@ -4389,7 +4390,7 @@ func ExampleEC2_RegisterImage() {
}
func ExampleEC2_RejectVpcPeeringConnection() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RejectVpcPeeringConnectionInput{
VpcPeeringConnectionId: aws.String("String"), // Required
@@ -4409,7 +4410,7 @@ func ExampleEC2_RejectVpcPeeringConnection() {
}
func ExampleEC2_ReleaseAddress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ReleaseAddressInput{
AllocationId: aws.String("String"),
@@ -4430,7 +4431,7 @@ func ExampleEC2_ReleaseAddress() {
}
func ExampleEC2_ReplaceNetworkAclAssociation() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ReplaceNetworkAclAssociationInput{
AssociationId: aws.String("String"), // Required
@@ -4451,7 +4452,7 @@ func ExampleEC2_ReplaceNetworkAclAssociation() {
}
func ExampleEC2_ReplaceNetworkAclEntry() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ReplaceNetworkAclEntryInput{
CidrBlock: aws.String("String"), // Required
@@ -4484,7 +4485,7 @@ func ExampleEC2_ReplaceNetworkAclEntry() {
}
func ExampleEC2_ReplaceRoute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ReplaceRouteInput{
DestinationCidrBlock: aws.String("String"), // Required
@@ -4509,7 +4510,7 @@ func ExampleEC2_ReplaceRoute() {
}
func ExampleEC2_ReplaceRouteTableAssociation() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ReplaceRouteTableAssociationInput{
AssociationId: aws.String("String"), // Required
@@ -4530,7 +4531,7 @@ func ExampleEC2_ReplaceRouteTableAssociation() {
}
func ExampleEC2_ReportInstanceStatus() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ReportInstanceStatusInput{
Instances: []*string{ // Required
@@ -4561,7 +4562,7 @@ func ExampleEC2_ReportInstanceStatus() {
}
func ExampleEC2_RequestSpotFleet() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RequestSpotFleetInput{
SpotFleetRequestConfig: &ec2.SpotFleetRequestConfigData{ // Required
@@ -4665,7 +4666,7 @@ func ExampleEC2_RequestSpotFleet() {
}
func ExampleEC2_RequestSpotInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RequestSpotInstancesInput{
SpotPrice: aws.String("String"), // Required
@@ -4763,7 +4764,7 @@ func ExampleEC2_RequestSpotInstances() {
}
func ExampleEC2_ResetImageAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ResetImageAttributeInput{
Attribute: aws.String("ResetImageAttributeName"), // Required
@@ -4784,7 +4785,7 @@ func ExampleEC2_ResetImageAttribute() {
}
func ExampleEC2_ResetInstanceAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ResetInstanceAttributeInput{
Attribute: aws.String("InstanceAttributeName"), // Required
@@ -4805,7 +4806,7 @@ func ExampleEC2_ResetInstanceAttribute() {
}
func ExampleEC2_ResetNetworkInterfaceAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ResetNetworkInterfaceAttributeInput{
NetworkInterfaceId: aws.String("String"), // Required
@@ -4826,7 +4827,7 @@ func ExampleEC2_ResetNetworkInterfaceAttribute() {
}
func ExampleEC2_ResetSnapshotAttribute() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.ResetSnapshotAttributeInput{
Attribute: aws.String("SnapshotAttributeName"), // Required
@@ -4847,7 +4848,7 @@ func ExampleEC2_ResetSnapshotAttribute() {
}
func ExampleEC2_RestoreAddressToClassic() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RestoreAddressToClassicInput{
PublicIp: aws.String("String"), // Required
@@ -4867,7 +4868,7 @@ func ExampleEC2_RestoreAddressToClassic() {
}
func ExampleEC2_RevokeSecurityGroupEgress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RevokeSecurityGroupEgressInput{
GroupId: aws.String("String"), // Required
@@ -4921,7 +4922,7 @@ func ExampleEC2_RevokeSecurityGroupEgress() {
}
func ExampleEC2_RevokeSecurityGroupIngress() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RevokeSecurityGroupIngressInput{
CidrIp: aws.String("String"),
@@ -4976,7 +4977,7 @@ func ExampleEC2_RevokeSecurityGroupIngress() {
}
func ExampleEC2_RunInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.RunInstancesInput{
ImageId: aws.String("String"), // Required
@@ -5070,7 +5071,7 @@ func ExampleEC2_RunInstances() {
}
func ExampleEC2_StartInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.StartInstancesInput{
InstanceIds: []*string{ // Required
@@ -5094,7 +5095,7 @@ func ExampleEC2_StartInstances() {
}
func ExampleEC2_StopInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.StopInstancesInput{
InstanceIds: []*string{ // Required
@@ -5118,7 +5119,7 @@ func ExampleEC2_StopInstances() {
}
func ExampleEC2_TerminateInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.TerminateInstancesInput{
InstanceIds: []*string{ // Required
@@ -5141,7 +5142,7 @@ func ExampleEC2_TerminateInstances() {
}
func ExampleEC2_UnassignPrivateIpAddresses() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.UnassignPrivateIpAddressesInput{
NetworkInterfaceId: aws.String("String"), // Required
@@ -5164,7 +5165,7 @@ func ExampleEC2_UnassignPrivateIpAddresses() {
}
func ExampleEC2_UnmonitorInstances() {
- svc := ec2.New(nil)
+ svc := ec2.New(session.New())
params := &ec2.UnmonitorInstancesInput{
InstanceIds: []*string{ // Required
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go
index fb20e805b9f..2ff4220f7da 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go
@@ -4,10 +4,9 @@ package ec2
import (
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/aws/service"
- "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
"github.com/aws/aws-sdk-go/private/protocol/ec2query"
"github.com/aws/aws-sdk-go/private/signer/v4"
)
@@ -16,40 +15,64 @@ import (
// in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your
// need to invest in hardware up front, so you can develop and deploy applications
// faster.
+//The service client's operations are safe to be used concurrently.
+// It is not safe to mutate any of the client's properties though.
type EC2 struct {
- *service.Service
+ *client.Client
}
-// Used for custom service initialization logic
-var initService func(*service.Service)
+// Used for custom client initialization logic
+var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
-// New returns a new EC2 client.
-func New(config *aws.Config) *EC2 {
- service := &service.Service{
- ServiceInfo: serviceinfo.ServiceInfo{
- Config: defaults.DefaultConfig.Merge(config),
- ServiceName: "ec2",
- APIVersion: "2015-10-01",
- },
+// A ServiceName is the name of the service the client will make API calls to.
+const ServiceName = "ec2"
+
+// New creates a new instance of the EC2 client with a session.
+// If additional configuration is needed for the client instance use the optional
+// aws.Config parameter to add your extra config.
+//
+// Example:
+// // Create a EC2 client from just a session.
+// svc := ec2.New(mySession)
+//
+// // Create a EC2 client with additional configuration
+// svc := ec2.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
+func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2 {
+ c := p.ClientConfig(ServiceName, cfgs...)
+ return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
+}
+
+// newClient creates, initializes and returns a new service client instance.
+func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *EC2 {
+ svc := &EC2{
+ Client: client.New(
+ cfg,
+ metadata.ClientInfo{
+ ServiceName: ServiceName,
+ SigningRegion: signingRegion,
+ Endpoint: endpoint,
+ APIVersion: "2015-10-01",
+ },
+ handlers,
+ ),
}
- service.Initialize()
// Handlers
- service.Handlers.Sign.PushBack(v4.Sign)
- service.Handlers.Build.PushBack(ec2query.Build)
- service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
- service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
- service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
+ svc.Handlers.Sign.PushBack(v4.Sign)
+ svc.Handlers.Build.PushBack(ec2query.Build)
+ svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
+ svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
+ svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
- // Run custom service initialization if present
- if initService != nil {
- initService(service)
+ // Run custom client initialization if present
+ if initClient != nil {
+ initClient(svc.Client)
}
- return &EC2{service}
+ return svc
}
// newRequest creates a new request for a EC2 operation and runs any
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/waiters.go
new file mode 100644
index 00000000000..1b28317a18b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/waiters.go
@@ -0,0 +1,761 @@
+// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
+
+package ec2
+
+import (
+ "github.com/aws/aws-sdk-go/private/waiter"
+)
+
+func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeBundleTasks",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "BundleTasks[].State",
+ Expected: "complete",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "BundleTasks[].State",
+ Expected: "failed",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeConversionTasks",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "ConversionTasks[].State",
+ Expected: "cancelled",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeConversionTasks",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "ConversionTasks[].State",
+ Expected: "completed",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "ConversionTasks[].State",
+ Expected: "cancelled",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "ConversionTasks[].State",
+ Expected: "cancelling",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeConversionTasks",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "ConversionTasks[].State",
+ Expected: "deleted",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeCustomerGateways",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "CustomerGateways[].State",
+ Expected: "available",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "CustomerGateways[].State",
+ Expected: "deleted",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "CustomerGateways[].State",
+ Expected: "deleting",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeExportTasks",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "ExportTasks[].State",
+ Expected: "cancelled",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeExportTasks",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "ExportTasks[].State",
+ Expected: "completed",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeImages",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Images[].State",
+ Expected: "available",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Images[].State",
+ Expected: "failed",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeInstances",
+ Delay: 5,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "status",
+ Argument: "",
+ Expected: 200,
+ },
+ {
+ State: "retry",
+ Matcher: "error",
+ Argument: "",
+ Expected: "InvalidInstanceIDNotFound",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeInstances",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "running",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "shutting-down",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "terminated",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "stopping",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeInstanceStatus",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "InstanceStatuses[].InstanceStatus.Status",
+ Expected: "ok",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeInstances",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "stopped",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "pending",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "terminated",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeInstances",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "terminated",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "pending",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Reservations[].Instances[].State.Name",
+ Expected: "stopping",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeKeyPairs",
+ Delay: 5,
+ MaxAttempts: 6,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "length(KeyPairs[].KeyName) > `0`",
+ Expected: true,
+ },
+ {
+ State: "retry",
+ Matcher: "error",
+ Argument: "",
+ Expected: "InvalidKeyPairNotFound",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeNetworkInterfaces",
+ Delay: 20,
+ MaxAttempts: 10,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "NetworkInterfaces[].Status",
+ Expected: "available",
+ },
+ {
+ State: "failure",
+ Matcher: "error",
+ Argument: "",
+ Expected: "InvalidNetworkInterfaceIDNotFound",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "GetPasswordData",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "path",
+ Argument: "length(PasswordData) > `0`",
+ Expected: true,
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeSnapshots",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Snapshots[].State",
+ Expected: "completed",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeSpotInstanceRequests",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "SpotInstanceRequests[].Status.Code",
+ Expected: "fulfilled",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "SpotInstanceRequests[].Status.Code",
+ Expected: "schedule-expired",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "SpotInstanceRequests[].Status.Code",
+ Expected: "canceled-before-fulfillment",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "SpotInstanceRequests[].Status.Code",
+ Expected: "bad-parameters",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "SpotInstanceRequests[].Status.Code",
+ Expected: "system-error",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeSubnets",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Subnets[].State",
+ Expected: "available",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeInstanceStatus",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "InstanceStatuses[].SystemStatus.Status",
+ Expected: "ok",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeVolumes",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Volumes[].State",
+ Expected: "available",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Volumes[].State",
+ Expected: "deleted",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeVolumes",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Volumes[].State",
+ Expected: "deleted",
+ },
+ {
+ State: "success",
+ Matcher: "error",
+ Argument: "",
+ Expected: "InvalidVolumeNotFound",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeVolumes",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Volumes[].State",
+ Expected: "in-use",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "Volumes[].State",
+ Expected: "deleted",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeVpcs",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "Vpcs[].State",
+ Expected: "available",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeVpnConnections",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "VpnConnections[].State",
+ Expected: "available",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "VpnConnections[].State",
+ Expected: "deleting",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "VpnConnections[].State",
+ Expected: "deleted",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
+
+func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error {
+ waiterCfg := waiter.Config{
+ Operation: "DescribeVpnConnections",
+ Delay: 15,
+ MaxAttempts: 40,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "VpnConnections[].State",
+ Expected: "deleted",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "VpnConnections[].State",
+ Expected: "pending",
+ },
+ },
+ }
+
+ w := waiter.Waiter{
+ Client: c,
+ Input: input,
+ Config: waiterCfg,
+ }
+ return w.Wait()
+}
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/.gitignore b/Godeps/_workspace/src/github.com/go-ini/ini/.gitignore
new file mode 100644
index 00000000000..7adca9439c5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/.gitignore
@@ -0,0 +1,4 @@
+testdata/conf_out.ini
+ini.sublime-project
+ini.sublime-workspace
+testdata/conf_reflect.ini
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE b/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE
new file mode 100644
index 00000000000..37ec93a14fd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE
@@ -0,0 +1,191 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "[]" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/README.md b/Godeps/_workspace/src/github.com/go-ini/ini/README.md
new file mode 100644
index 00000000000..1272038a9e3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/README.md
@@ -0,0 +1,560 @@
+ini [](https://drone.io/github.com/go-ini/ini/latest) [](http://gocover.io/github.com/go-ini/ini)
+===
+
+
+
+Package ini provides INI file read and write functionality in Go.
+
+[简体中文](README_ZH.md)
+
+## Feature
+
+- Load multiple data sources(`[]byte` or file) with overwrites.
+- Read with recursion values.
+- Read with parent-child sections.
+- Read with auto-increment key names.
+- Read with multiple-line values.
+- Read with tons of helper methods.
+- Read and convert values to Go types.
+- Read and **WRITE** comments of sections and keys.
+- Manipulate sections, keys and comments with ease.
+- Keep sections and keys in order as you parse and save.
+
+## Installation
+
+ go get gopkg.in/ini.v1
+
+## Getting Started
+
+### Loading from data sources
+
+A **Data Source** is either raw data in type `[]byte` or a file name with type `string` and you can load **as many as** data sources you want. Passing other types will simply return an error.
+
+```go
+cfg, err := ini.Load([]byte("raw data"), "filename")
+```
+
+Or start with an empty object:
+
+```go
+cfg := ini.Empty()
+```
+
+When you cannot decide how many data sources to load at the beginning, you still able to **Append()** them later.
+
+```go
+err := cfg.Append("other file", []byte("other raw data"))
+```
+
+### Working with sections
+
+To get a section, you would need to:
+
+```go
+section, err := cfg.GetSection("section name")
+```
+
+For a shortcut for default section, just give an empty string as name:
+
+```go
+section, err := cfg.GetSection("")
+```
+
+When you're pretty sure the section exists, following code could make your life easier:
+
+```go
+section := cfg.Section("")
+```
+
+What happens when the section somehow does not exist? Don't panic, it automatically creates and returns a new section to you.
+
+To create a new section:
+
+```go
+err := cfg.NewSection("new section")
+```
+
+To get a list of sections or section names:
+
+```go
+sections := cfg.Sections()
+names := cfg.SectionStrings()
+```
+
+### Working with keys
+
+To get a key under a section:
+
+```go
+key, err := cfg.Section("").GetKey("key name")
+```
+
+Same rule applies to key operations:
+
+```go
+key := cfg.Section("").Key("key name")
+```
+
+To create a new key:
+
+```go
+err := cfg.Section("").NewKey("name", "value")
+```
+
+To get a list of keys or key names:
+
+```go
+keys := cfg.Section("").Keys()
+names := cfg.Section("").KeyStrings()
+```
+
+To get a clone hash of keys and corresponding values:
+
+```go
+hash := cfg.GetSection("").KeysHash()
+```
+
+### Working with values
+
+To get a string value:
+
+```go
+val := cfg.Section("").Key("key name").String()
+```
+
+To validate key value on the fly:
+
+```go
+val := cfg.Section("").Key("key name").Validate(func(in string) string {
+ if len(in) == 0 {
+ return "default"
+ }
+ return in
+})
+```
+
+To get value with types:
+
+```go
+// For boolean values:
+// true when value is: 1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On
+// false when value is: 0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off
+v, err = cfg.Section("").Key("BOOL").Bool()
+v, err = cfg.Section("").Key("FLOAT64").Float64()
+v, err = cfg.Section("").Key("INT").Int()
+v, err = cfg.Section("").Key("INT64").Int64()
+v, err = cfg.Section("").Key("UINT").Uint()
+v, err = cfg.Section("").Key("UINT64").Uint64()
+v, err = cfg.Section("").Key("TIME").TimeFormat(time.RFC3339)
+v, err = cfg.Section("").Key("TIME").Time() // RFC3339
+
+v = cfg.Section("").Key("BOOL").MustBool()
+v = cfg.Section("").Key("FLOAT64").MustFloat64()
+v = cfg.Section("").Key("INT").MustInt()
+v = cfg.Section("").Key("INT64").MustInt64()
+v = cfg.Section("").Key("UINT").MustUint()
+v = cfg.Section("").Key("UINT64").MustUint64()
+v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339)
+v = cfg.Section("").Key("TIME").MustTime() // RFC3339
+
+// Methods start with Must also accept one argument for default value
+// when key not found or fail to parse value to given type.
+// Except method MustString, which you have to pass a default value.
+
+v = cfg.Section("").Key("String").MustString("default")
+v = cfg.Section("").Key("BOOL").MustBool(true)
+v = cfg.Section("").Key("FLOAT64").MustFloat64(1.25)
+v = cfg.Section("").Key("INT").MustInt(10)
+v = cfg.Section("").Key("INT64").MustInt64(99)
+v = cfg.Section("").Key("UINT").MustUint(3)
+v = cfg.Section("").Key("UINT64").MustUint64(6)
+v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339, time.Now())
+v = cfg.Section("").Key("TIME").MustTime(time.Now()) // RFC3339
+```
+
+What if my value is three-line long?
+
+```ini
+[advance]
+ADDRESS = """404 road,
+NotFound, State, 5000
+Earth"""
+```
+
+Not a problem!
+
+```go
+cfg.Section("advance").Key("ADDRESS").String()
+
+/* --- start ---
+404 road,
+NotFound, State, 5000
+Earth
+------ end --- */
+```
+
+That's cool, how about continuation lines?
+
+```ini
+[advance]
+two_lines = how about \
+ continuation lines?
+lots_of_lines = 1 \
+ 2 \
+ 3 \
+ 4
+```
+
+Piece of cake!
+
+```go
+cfg.Section("advance").Key("two_lines").String() // how about continuation lines?
+cfg.Section("advance").Key("lots_of_lines").String() // 1 2 3 4
+```
+
+Note that single quotes around values will be stripped:
+
+```ini
+foo = "some value" // foo: some value
+bar = 'some value' // bar: some value
+```
+
+That's all? Hmm, no.
+
+#### Helper methods of working with values
+
+To get value with given candidates:
+
+```go
+v = cfg.Section("").Key("STRING").In("default", []string{"str", "arr", "types"})
+v = cfg.Section("").Key("FLOAT64").InFloat64(1.1, []float64{1.25, 2.5, 3.75})
+v = cfg.Section("").Key("INT").InInt(5, []int{10, 20, 30})
+v = cfg.Section("").Key("INT64").InInt64(10, []int64{10, 20, 30})
+v = cfg.Section("").Key("UINT").InUint(4, []int{3, 6, 9})
+v = cfg.Section("").Key("UINT64").InUint64(8, []int64{3, 6, 9})
+v = cfg.Section("").Key("TIME").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3})
+v = cfg.Section("").Key("TIME").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339
+```
+
+Default value will be presented if value of key is not in candidates you given, and default value does not need be one of candidates.
+
+To validate value in a given range:
+
+```go
+vals = cfg.Section("").Key("FLOAT64").RangeFloat64(0.0, 1.1, 2.2)
+vals = cfg.Section("").Key("INT").RangeInt(0, 10, 20)
+vals = cfg.Section("").Key("INT64").RangeInt64(0, 10, 20)
+vals = cfg.Section("").Key("UINT").RangeUint(0, 3, 9)
+vals = cfg.Section("").Key("UINT64").RangeUint64(0, 3, 9)
+vals = cfg.Section("").Key("TIME").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime)
+vals = cfg.Section("").Key("TIME").RangeTime(time.Now(), minTime, maxTime) // RFC3339
+```
+
+To auto-split value into slice:
+
+```go
+vals = cfg.Section("").Key("STRINGS").Strings(",")
+vals = cfg.Section("").Key("FLOAT64S").Float64s(",")
+vals = cfg.Section("").Key("INTS").Ints(",")
+vals = cfg.Section("").Key("INT64S").Int64s(",")
+vals = cfg.Section("").Key("UINTS").Uints(",")
+vals = cfg.Section("").Key("UINT64S").Uint64s(",")
+vals = cfg.Section("").Key("TIMES").Times(",")
+```
+
+### Save your configuration
+
+Finally, it's time to save your configuration to somewhere.
+
+A typical way to save configuration is writing it to a file:
+
+```go
+// ...
+err = cfg.SaveTo("my.ini")
+err = cfg.SaveToIndent("my.ini", "\t")
+```
+
+Another way to save is writing to a `io.Writer` interface:
+
+```go
+// ...
+cfg.WriteTo(writer)
+cfg.WriteToIndent(writer, "\t")
+```
+
+## Advanced Usage
+
+### Recursive Values
+
+For all value of keys, there is a special syntax `%()s`, where `` is the key name in same section or default section, and `%()s` will be replaced by corresponding value(empty string if key not found). You can use this syntax at most 99 level of recursions.
+
+```ini
+NAME = ini
+
+[author]
+NAME = Unknwon
+GITHUB = https://github.com/%(NAME)s
+
+[package]
+FULL_NAME = github.com/go-ini/%(NAME)s
+```
+
+```go
+cfg.Section("author").Key("GITHUB").String() // https://github.com/Unknwon
+cfg.Section("package").Key("FULL_NAME").String() // github.com/go-ini/ini
+```
+
+### Parent-child Sections
+
+You can use `.` in section name to indicate parent-child relationship between two or more sections. If the key not found in the child section, library will try again on its parent section until there is no parent section.
+
+```ini
+NAME = ini
+VERSION = v1
+IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s
+
+[package]
+CLONE_URL = https://%(IMPORT_PATH)s
+
+[package.sub]
+```
+
+```go
+cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1
+```
+
+### Auto-increment Key Names
+
+If key name is `-` in data source, then it would be seen as special syntax for auto-increment key name start from 1, and every section is independent on counter.
+
+```ini
+[features]
+-: Support read/write comments of keys and sections
+-: Support auto-increment of key names
+-: Support load multiple files to overwrite key values
+```
+
+```go
+cfg.Section("features").KeyStrings() // []{"#1", "#2", "#3"}
+```
+
+### Map To Struct
+
+Want more objective way to play with INI? Cool.
+
+```ini
+Name = Unknwon
+age = 21
+Male = true
+Born = 1993-01-01T20:17:05Z
+
+[Note]
+Content = Hi is a good man!
+Cities = HangZhou, Boston
+```
+
+```go
+type Note struct {
+ Content string
+ Cities []string
+}
+
+type Person struct {
+ Name string
+ Age int `ini:"age"`
+ Male bool
+ Born time.Time
+ Note
+ Created time.Time `ini:"-"`
+}
+
+func main() {
+ cfg, err := ini.Load("path/to/ini")
+ // ...
+ p := new(Person)
+ err = cfg.MapTo(p)
+ // ...
+
+ // Things can be simpler.
+ err = ini.MapTo(p, "path/to/ini")
+ // ...
+
+ // Just map a section? Fine.
+ n := new(Note)
+ err = cfg.Section("Note").MapTo(n)
+ // ...
+}
+```
+
+Can I have default value for field? Absolutely.
+
+Assign it before you map to struct. It will keep the value as it is if the key is not presented or got wrong type.
+
+```go
+// ...
+p := &Person{
+ Name: "Joe",
+}
+// ...
+```
+
+It's really cool, but what's the point if you can't give me my file back from struct?
+
+### Reflect From Struct
+
+Why not?
+
+```go
+type Embeded struct {
+ Dates []time.Time `delim:"|"`
+ Places []string
+ None []int
+}
+
+type Author struct {
+ Name string `ini:"NAME"`
+ Male bool
+ Age int
+ GPA float64
+ NeverMind string `ini:"-"`
+ *Embeded
+}
+
+func main() {
+ a := &Author{"Unknwon", true, 21, 2.8, "",
+ &Embeded{
+ []time.Time{time.Now(), time.Now()},
+ []string{"HangZhou", "Boston"},
+ []int{},
+ }}
+ cfg := ini.Empty()
+ err = ini.ReflectFrom(cfg, a)
+ // ...
+}
+```
+
+So, what do I get?
+
+```ini
+NAME = Unknwon
+Male = true
+Age = 21
+GPA = 2.8
+
+[Embeded]
+Dates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00
+Places = HangZhou,Boston
+None =
+```
+
+#### Name Mapper
+
+To save your time and make your code cleaner, this library supports [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) between struct field and actual section and key name.
+
+There are 2 built-in name mappers:
+
+- `AllCapsUnderscore`: it converts to format `ALL_CAPS_UNDERSCORE` then match section or key.
+- `TitleUnderscore`: it converts to format `title_underscore` then match section or key.
+
+To use them:
+
+```go
+type Info struct {
+ PackageName string
+}
+
+func main() {
+ err = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte("packag_name=ini"))
+ // ...
+
+ cfg, err := ini.Load([]byte("PACKAGE_NAME=ini"))
+ // ...
+ info := new(Info)
+ cfg.NameMapper = ini.AllCapsUnderscore
+ err = cfg.MapTo(info)
+ // ...
+}
+```
+
+Same rules of name mapper apply to `ini.ReflectFromWithMapper` function.
+
+#### Other Notes On Map/Reflect
+
+Any embedded struct is treated as a section by default, and there is no automatic parent-child relations in map/reflect feature:
+
+```go
+type Child struct {
+ Age string
+}
+
+type Parent struct {
+ Name string
+ Child
+}
+
+type Config struct {
+ City string
+ Parent
+}
+```
+
+Example configuration:
+
+```ini
+City = Boston
+
+[Parent]
+Name = Unknwon
+
+[Child]
+Age = 21
+```
+
+What if, yes, I'm paranoid, I want embedded struct to be in the same section. Well, all roads lead to Rome.
+
+```go
+type Child struct {
+ Age string
+}
+
+type Parent struct {
+ Name string
+ Child `ini:"Parent"`
+}
+
+type Config struct {
+ City string
+ Parent
+}
+```
+
+Example configuration:
+
+```ini
+City = Boston
+
+[Parent]
+Name = Unknwon
+Age = 21
+```
+
+## Getting Help
+
+- [API Documentation](https://gowalker.org/gopkg.in/ini.v1)
+- [File An Issue](https://github.com/go-ini/ini/issues/new)
+
+## FAQs
+
+### What does `BlockMode` field do?
+
+By default, library lets you read and write values so we need a locker to make sure your data is safe. But in cases that you are very sure about only reading data through the library, you can set `cfg.BlockMode = false` to speed up read operations about **50-70%** faster.
+
+### Why another INI library?
+
+Many people are using my another INI library [goconfig](https://github.com/Unknwon/goconfig), so the reason for this one is I would like to make more Go style code. Also when you set `cfg.BlockMode = false`, this one is about **10-30%** faster.
+
+To make those changes I have to confirm API broken, so it's safer to keep it in another place and start using `gopkg.in` to version my package at this time.(PS: shorter import path)
+
+## License
+
+This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md b/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md
new file mode 100644
index 00000000000..45e19edddff
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md
@@ -0,0 +1,547 @@
+本包提供了 Go 语言中读写 INI 文件的功能。
+
+## 功能特性
+
+- 支持覆盖加载多个数据源(`[]byte` 或文件)
+- 支持递归读取键值
+- 支持读取父子分区
+- 支持读取自增键名
+- 支持读取多行的键值
+- 支持大量辅助方法
+- 支持在读取时直接转换为 Go 语言类型
+- 支持读取和 **写入** 分区和键的注释
+- 轻松操作分区、键值和注释
+- 在保存文件时分区和键值会保持原有的顺序
+
+## 下载安装
+
+ go get gopkg.in/ini.v1
+
+## 开始使用
+
+### 从数据源加载
+
+一个 **数据源** 可以是 `[]byte` 类型的原始数据,或 `string` 类型的文件路径。您可以加载 **任意多个** 数据源。如果您传递其它类型的数据源,则会直接返回错误。
+
+```go
+cfg, err := ini.Load([]byte("raw data"), "filename")
+```
+
+或者从一个空白的文件开始:
+
+```go
+cfg := ini.Empty()
+```
+
+当您在一开始无法决定需要加载哪些数据源时,仍可以使用 **Append()** 在需要的时候加载它们。
+
+```go
+err := cfg.Append("other file", []byte("other raw data"))
+```
+
+### 操作分区(Section)
+
+获取指定分区:
+
+```go
+section, err := cfg.GetSection("section name")
+```
+
+如果您想要获取默认分区,则可以用空字符串代替分区名:
+
+```go
+section, err := cfg.GetSection("")
+```
+
+当您非常确定某个分区是存在的,可以使用以下简便方法:
+
+```go
+section := cfg.Section("")
+```
+
+如果不小心判断错了,要获取的分区其实是不存在的,那会发生什么呢?没事的,它会自动创建并返回一个对应的分区对象给您。
+
+创建一个分区:
+
+```go
+err := cfg.NewSection("new section")
+```
+
+获取所有分区对象或名称:
+
+```go
+sections := cfg.Sections()
+names := cfg.SectionStrings()
+```
+
+### 操作键(Key)
+
+获取某个分区下的键:
+
+```go
+key, err := cfg.Section("").GetKey("key name")
+```
+
+和分区一样,您也可以直接获取键而忽略错误处理:
+
+```go
+key := cfg.Section("").Key("key name")
+```
+
+创建一个新的键:
+
+```go
+err := cfg.Section("").NewKey("name", "value")
+```
+
+获取分区下的所有键或键名:
+
+```go
+keys := cfg.Section("").Keys()
+names := cfg.Section("").KeyStrings()
+```
+
+获取分区下的所有键值对的克隆:
+
+```go
+hash := cfg.GetSection("").KeysHash()
+```
+
+### 操作键值(Value)
+
+获取一个类型为字符串(string)的值:
+
+```go
+val := cfg.Section("").Key("key name").String()
+```
+
+获取值的同时通过自定义函数进行处理验证:
+
+```go
+val := cfg.Section("").Key("key name").Validate(func(in string) string {
+ if len(in) == 0 {
+ return "default"
+ }
+ return in
+})
+```
+
+获取其它类型的值:
+
+```go
+// 布尔值的规则:
+// true 当值为:1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On
+// false 当值为:0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off
+v, err = cfg.Section("").Key("BOOL").Bool()
+v, err = cfg.Section("").Key("FLOAT64").Float64()
+v, err = cfg.Section("").Key("INT").Int()
+v, err = cfg.Section("").Key("INT64").Int64()
+v, err = cfg.Section("").Key("UINT").Uint()
+v, err = cfg.Section("").Key("UINT64").Uint64()
+v, err = cfg.Section("").Key("TIME").TimeFormat(time.RFC3339)
+v, err = cfg.Section("").Key("TIME").Time() // RFC3339
+
+v = cfg.Section("").Key("BOOL").MustBool()
+v = cfg.Section("").Key("FLOAT64").MustFloat64()
+v = cfg.Section("").Key("INT").MustInt()
+v = cfg.Section("").Key("INT64").MustInt64()
+v = cfg.Section("").Key("UINT").MustUint()
+v = cfg.Section("").Key("UINT64").MustUint64()
+v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339)
+v = cfg.Section("").Key("TIME").MustTime() // RFC3339
+
+// 由 Must 开头的方法名允许接收一个相同类型的参数来作为默认值,
+// 当键不存在或者转换失败时,则会直接返回该默认值。
+// 但是,MustString 方法必须传递一个默认值。
+
+v = cfg.Seciont("").Key("String").MustString("default")
+v = cfg.Section("").Key("BOOL").MustBool(true)
+v = cfg.Section("").Key("FLOAT64").MustFloat64(1.25)
+v = cfg.Section("").Key("INT").MustInt(10)
+v = cfg.Section("").Key("INT64").MustInt64(99)
+v = cfg.Section("").Key("UINT").MustUint(3)
+v = cfg.Section("").Key("UINT64").MustUint64(6)
+v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339, time.Now())
+v = cfg.Section("").Key("TIME").MustTime(time.Now()) // RFC3339
+```
+
+如果我的值有好多行怎么办?
+
+```ini
+[advance]
+ADDRESS = """404 road,
+NotFound, State, 5000
+Earth"""
+```
+
+嗯哼?小 case!
+
+```go
+cfg.Section("advance").Key("ADDRESS").String()
+
+/* --- start ---
+404 road,
+NotFound, State, 5000
+Earth
+------ end --- */
+```
+
+赞爆了!那要是我属于一行的内容写不下想要写到第二行怎么办?
+
+```ini
+[advance]
+two_lines = how about \
+ continuation lines?
+lots_of_lines = 1 \
+ 2 \
+ 3 \
+ 4
+```
+
+简直是小菜一碟!
+
+```go
+cfg.Section("advance").Key("two_lines").String() // how about continuation lines?
+cfg.Section("advance").Key("lots_of_lines").String() // 1 2 3 4
+```
+
+需要注意的是,值两侧的单引号会被自动剔除:
+
+```ini
+foo = "some value" // foo: some value
+bar = 'some value' // bar: some value
+```
+
+这就是全部了?哈哈,当然不是。
+
+#### 操作键值的辅助方法
+
+获取键值时设定候选值:
+
+```go
+v = cfg.Section("").Key("STRING").In("default", []string{"str", "arr", "types"})
+v = cfg.Section("").Key("FLOAT64").InFloat64(1.1, []float64{1.25, 2.5, 3.75})
+v = cfg.Section("").Key("INT").InInt(5, []int{10, 20, 30})
+v = cfg.Section("").Key("INT64").InInt64(10, []int64{10, 20, 30})
+v = cfg.Section("").Key("UINT").InUint(4, []int{3, 6, 9})
+v = cfg.Section("").Key("UINT64").InUint64(8, []int64{3, 6, 9})
+v = cfg.Section("").Key("TIME").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3})
+v = cfg.Section("").Key("TIME").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339
+```
+
+如果获取到的值不是候选值的任意一个,则会返回默认值,而默认值不需要是候选值中的一员。
+
+验证获取的值是否在指定范围内:
+
+```go
+vals = cfg.Section("").Key("FLOAT64").RangeFloat64(0.0, 1.1, 2.2)
+vals = cfg.Section("").Key("INT").RangeInt(0, 10, 20)
+vals = cfg.Section("").Key("INT64").RangeInt64(0, 10, 20)
+vals = cfg.Section("").Key("UINT").RangeUint(0, 3, 9)
+vals = cfg.Section("").Key("UINT64").RangeUint64(0, 3, 9)
+vals = cfg.Section("").Key("TIME").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime)
+vals = cfg.Section("").Key("TIME").RangeTime(time.Now(), minTime, maxTime) // RFC3339
+```
+
+自动分割键值为切片(slice):
+
+```go
+vals = cfg.Section("").Key("STRINGS").Strings(",")
+vals = cfg.Section("").Key("FLOAT64S").Float64s(",")
+vals = cfg.Section("").Key("INTS").Ints(",")
+vals = cfg.Section("").Key("INT64S").Int64s(",")
+vals = cfg.Section("").Key("UINTS").Uints(",")
+vals = cfg.Section("").Key("UINT64S").Uint64s(",")
+vals = cfg.Section("").Key("TIMES").Times(",")
+```
+
+### 保存配置
+
+终于到了这个时刻,是时候保存一下配置了。
+
+比较原始的做法是输出配置到某个文件:
+
+```go
+// ...
+err = cfg.SaveTo("my.ini")
+err = cfg.SaveToIndent("my.ini", "\t")
+```
+
+另一个比较高级的做法是写入到任何实现 `io.Writer` 接口的对象中:
+
+```go
+// ...
+cfg.WriteTo(writer)
+cfg.WriteToIndent(writer, "\t")
+```
+
+### 高级用法
+
+#### 递归读取键值
+
+在获取所有键值的过程中,特殊语法 `%()s` 会被应用,其中 `` 可以是相同分区或者默认分区下的键名。字符串 `%()s` 会被相应的键值所替代,如果指定的键不存在,则会用空字符串替代。您可以最多使用 99 层的递归嵌套。
+
+```ini
+NAME = ini
+
+[author]
+NAME = Unknwon
+GITHUB = https://github.com/%(NAME)s
+
+[package]
+FULL_NAME = github.com/go-ini/%(NAME)s
+```
+
+```go
+cfg.Section("author").Key("GITHUB").String() // https://github.com/Unknwon
+cfg.Section("package").Key("FULL_NAME").String() // github.com/go-ini/ini
+```
+
+#### 读取父子分区
+
+您可以在分区名称中使用 `.` 来表示两个或多个分区之间的父子关系。如果某个键在子分区中不存在,则会去它的父分区中再次寻找,直到没有父分区为止。
+
+```ini
+NAME = ini
+VERSION = v1
+IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s
+
+[package]
+CLONE_URL = https://%(IMPORT_PATH)s
+
+[package.sub]
+```
+
+```go
+cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1
+```
+
+#### 读取自增键名
+
+如果数据源中的键名为 `-`,则认为该键使用了自增键名的特殊语法。计数器从 1 开始,并且分区之间是相互独立的。
+
+```ini
+[features]
+-: Support read/write comments of keys and sections
+-: Support auto-increment of key names
+-: Support load multiple files to overwrite key values
+```
+
+```go
+cfg.Section("features").KeyStrings() // []{"#1", "#2", "#3"}
+```
+
+### 映射到结构
+
+想要使用更加面向对象的方式玩转 INI 吗?好主意。
+
+```ini
+Name = Unknwon
+age = 21
+Male = true
+Born = 1993-01-01T20:17:05Z
+
+[Note]
+Content = Hi is a good man!
+Cities = HangZhou, Boston
+```
+
+```go
+type Note struct {
+ Content string
+ Cities []string
+}
+
+type Person struct {
+ Name string
+ Age int `ini:"age"`
+ Male bool
+ Born time.Time
+ Note
+ Created time.Time `ini:"-"`
+}
+
+func main() {
+ cfg, err := ini.Load("path/to/ini")
+ // ...
+ p := new(Person)
+ err = cfg.MapTo(p)
+ // ...
+
+ // 一切竟可以如此的简单。
+ err = ini.MapTo(p, "path/to/ini")
+ // ...
+
+ // 嗯哼?只需要映射一个分区吗?
+ n := new(Note)
+ err = cfg.Section("Note").MapTo(n)
+ // ...
+}
+```
+
+结构的字段怎么设置默认值呢?很简单,只要在映射之前对指定字段进行赋值就可以了。如果键未找到或者类型错误,该值不会发生改变。
+
+```go
+// ...
+p := &Person{
+ Name: "Joe",
+}
+// ...
+```
+
+这样玩 INI 真的好酷啊!然而,如果不能还给我原来的配置文件,有什么卵用?
+
+### 从结构反射
+
+可是,我有说不能吗?
+
+```go
+type Embeded struct {
+ Dates []time.Time `delim:"|"`
+ Places []string
+ None []int
+}
+
+type Author struct {
+ Name string `ini:"NAME"`
+ Male bool
+ Age int
+ GPA float64
+ NeverMind string `ini:"-"`
+ *Embeded
+}
+
+func main() {
+ a := &Author{"Unknwon", true, 21, 2.8, "",
+ &Embeded{
+ []time.Time{time.Now(), time.Now()},
+ []string{"HangZhou", "Boston"},
+ []int{},
+ }}
+ cfg := ini.Empty()
+ err = ini.ReflectFrom(cfg, a)
+ // ...
+}
+```
+
+瞧瞧,奇迹发生了。
+
+```ini
+NAME = Unknwon
+Male = true
+Age = 21
+GPA = 2.8
+
+[Embeded]
+Dates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00
+Places = HangZhou,Boston
+None =
+```
+
+#### 名称映射器(Name Mapper)
+
+为了节省您的时间并简化代码,本库支持类型为 [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) 的名称映射器,该映射器负责结构字段名与分区名和键名之间的映射。
+
+目前有 2 款内置的映射器:
+
+- `AllCapsUnderscore`:该映射器将字段名转换至格式 `ALL_CAPS_UNDERSCORE` 后再去匹配分区名和键名。
+- `TitleUnderscore`:该映射器将字段名转换至格式 `title_underscore` 后再去匹配分区名和键名。
+
+使用方法:
+
+```go
+type Info struct{
+ PackageName string
+}
+
+func main() {
+ err = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte("packag_name=ini"))
+ // ...
+
+ cfg, err := ini.Load([]byte("PACKAGE_NAME=ini"))
+ // ...
+ info := new(Info)
+ cfg.NameMapper = ini.AllCapsUnderscore
+ err = cfg.MapTo(info)
+ // ...
+}
+```
+
+使用函数 `ini.ReflectFromWithMapper` 时也可应用相同的规则。
+
+#### 映射/反射的其它说明
+
+任何嵌入的结构都会被默认认作一个不同的分区,并且不会自动产生所谓的父子分区关联:
+
+```go
+type Child struct {
+ Age string
+}
+
+type Parent struct {
+ Name string
+ Child
+}
+
+type Config struct {
+ City string
+ Parent
+}
+```
+
+示例配置文件:
+
+```ini
+City = Boston
+
+[Parent]
+Name = Unknwon
+
+[Child]
+Age = 21
+```
+
+很好,但是,我就是要嵌入结构也在同一个分区。好吧,你爹是李刚!
+
+```go
+type Child struct {
+ Age string
+}
+
+type Parent struct {
+ Name string
+ Child `ini:"Parent"`
+}
+
+type Config struct {
+ City string
+ Parent
+}
+```
+
+示例配置文件:
+
+```ini
+City = Boston
+
+[Parent]
+Name = Unknwon
+Age = 21
+```
+
+## 获取帮助
+
+- [API 文档](https://gowalker.org/gopkg.in/ini.v1)
+- [创建工单](https://github.com/go-ini/ini/issues/new)
+
+## 常见问题
+
+### 字段 `BlockMode` 是什么?
+
+默认情况下,本库会在您进行读写操作时采用锁机制来确保数据时间。但在某些情况下,您非常确定只进行读操作。此时,您可以通过设置 `cfg.BlockMode = false` 来将读操作提升大约 **50-70%** 的性能。
+
+### 为什么要写另一个 INI 解析库?
+
+许多人都在使用我的 [goconfig](https://github.com/Unknwon/goconfig) 来完成对 INI 文件的操作,但我希望使用更加 Go 风格的代码。并且当您设置 `cfg.BlockMode = false` 时,会有大约 **10-30%** 的性能提升。
+
+为了做出这些改变,我必须对 API 进行破坏,所以新开一个仓库是最安全的做法。除此之外,本库直接使用 `gopkg.in` 来进行版本化发布。(其实真相是导入路径更短了)
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/ini.go b/Godeps/_workspace/src/github.com/go-ini/ini/ini.go
new file mode 100644
index 00000000000..1fee789a1d6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/ini.go
@@ -0,0 +1,1226 @@
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+// Package ini provides INI file read and write functionality in Go.
+package ini
+
+import (
+ "bufio"
+ "bytes"
+ "errors"
+ "fmt"
+ "io"
+ "os"
+ "regexp"
+ "runtime"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+)
+
+const (
+ DEFAULT_SECTION = "DEFAULT"
+ // Maximum allowed depth when recursively substituing variable names.
+ _DEPTH_VALUES = 99
+
+ _VERSION = "1.6.0"
+)
+
+func Version() string {
+ return _VERSION
+}
+
+var (
+ LineBreak = "\n"
+
+ // Variable regexp pattern: %(variable)s
+ varPattern = regexp.MustCompile(`%\(([^\)]+)\)s`)
+
+ // Write spaces around "=" to look better.
+ PrettyFormat = true
+)
+
+func init() {
+ if runtime.GOOS == "windows" {
+ LineBreak = "\r\n"
+ }
+}
+
+func inSlice(str string, s []string) bool {
+ for _, v := range s {
+ if str == v {
+ return true
+ }
+ }
+ return false
+}
+
+// dataSource is a interface that returns file content.
+type dataSource interface {
+ ReadCloser() (io.ReadCloser, error)
+}
+
+type sourceFile struct {
+ name string
+}
+
+func (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) {
+ return os.Open(s.name)
+}
+
+type bytesReadCloser struct {
+ reader io.Reader
+}
+
+func (rc *bytesReadCloser) Read(p []byte) (n int, err error) {
+ return rc.reader.Read(p)
+}
+
+func (rc *bytesReadCloser) Close() error {
+ return nil
+}
+
+type sourceData struct {
+ data []byte
+}
+
+func (s *sourceData) ReadCloser() (io.ReadCloser, error) {
+ return &bytesReadCloser{bytes.NewReader(s.data)}, nil
+}
+
+// ____ __.
+// | |/ _|____ ___.__.
+// | <_/ __ < | |
+// | | \ ___/\___ |
+// |____|__ \___ > ____|
+// \/ \/\/
+
+// Key represents a key under a section.
+type Key struct {
+ s *Section
+ Comment string
+ name string
+ value string
+ isAutoIncr bool
+}
+
+// Name returns name of key.
+func (k *Key) Name() string {
+ return k.name
+}
+
+// Value returns raw value of key for performance purpose.
+func (k *Key) Value() string {
+ return k.value
+}
+
+// String returns string representation of value.
+func (k *Key) String() string {
+ val := k.value
+ if strings.Index(val, "%") == -1 {
+ return val
+ }
+
+ for i := 0; i < _DEPTH_VALUES; i++ {
+ vr := varPattern.FindString(val)
+ if len(vr) == 0 {
+ break
+ }
+
+ // Take off leading '%(' and trailing ')s'.
+ noption := strings.TrimLeft(vr, "%(")
+ noption = strings.TrimRight(noption, ")s")
+
+ // Search in the same section.
+ nk, err := k.s.GetKey(noption)
+ if err != nil {
+ // Search again in default section.
+ nk, _ = k.s.f.Section("").GetKey(noption)
+ }
+
+ // Substitute by new value and take off leading '%(' and trailing ')s'.
+ val = strings.Replace(val, vr, nk.value, -1)
+ }
+ return val
+}
+
+// Validate accepts a validate function which can
+// return modifed result as key value.
+func (k *Key) Validate(fn func(string) string) string {
+ return fn(k.String())
+}
+
+// parseBool returns the boolean value represented by the string.
+//
+// It accepts 1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On,
+// 0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off.
+// Any other value returns an error.
+func parseBool(str string) (value bool, err error) {
+ switch str {
+ case "1", "t", "T", "true", "TRUE", "True", "YES", "yes", "Yes", "ON", "on", "On":
+ return true, nil
+ case "0", "f", "F", "false", "FALSE", "False", "NO", "no", "No", "OFF", "off", "Off":
+ return false, nil
+ }
+ return false, fmt.Errorf("parsing \"%s\": invalid syntax", str)
+}
+
+// Bool returns bool type value.
+func (k *Key) Bool() (bool, error) {
+ return parseBool(k.String())
+}
+
+// Float64 returns float64 type value.
+func (k *Key) Float64() (float64, error) {
+ return strconv.ParseFloat(k.String(), 64)
+}
+
+// Int returns int type value.
+func (k *Key) Int() (int, error) {
+ return strconv.Atoi(k.String())
+}
+
+// Int64 returns int64 type value.
+func (k *Key) Int64() (int64, error) {
+ return strconv.ParseInt(k.String(), 10, 64)
+}
+
+// Uint returns uint type valued.
+func (k *Key) Uint() (uint, error) {
+ u, e := strconv.ParseUint(k.String(), 10, 64)
+ return uint(u), e
+}
+
+// Uint64 returns uint64 type value.
+func (k *Key) Uint64() (uint64, error) {
+ return strconv.ParseUint(k.String(), 10, 64)
+}
+
+// Duration returns time.Duration type value.
+func (k *Key) Duration() (time.Duration, error) {
+ return time.ParseDuration(k.String())
+}
+
+// TimeFormat parses with given format and returns time.Time type value.
+func (k *Key) TimeFormat(format string) (time.Time, error) {
+ return time.Parse(format, k.String())
+}
+
+// Time parses with RFC3339 format and returns time.Time type value.
+func (k *Key) Time() (time.Time, error) {
+ return k.TimeFormat(time.RFC3339)
+}
+
+// MustString returns default value if key value is empty.
+func (k *Key) MustString(defaultVal string) string {
+ val := k.String()
+ if len(val) == 0 {
+ return defaultVal
+ }
+ return val
+}
+
+// MustBool always returns value without error,
+// it returns false if error occurs.
+func (k *Key) MustBool(defaultVal ...bool) bool {
+ val, err := k.Bool()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustFloat64 always returns value without error,
+// it returns 0.0 if error occurs.
+func (k *Key) MustFloat64(defaultVal ...float64) float64 {
+ val, err := k.Float64()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustInt always returns value without error,
+// it returns 0 if error occurs.
+func (k *Key) MustInt(defaultVal ...int) int {
+ val, err := k.Int()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustInt64 always returns value without error,
+// it returns 0 if error occurs.
+func (k *Key) MustInt64(defaultVal ...int64) int64 {
+ val, err := k.Int64()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustUint always returns value without error,
+// it returns 0 if error occurs.
+func (k *Key) MustUint(defaultVal ...uint) uint {
+ val, err := k.Uint()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustUint64 always returns value without error,
+// it returns 0 if error occurs.
+func (k *Key) MustUint64(defaultVal ...uint64) uint64 {
+ val, err := k.Uint64()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustDuration always returns value without error,
+// it returns zero value if error occurs.
+func (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration {
+ val, err := k.Duration()
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustTimeFormat always parses with given format and returns value without error,
+// it returns zero value if error occurs.
+func (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) time.Time {
+ val, err := k.TimeFormat(format)
+ if len(defaultVal) > 0 && err != nil {
+ return defaultVal[0]
+ }
+ return val
+}
+
+// MustTime always parses with RFC3339 format and returns value without error,
+// it returns zero value if error occurs.
+func (k *Key) MustTime(defaultVal ...time.Time) time.Time {
+ return k.MustTimeFormat(time.RFC3339, defaultVal...)
+}
+
+// In always returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) In(defaultVal string, candidates []string) string {
+ val := k.String()
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InFloat64 always returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InFloat64(defaultVal float64, candidates []float64) float64 {
+ val := k.MustFloat64()
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InInt always returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InInt(defaultVal int, candidates []int) int {
+ val := k.MustInt()
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InInt64 always returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InInt64(defaultVal int64, candidates []int64) int64 {
+ val := k.MustInt64()
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InUint always returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InUint(defaultVal uint, candidates []uint) uint {
+ val := k.MustUint()
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InUint64 always returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 {
+ val := k.MustUint64()
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InTimeFormat always parses with given format and returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InTimeFormat(format string, defaultVal time.Time, candidates []time.Time) time.Time {
+ val := k.MustTimeFormat(format)
+ for _, cand := range candidates {
+ if val == cand {
+ return val
+ }
+ }
+ return defaultVal
+}
+
+// InTime always parses with RFC3339 format and returns value without error,
+// it returns default value if error occurs or doesn't fit into candidates.
+func (k *Key) InTime(defaultVal time.Time, candidates []time.Time) time.Time {
+ return k.InTimeFormat(time.RFC3339, defaultVal, candidates)
+}
+
+// RangeFloat64 checks if value is in given range inclusively,
+// and returns default value if it's not.
+func (k *Key) RangeFloat64(defaultVal, min, max float64) float64 {
+ val := k.MustFloat64()
+ if val < min || val > max {
+ return defaultVal
+ }
+ return val
+}
+
+// RangeInt checks if value is in given range inclusively,
+// and returns default value if it's not.
+func (k *Key) RangeInt(defaultVal, min, max int) int {
+ val := k.MustInt()
+ if val < min || val > max {
+ return defaultVal
+ }
+ return val
+}
+
+// RangeInt64 checks if value is in given range inclusively,
+// and returns default value if it's not.
+func (k *Key) RangeInt64(defaultVal, min, max int64) int64 {
+ val := k.MustInt64()
+ if val < min || val > max {
+ return defaultVal
+ }
+ return val
+}
+
+// RangeTimeFormat checks if value with given format is in given range inclusively,
+// and returns default value if it's not.
+func (k *Key) RangeTimeFormat(format string, defaultVal, min, max time.Time) time.Time {
+ val := k.MustTimeFormat(format)
+ if val.Unix() < min.Unix() || val.Unix() > max.Unix() {
+ return defaultVal
+ }
+ return val
+}
+
+// RangeTime checks if value with RFC3339 format is in given range inclusively,
+// and returns default value if it's not.
+func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time {
+ return k.RangeTimeFormat(time.RFC3339, defaultVal, min, max)
+}
+
+// Strings returns list of string devide by given delimiter.
+func (k *Key) Strings(delim string) []string {
+ str := k.String()
+ if len(str) == 0 {
+ return []string{}
+ }
+
+ vals := strings.Split(str, delim)
+ for i := range vals {
+ vals[i] = strings.TrimSpace(vals[i])
+ }
+ return vals
+}
+
+// Float64s returns list of float64 devide by given delimiter.
+func (k *Key) Float64s(delim string) []float64 {
+ strs := k.Strings(delim)
+ vals := make([]float64, len(strs))
+ for i := range strs {
+ vals[i], _ = strconv.ParseFloat(strs[i], 64)
+ }
+ return vals
+}
+
+// Ints returns list of int devide by given delimiter.
+func (k *Key) Ints(delim string) []int {
+ strs := k.Strings(delim)
+ vals := make([]int, len(strs))
+ for i := range strs {
+ vals[i], _ = strconv.Atoi(strs[i])
+ }
+ return vals
+}
+
+// Int64s returns list of int64 devide by given delimiter.
+func (k *Key) Int64s(delim string) []int64 {
+ strs := k.Strings(delim)
+ vals := make([]int64, len(strs))
+ for i := range strs {
+ vals[i], _ = strconv.ParseInt(strs[i], 10, 64)
+ }
+ return vals
+}
+
+// Uints returns list of uint devide by given delimiter.
+func (k *Key) Uints(delim string) []uint {
+ strs := k.Strings(delim)
+ vals := make([]uint, len(strs))
+ for i := range strs {
+ u, _ := strconv.ParseUint(strs[i], 10, 64)
+ vals[i] = uint(u)
+ }
+ return vals
+}
+
+// Uint64s returns list of uint64 devide by given delimiter.
+func (k *Key) Uint64s(delim string) []uint64 {
+ strs := k.Strings(delim)
+ vals := make([]uint64, len(strs))
+ for i := range strs {
+ vals[i], _ = strconv.ParseUint(strs[i], 10, 64)
+ }
+ return vals
+}
+
+// TimesFormat parses with given format and returns list of time.Time devide by given delimiter.
+func (k *Key) TimesFormat(format, delim string) []time.Time {
+ strs := k.Strings(delim)
+ vals := make([]time.Time, len(strs))
+ for i := range strs {
+ vals[i], _ = time.Parse(format, strs[i])
+ }
+ return vals
+}
+
+// Times parses with RFC3339 format and returns list of time.Time devide by given delimiter.
+func (k *Key) Times(delim string) []time.Time {
+ return k.TimesFormat(time.RFC3339, delim)
+}
+
+// SetValue changes key value.
+func (k *Key) SetValue(v string) {
+ k.value = v
+}
+
+// _________ __ .__
+// / _____/ ____ _____/ |_|__| ____ ____
+// \_____ \_/ __ \_/ ___\ __\ |/ _ \ / \
+// / \ ___/\ \___| | | ( <_> ) | \
+// /_______ /\___ >\___ >__| |__|\____/|___| /
+// \/ \/ \/ \/
+
+// Section represents a config section.
+type Section struct {
+ f *File
+ Comment string
+ name string
+ keys map[string]*Key
+ keyList []string
+ keysHash map[string]string
+}
+
+func newSection(f *File, name string) *Section {
+ return &Section{f, "", name, make(map[string]*Key), make([]string, 0, 10), make(map[string]string)}
+}
+
+// Name returns name of Section.
+func (s *Section) Name() string {
+ return s.name
+}
+
+// NewKey creates a new key to given section.
+func (s *Section) NewKey(name, val string) (*Key, error) {
+ if len(name) == 0 {
+ return nil, errors.New("error creating new key: empty key name")
+ }
+
+ if s.f.BlockMode {
+ s.f.lock.Lock()
+ defer s.f.lock.Unlock()
+ }
+
+ if inSlice(name, s.keyList) {
+ s.keys[name].value = val
+ return s.keys[name], nil
+ }
+
+ s.keyList = append(s.keyList, name)
+ s.keys[name] = &Key{s, "", name, val, false}
+ s.keysHash[name] = val
+ return s.keys[name], nil
+}
+
+// GetKey returns key in section by given name.
+func (s *Section) GetKey(name string) (*Key, error) {
+ // FIXME: change to section level lock?
+ if s.f.BlockMode {
+ s.f.lock.RLock()
+ }
+ key := s.keys[name]
+ if s.f.BlockMode {
+ s.f.lock.RUnlock()
+ }
+
+ if key == nil {
+ // Check if it is a child-section.
+ sname := s.name
+ for {
+ if i := strings.LastIndex(sname, "."); i > -1 {
+ sname = sname[:i]
+ sec, err := s.f.GetSection(sname)
+ if err != nil {
+ continue
+ }
+ return sec.GetKey(name)
+ } else {
+ break
+ }
+ }
+ return nil, fmt.Errorf("error when getting key of section '%s': key '%s' not exists", s.name, name)
+ }
+ return key, nil
+}
+
+// Key assumes named Key exists in section and returns a zero-value when not.
+func (s *Section) Key(name string) *Key {
+ key, err := s.GetKey(name)
+ if err != nil {
+ // It's OK here because the only possible error is empty key name,
+ // but if it's empty, this piece of code won't be executed.
+ key, _ = s.NewKey(name, "")
+ return key
+ }
+ return key
+}
+
+// Keys returns list of keys of section.
+func (s *Section) Keys() []*Key {
+ keys := make([]*Key, len(s.keyList))
+ for i := range s.keyList {
+ keys[i] = s.Key(s.keyList[i])
+ }
+ return keys
+}
+
+// KeyStrings returns list of key names of section.
+func (s *Section) KeyStrings() []string {
+ list := make([]string, len(s.keyList))
+ copy(list, s.keyList)
+ return list
+}
+
+// KeysHash returns keys hash consisting of names and values.
+func (s *Section) KeysHash() map[string]string {
+ if s.f.BlockMode {
+ s.f.lock.RLock()
+ defer s.f.lock.RUnlock()
+ }
+
+ hash := map[string]string{}
+ for key, value := range s.keysHash {
+ hash[key] = value
+ }
+ return hash
+}
+
+// DeleteKey deletes a key from section.
+func (s *Section) DeleteKey(name string) {
+ if s.f.BlockMode {
+ s.f.lock.Lock()
+ defer s.f.lock.Unlock()
+ }
+
+ for i, k := range s.keyList {
+ if k == name {
+ s.keyList = append(s.keyList[:i], s.keyList[i+1:]...)
+ delete(s.keys, name)
+ return
+ }
+ }
+}
+
+// ___________.__.__
+// \_ _____/|__| | ____
+// | __) | | | _/ __ \
+// | \ | | |_\ ___/
+// \___ / |__|____/\___ >
+// \/ \/
+
+// File represents a combination of a or more INI file(s) in memory.
+type File struct {
+ // Should make things safe, but sometimes doesn't matter.
+ BlockMode bool
+ // Make sure data is safe in multiple goroutines.
+ lock sync.RWMutex
+
+ // Allow combination of multiple data sources.
+ dataSources []dataSource
+ // Actual data is stored here.
+ sections map[string]*Section
+
+ // To keep data in order.
+ sectionList []string
+
+ NameMapper
+}
+
+// newFile initializes File object with given data sources.
+func newFile(dataSources []dataSource) *File {
+ return &File{
+ BlockMode: true,
+ dataSources: dataSources,
+ sections: make(map[string]*Section),
+ sectionList: make([]string, 0, 10),
+ }
+}
+
+func parseDataSource(source interface{}) (dataSource, error) {
+ switch s := source.(type) {
+ case string:
+ return sourceFile{s}, nil
+ case []byte:
+ return &sourceData{s}, nil
+ default:
+ return nil, fmt.Errorf("error parsing data source: unknown type '%s'", s)
+ }
+}
+
+// Load loads and parses from INI data sources.
+// Arguments can be mixed of file name with string type, or raw data in []byte.
+func Load(source interface{}, others ...interface{}) (_ *File, err error) {
+ sources := make([]dataSource, len(others)+1)
+ sources[0], err = parseDataSource(source)
+ if err != nil {
+ return nil, err
+ }
+ for i := range others {
+ sources[i+1], err = parseDataSource(others[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ f := newFile(sources)
+ return f, f.Reload()
+}
+
+// Empty returns an empty file object.
+func Empty() *File {
+ // Ignore error here, we sure our data is good.
+ f, _ := Load([]byte(""))
+ return f
+}
+
+// NewSection creates a new section.
+func (f *File) NewSection(name string) (*Section, error) {
+ if len(name) == 0 {
+ return nil, errors.New("error creating new section: empty section name")
+ }
+
+ if f.BlockMode {
+ f.lock.Lock()
+ defer f.lock.Unlock()
+ }
+
+ if inSlice(name, f.sectionList) {
+ return f.sections[name], nil
+ }
+
+ f.sectionList = append(f.sectionList, name)
+ f.sections[name] = newSection(f, name)
+ return f.sections[name], nil
+}
+
+// NewSections creates a list of sections.
+func (f *File) NewSections(names ...string) (err error) {
+ for _, name := range names {
+ if _, err = f.NewSection(name); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// GetSection returns section by given name.
+func (f *File) GetSection(name string) (*Section, error) {
+ if len(name) == 0 {
+ name = DEFAULT_SECTION
+ }
+
+ if f.BlockMode {
+ f.lock.RLock()
+ defer f.lock.RUnlock()
+ }
+
+ sec := f.sections[name]
+ if sec == nil {
+ return nil, fmt.Errorf("error when getting section: section '%s' not exists", name)
+ }
+ return sec, nil
+}
+
+// Section assumes named section exists and returns a zero-value when not.
+func (f *File) Section(name string) *Section {
+ sec, err := f.GetSection(name)
+ if err != nil {
+ // Note: It's OK here because the only possible error is empty section name,
+ // but if it's empty, this piece of code won't be executed.
+ sec, _ = f.NewSection(name)
+ return sec
+ }
+ return sec
+}
+
+// Section returns list of Section.
+func (f *File) Sections() []*Section {
+ sections := make([]*Section, len(f.sectionList))
+ for i := range f.sectionList {
+ sections[i] = f.Section(f.sectionList[i])
+ }
+ return sections
+}
+
+// SectionStrings returns list of section names.
+func (f *File) SectionStrings() []string {
+ list := make([]string, len(f.sectionList))
+ copy(list, f.sectionList)
+ return list
+}
+
+// DeleteSection deletes a section.
+func (f *File) DeleteSection(name string) {
+ if f.BlockMode {
+ f.lock.Lock()
+ defer f.lock.Unlock()
+ }
+
+ if len(name) == 0 {
+ name = DEFAULT_SECTION
+ }
+
+ for i, s := range f.sectionList {
+ if s == name {
+ f.sectionList = append(f.sectionList[:i], f.sectionList[i+1:]...)
+ delete(f.sections, name)
+ return
+ }
+ }
+}
+
+func cutComment(str string) string {
+ i := strings.Index(str, "#")
+ if i == -1 {
+ return str
+ }
+ return str[:i]
+}
+
+func checkMultipleLines(buf *bufio.Reader, line, val, valQuote string) (string, error) {
+ isEnd := false
+ for {
+ next, err := buf.ReadString('\n')
+ if err != nil {
+ if err != io.EOF {
+ return "", err
+ }
+ isEnd = true
+ }
+ pos := strings.LastIndex(next, valQuote)
+ if pos > -1 {
+ val += next[:pos]
+ break
+ }
+ val += next
+ if isEnd {
+ return "", fmt.Errorf("error parsing line: missing closing key quote from '%s' to '%s'", line, next)
+ }
+ }
+ return val, nil
+}
+
+func checkContinuationLines(buf *bufio.Reader, val string) (string, bool, error) {
+ isEnd := false
+ for {
+ valLen := len(val)
+ if valLen == 0 || val[valLen-1] != '\\' {
+ break
+ }
+ val = val[:valLen-1]
+
+ next, err := buf.ReadString('\n')
+ if err != nil {
+ if err != io.EOF {
+ return "", isEnd, err
+ }
+ isEnd = true
+ }
+
+ next = strings.TrimSpace(next)
+ if len(next) == 0 {
+ break
+ }
+ val += next
+ }
+ return val, isEnd, nil
+}
+
+// parse parses data through an io.Reader.
+func (f *File) parse(reader io.Reader) error {
+ buf := bufio.NewReader(reader)
+
+ // Handle BOM-UTF8.
+ // http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding
+ mask, err := buf.Peek(3)
+ if err == nil && len(mask) >= 3 && mask[0] == 239 && mask[1] == 187 && mask[2] == 191 {
+ buf.Read(mask)
+ }
+
+ count := 1
+ comments := ""
+ isEnd := false
+
+ section, err := f.NewSection(DEFAULT_SECTION)
+ if err != nil {
+ return err
+ }
+
+ for {
+ line, err := buf.ReadString('\n')
+ line = strings.TrimSpace(line)
+ length := len(line)
+
+ // Check error and ignore io.EOF just for a moment.
+ if err != nil {
+ if err != io.EOF {
+ return fmt.Errorf("error reading next line: %v", err)
+ }
+ // The last line of file could be an empty line.
+ if length == 0 {
+ break
+ }
+ isEnd = true
+ }
+
+ // Skip empty lines.
+ if length == 0 {
+ continue
+ }
+
+ switch {
+ case line[0] == '#' || line[0] == ';': // Comments.
+ if len(comments) == 0 {
+ comments = line
+ } else {
+ comments += LineBreak + line
+ }
+ continue
+ case line[0] == '[' && line[length-1] == ']': // New sction.
+ section, err = f.NewSection(strings.TrimSpace(line[1 : length-1]))
+ if err != nil {
+ return err
+ }
+
+ if len(comments) > 0 {
+ section.Comment = comments
+ comments = ""
+ }
+ // Reset counter.
+ count = 1
+ continue
+ }
+
+ // Other possibilities.
+ var (
+ i int
+ keyQuote string
+ kname string
+ valQuote string
+ val string
+ )
+
+ // Key name surrounded by quotes.
+ if line[0] == '"' {
+ if length > 6 && line[0:3] == `"""` {
+ keyQuote = `"""`
+ } else {
+ keyQuote = `"`
+ }
+ } else if line[0] == '`' {
+ keyQuote = "`"
+ }
+ if len(keyQuote) > 0 {
+ qLen := len(keyQuote)
+ pos := strings.Index(line[qLen:], keyQuote)
+ if pos == -1 {
+ return fmt.Errorf("error parsing line: missing closing key quote: %s", line)
+ }
+ pos = pos + qLen
+ i = strings.IndexAny(line[pos:], "=:")
+ if i < 0 {
+ return fmt.Errorf("error parsing line: key-value delimiter not found: %s", line)
+ } else if i == pos {
+ return fmt.Errorf("error parsing line: key is empty: %s", line)
+ }
+ i = i + pos
+ kname = line[qLen:pos] // Just keep spaces inside quotes.
+ } else {
+ i = strings.IndexAny(line, "=:")
+ if i < 0 {
+ return fmt.Errorf("error parsing line: key-value delimiter not found: %s", line)
+ } else if i == 0 {
+ return fmt.Errorf("error parsing line: key is empty: %s", line)
+ }
+ kname = strings.TrimSpace(line[0:i])
+ }
+
+ isAutoIncr := false
+ // Auto increment.
+ if kname == "-" {
+ isAutoIncr = true
+ kname = "#" + fmt.Sprint(count)
+ count++
+ }
+
+ lineRight := strings.TrimSpace(line[i+1:])
+ lineRightLength := len(lineRight)
+ firstChar := ""
+ if lineRightLength >= 2 {
+ firstChar = lineRight[0:1]
+ }
+ if firstChar == "`" {
+ valQuote = "`"
+ } else if firstChar == `"` {
+ if lineRightLength >= 3 && lineRight[0:3] == `"""` {
+ valQuote = `"""`
+ } else {
+ valQuote = `"`
+ }
+ } else if firstChar == `'` {
+ valQuote = `'`
+ }
+
+ if len(valQuote) > 0 {
+ qLen := len(valQuote)
+ pos := strings.LastIndex(lineRight[qLen:], valQuote)
+ // For multiple-line value check.
+ if pos == -1 {
+ if valQuote == `"` || valQuote == `'` {
+ return fmt.Errorf("error parsing line: single quote does not allow multiple-line value: %s", line)
+ }
+
+ val = lineRight[qLen:] + "\n"
+ val, err = checkMultipleLines(buf, line, val, valQuote)
+ if err != nil {
+ return err
+ }
+ } else {
+ val = lineRight[qLen : pos+qLen]
+ }
+ } else {
+ val = strings.TrimSpace(cutComment(lineRight))
+ val, isEnd, err = checkContinuationLines(buf, val)
+ if err != nil {
+ return err
+ }
+ }
+
+ k, err := section.NewKey(kname, val)
+ if err != nil {
+ return err
+ }
+ k.isAutoIncr = isAutoIncr
+ if len(comments) > 0 {
+ k.Comment = comments
+ comments = ""
+ }
+
+ if isEnd {
+ break
+ }
+ }
+ return nil
+}
+
+func (f *File) reload(s dataSource) error {
+ r, err := s.ReadCloser()
+ if err != nil {
+ return err
+ }
+ defer r.Close()
+
+ return f.parse(r)
+}
+
+// Reload reloads and parses all data sources.
+func (f *File) Reload() (err error) {
+ for _, s := range f.dataSources {
+ if err = f.reload(s); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// Append appends one or more data sources and reloads automatically.
+func (f *File) Append(source interface{}, others ...interface{}) error {
+ ds, err := parseDataSource(source)
+ if err != nil {
+ return err
+ }
+ f.dataSources = append(f.dataSources, ds)
+ for _, s := range others {
+ ds, err = parseDataSource(s)
+ if err != nil {
+ return err
+ }
+ f.dataSources = append(f.dataSources, ds)
+ }
+ return f.Reload()
+}
+
+// WriteToIndent writes file content into io.Writer with given value indention.
+func (f *File) WriteToIndent(w io.Writer, indent string) (n int64, err error) {
+ equalSign := "="
+ if PrettyFormat {
+ equalSign = " = "
+ }
+
+ // Use buffer to make sure target is safe until finish encoding.
+ buf := bytes.NewBuffer(nil)
+ for i, sname := range f.sectionList {
+ sec := f.Section(sname)
+ if len(sec.Comment) > 0 {
+ if sec.Comment[0] != '#' && sec.Comment[0] != ';' {
+ sec.Comment = "; " + sec.Comment
+ }
+ if _, err = buf.WriteString(sec.Comment + LineBreak); err != nil {
+ return 0, err
+ }
+ }
+
+ if i > 0 {
+ if _, err = buf.WriteString("[" + sname + "]" + LineBreak); err != nil {
+ return 0, err
+ }
+ } else {
+ // Write nothing if default section is empty.
+ if len(sec.keyList) == 0 {
+ continue
+ }
+ }
+
+ for _, kname := range sec.keyList {
+ key := sec.Key(kname)
+ if len(key.Comment) > 0 {
+ if len(indent) > 0 && sname != DEFAULT_SECTION {
+ buf.WriteString(indent)
+ }
+ if key.Comment[0] != '#' && key.Comment[0] != ';' {
+ key.Comment = "; " + key.Comment
+ }
+ if _, err = buf.WriteString(key.Comment + LineBreak); err != nil {
+ return 0, err
+ }
+ }
+
+ if len(indent) > 0 && sname != DEFAULT_SECTION {
+ buf.WriteString(indent)
+ }
+
+ switch {
+ case key.isAutoIncr:
+ kname = "-"
+ case strings.Contains(kname, "`") || strings.Contains(kname, `"`):
+ kname = `"""` + kname + `"""`
+ case strings.Contains(kname, `=`) || strings.Contains(kname, `:`):
+ kname = "`" + kname + "`"
+ }
+
+ val := key.value
+ // In case key value contains "\n", "`" or "\"".
+ if strings.Contains(val, "\n") || strings.Contains(val, "`") || strings.Contains(val, `"`) ||
+ strings.Contains(val, "#") {
+ val = `"""` + val + `"""`
+ }
+ if _, err = buf.WriteString(kname + equalSign + val + LineBreak); err != nil {
+ return 0, err
+ }
+ }
+
+ // Put a line between sections.
+ if _, err = buf.WriteString(LineBreak); err != nil {
+ return 0, err
+ }
+ }
+
+ return buf.WriteTo(w)
+}
+
+// WriteTo writes file content into io.Writer.
+func (f *File) WriteTo(w io.Writer) (int64, error) {
+ return f.WriteToIndent(w, "")
+}
+
+// SaveToIndent writes content to file system with given value indention.
+func (f *File) SaveToIndent(filename, indent string) error {
+ // Note: Because we are truncating with os.Create,
+ // so it's safer to save to a temporary file location and rename afte done.
+ tmpPath := filename + "." + strconv.Itoa(time.Now().Nanosecond()) + ".tmp"
+ defer os.Remove(tmpPath)
+
+ fw, err := os.Create(tmpPath)
+ if err != nil {
+ return err
+ }
+
+ if _, err = f.WriteToIndent(fw, indent); err != nil {
+ fw.Close()
+ return err
+ }
+ fw.Close()
+
+ // Remove old file and rename the new one.
+ os.Remove(filename)
+ return os.Rename(tmpPath, filename)
+}
+
+// SaveTo writes content to file system.
+func (f *File) SaveTo(filename string) error {
+ return f.SaveToIndent(filename, "")
+}
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/ini_test.go b/Godeps/_workspace/src/github.com/go-ini/ini/ini_test.go
new file mode 100644
index 00000000000..82ff36dd236
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/ini_test.go
@@ -0,0 +1,512 @@
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package ini
+
+import (
+ "fmt"
+ "strings"
+ "testing"
+ "time"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func Test_Version(t *testing.T) {
+ Convey("Get version", t, func() {
+ So(Version(), ShouldEqual, _VERSION)
+ })
+}
+
+const _CONF_DATA = `
+; Package name
+NAME = ini
+; Package version
+VERSION = v1
+; Package import path
+IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s
+
+# Information about package author
+# Bio can be written in multiple lines.
+[author]
+NAME = Unknwon # Succeeding comment
+E-MAIL = fake@localhost
+GITHUB = https://github.com/%(NAME)s
+BIO = """Gopher.
+Coding addict.
+Good man.
+""" # Succeeding comment
+
+[package]
+CLONE_URL = https://%(IMPORT_PATH)s
+
+[package.sub]
+UNUSED_KEY = should be deleted
+
+[features]
+-: Support read/write comments of keys and sections
+-: Support auto-increment of key names
+-: Support load multiple files to overwrite key values
+
+[types]
+STRING = str
+BOOL = true
+BOOL_FALSE = false
+FLOAT64 = 1.25
+INT = 10
+TIME = 2015-01-01T20:17:05Z
+DURATION = 2h45m
+UINT = 3
+
+[array]
+STRINGS = en, zh, de
+FLOAT64S = 1.1, 2.2, 3.3
+INTS = 1, 2, 3
+UINTS = 1, 2, 3
+TIMES = 2015-01-01T20:17:05Z,2015-01-01T20:17:05Z,2015-01-01T20:17:05Z
+
+[note]
+empty_lines = next line is empty\
+
+[advance]
+value with quotes = "some value"
+value quote2 again = 'some value'
+true = """"2+3=5""""
+"1+1=2" = true
+"""6+1=7""" = true
+"""` + "`" + `5+5` + "`" + `""" = 10
+""""6+6"""" = 12
+` + "`" + `7-2=4` + "`" + ` = false
+ADDRESS = ` + "`" + `404 road,
+NotFound, State, 50000` + "`" + `
+
+two_lines = how about \
+ continuation lines?
+lots_of_lines = 1 \
+ 2 \
+ 3 \
+ 4 \
+`
+
+func Test_Load(t *testing.T) {
+ Convey("Load from data sources", t, func() {
+
+ Convey("Load with empty data", func() {
+ So(Empty(), ShouldNotBeNil)
+ })
+
+ Convey("Load with multiple data sources", func() {
+ cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini")
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+ })
+ })
+
+ Convey("Bad load process", t, func() {
+
+ Convey("Load from invalid data sources", func() {
+ _, err := Load(_CONF_DATA)
+ So(err, ShouldNotBeNil)
+
+ _, err = Load("testdata/404.ini")
+ So(err, ShouldNotBeNil)
+
+ _, err = Load(1)
+ So(err, ShouldNotBeNil)
+
+ _, err = Load([]byte(""), 1)
+ So(err, ShouldNotBeNil)
+ })
+
+ Convey("Load with empty section name", func() {
+ _, err := Load([]byte("[]"))
+ So(err, ShouldNotBeNil)
+ })
+
+ Convey("Load with bad keys", func() {
+ _, err := Load([]byte(`"""name`))
+ So(err, ShouldNotBeNil)
+
+ _, err = Load([]byte(`"""name"""`))
+ So(err, ShouldNotBeNil)
+
+ _, err = Load([]byte(`""=1`))
+ So(err, ShouldNotBeNil)
+
+ _, err = Load([]byte(`=`))
+ So(err, ShouldNotBeNil)
+
+ _, err = Load([]byte(`name`))
+ So(err, ShouldNotBeNil)
+ })
+
+ Convey("Load with bad values", func() {
+ _, err := Load([]byte(`name="""Unknwon`))
+ So(err, ShouldNotBeNil)
+
+ _, err = Load([]byte(`key = "value`))
+ So(err, ShouldNotBeNil)
+ })
+ })
+}
+
+func Test_Values(t *testing.T) {
+ Convey("Test getting and setting values", t, func() {
+ cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini")
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ Convey("Get values in default section", func() {
+ sec := cfg.Section("")
+ So(sec, ShouldNotBeNil)
+ So(sec.Key("NAME").Value(), ShouldEqual, "ini")
+ So(sec.Key("NAME").String(), ShouldEqual, "ini")
+ So(sec.Key("NAME").Validate(func(in string) string {
+ return in
+ }), ShouldEqual, "ini")
+ So(sec.Key("NAME").Comment, ShouldEqual, "; Package name")
+ So(sec.Key("IMPORT_PATH").String(), ShouldEqual, "gopkg.in/ini.v1")
+ })
+
+ Convey("Get values in non-default section", func() {
+ sec := cfg.Section("author")
+ So(sec, ShouldNotBeNil)
+ So(sec.Key("NAME").String(), ShouldEqual, "Unknwon")
+ So(sec.Key("GITHUB").String(), ShouldEqual, "https://github.com/Unknwon")
+
+ sec = cfg.Section("package")
+ So(sec, ShouldNotBeNil)
+ So(sec.Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1")
+ })
+
+ Convey("Get auto-increment key names", func() {
+ keys := cfg.Section("features").Keys()
+ for i, k := range keys {
+ So(k.Name(), ShouldEqual, fmt.Sprintf("#%d", i+1))
+ }
+ })
+
+ Convey("Get overwrite value", func() {
+ So(cfg.Section("author").Key("E-MAIL").String(), ShouldEqual, "u@gogs.io")
+ })
+
+ Convey("Get sections", func() {
+ sections := cfg.Sections()
+ for i, name := range []string{DEFAULT_SECTION, "author", "package", "package.sub", "features", "types", "array", "note", "advance"} {
+ So(sections[i].Name(), ShouldEqual, name)
+ }
+ })
+
+ Convey("Get parent section value", func() {
+ So(cfg.Section("package.sub").Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1")
+ })
+
+ Convey("Get multiple line value", func() {
+ So(cfg.Section("author").Key("BIO").String(), ShouldEqual, "Gopher.\nCoding addict.\nGood man.\n")
+ })
+
+ Convey("Get values with type", func() {
+ sec := cfg.Section("types")
+ v1, err := sec.Key("BOOL").Bool()
+ So(err, ShouldBeNil)
+ So(v1, ShouldBeTrue)
+
+ v1, err = sec.Key("BOOL_FALSE").Bool()
+ So(err, ShouldBeNil)
+ So(v1, ShouldBeFalse)
+
+ v2, err := sec.Key("FLOAT64").Float64()
+ So(err, ShouldBeNil)
+ So(v2, ShouldEqual, 1.25)
+
+ v3, err := sec.Key("INT").Int()
+ So(err, ShouldBeNil)
+ So(v3, ShouldEqual, 10)
+
+ v4, err := sec.Key("INT").Int64()
+ So(err, ShouldBeNil)
+ So(v4, ShouldEqual, 10)
+
+ v5, err := sec.Key("UINT").Uint()
+ So(err, ShouldBeNil)
+ So(v5, ShouldEqual, 3)
+
+ v6, err := sec.Key("UINT").Uint64()
+ So(err, ShouldBeNil)
+ So(v6, ShouldEqual, 3)
+
+ t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z")
+ So(err, ShouldBeNil)
+ v7, err := sec.Key("TIME").Time()
+ So(err, ShouldBeNil)
+ So(v7.String(), ShouldEqual, t.String())
+
+ Convey("Must get values with type", func() {
+ So(sec.Key("STRING").MustString("404"), ShouldEqual, "str")
+ So(sec.Key("BOOL").MustBool(), ShouldBeTrue)
+ So(sec.Key("FLOAT64").MustFloat64(), ShouldEqual, 1.25)
+ So(sec.Key("INT").MustInt(), ShouldEqual, 10)
+ So(sec.Key("INT").MustInt64(), ShouldEqual, 10)
+ So(sec.Key("UINT").MustUint(), ShouldEqual, 3)
+ So(sec.Key("UINT").MustUint64(), ShouldEqual, 3)
+ So(sec.Key("TIME").MustTime().String(), ShouldEqual, t.String())
+
+ dur, err := time.ParseDuration("2h45m")
+ So(err, ShouldBeNil)
+ So(sec.Key("DURATION").MustDuration().Seconds(), ShouldEqual, dur.Seconds())
+
+ Convey("Must get values with default value", func() {
+ So(sec.Key("STRING_404").MustString("404"), ShouldEqual, "404")
+ So(sec.Key("BOOL_404").MustBool(true), ShouldBeTrue)
+ So(sec.Key("FLOAT64_404").MustFloat64(2.5), ShouldEqual, 2.5)
+ So(sec.Key("INT_404").MustInt(15), ShouldEqual, 15)
+ So(sec.Key("INT_404").MustInt64(15), ShouldEqual, 15)
+ So(sec.Key("UINT_404").MustUint(6), ShouldEqual, 6)
+ So(sec.Key("UINT_404").MustUint64(6), ShouldEqual, 6)
+
+ t, err := time.Parse(time.RFC3339, "2014-01-01T20:17:05Z")
+ So(err, ShouldBeNil)
+ So(sec.Key("TIME_404").MustTime(t).String(), ShouldEqual, t.String())
+
+ So(sec.Key("DURATION_404").MustDuration(dur).Seconds(), ShouldEqual, dur.Seconds())
+ })
+ })
+ })
+
+ Convey("Get value with candidates", func() {
+ sec := cfg.Section("types")
+ So(sec.Key("STRING").In("", []string{"str", "arr", "types"}), ShouldEqual, "str")
+ So(sec.Key("FLOAT64").InFloat64(0, []float64{1.25, 2.5, 3.75}), ShouldEqual, 1.25)
+ So(sec.Key("INT").InInt(0, []int{10, 20, 30}), ShouldEqual, 10)
+ So(sec.Key("INT").InInt64(0, []int64{10, 20, 30}), ShouldEqual, 10)
+ So(sec.Key("UINT").InUint(0, []uint{3, 6, 9}), ShouldEqual, 3)
+ So(sec.Key("UINT").InUint64(0, []uint64{3, 6, 9}), ShouldEqual, 3)
+
+ zt, err := time.Parse(time.RFC3339, "0001-01-01T01:00:00Z")
+ So(err, ShouldBeNil)
+ t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z")
+ So(err, ShouldBeNil)
+ So(sec.Key("TIME").InTime(zt, []time.Time{t, time.Now(), time.Now().Add(1 * time.Second)}).String(), ShouldEqual, t.String())
+
+ Convey("Get value with candidates and default value", func() {
+ So(sec.Key("STRING_404").In("str", []string{"str", "arr", "types"}), ShouldEqual, "str")
+ So(sec.Key("FLOAT64_404").InFloat64(1.25, []float64{1.25, 2.5, 3.75}), ShouldEqual, 1.25)
+ So(sec.Key("INT_404").InInt(10, []int{10, 20, 30}), ShouldEqual, 10)
+ So(sec.Key("INT64_404").InInt64(10, []int64{10, 20, 30}), ShouldEqual, 10)
+ So(sec.Key("UINT_404").InUint(3, []uint{3, 6, 9}), ShouldEqual, 3)
+ So(sec.Key("UINT_404").InUint64(3, []uint64{3, 6, 9}), ShouldEqual, 3)
+ So(sec.Key("TIME_404").InTime(t, []time.Time{time.Now(), time.Now(), time.Now().Add(1 * time.Second)}).String(), ShouldEqual, t.String())
+ })
+ })
+
+ Convey("Get values in range", func() {
+ sec := cfg.Section("types")
+ So(sec.Key("FLOAT64").RangeFloat64(0, 1, 2), ShouldEqual, 1.25)
+ So(sec.Key("INT").RangeInt(0, 10, 20), ShouldEqual, 10)
+ So(sec.Key("INT").RangeInt64(0, 10, 20), ShouldEqual, 10)
+
+ minT, err := time.Parse(time.RFC3339, "0001-01-01T01:00:00Z")
+ So(err, ShouldBeNil)
+ midT, err := time.Parse(time.RFC3339, "2013-01-01T01:00:00Z")
+ So(err, ShouldBeNil)
+ maxT, err := time.Parse(time.RFC3339, "9999-01-01T01:00:00Z")
+ So(err, ShouldBeNil)
+ t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z")
+ So(err, ShouldBeNil)
+ So(sec.Key("TIME").RangeTime(t, minT, maxT).String(), ShouldEqual, t.String())
+
+ Convey("Get value in range with default value", func() {
+ So(sec.Key("FLOAT64").RangeFloat64(5, 0, 1), ShouldEqual, 5)
+ So(sec.Key("INT").RangeInt(7, 0, 5), ShouldEqual, 7)
+ So(sec.Key("INT").RangeInt64(7, 0, 5), ShouldEqual, 7)
+ So(sec.Key("TIME").RangeTime(t, minT, midT).String(), ShouldEqual, t.String())
+ })
+ })
+
+ Convey("Get values into slice", func() {
+ sec := cfg.Section("array")
+ So(strings.Join(sec.Key("STRINGS").Strings(","), ","), ShouldEqual, "en,zh,de")
+ So(len(sec.Key("STRINGS_404").Strings(",")), ShouldEqual, 0)
+
+ vals1 := sec.Key("FLOAT64S").Float64s(",")
+ for i, v := range []float64{1.1, 2.2, 3.3} {
+ So(vals1[i], ShouldEqual, v)
+ }
+
+ vals2 := sec.Key("INTS").Ints(",")
+ for i, v := range []int{1, 2, 3} {
+ So(vals2[i], ShouldEqual, v)
+ }
+
+ vals3 := sec.Key("INTS").Int64s(",")
+ for i, v := range []int64{1, 2, 3} {
+ So(vals3[i], ShouldEqual, v)
+ }
+
+ vals4 := sec.Key("UINTS").Uints(",")
+ for i, v := range []uint{1, 2, 3} {
+ So(vals4[i], ShouldEqual, v)
+ }
+
+ vals5 := sec.Key("UINTS").Uint64s(",")
+ for i, v := range []uint64{1, 2, 3} {
+ So(vals5[i], ShouldEqual, v)
+ }
+
+ t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z")
+ So(err, ShouldBeNil)
+ vals6 := sec.Key("TIMES").Times(",")
+ for i, v := range []time.Time{t, t, t} {
+ So(vals6[i].String(), ShouldEqual, v.String())
+ }
+ })
+
+ Convey("Get key hash", func() {
+ cfg.Section("").KeysHash()
+ })
+
+ Convey("Set key value", func() {
+ k := cfg.Section("author").Key("NAME")
+ k.SetValue("无闻")
+ So(k.String(), ShouldEqual, "无闻")
+ })
+
+ Convey("Get key strings", func() {
+ So(strings.Join(cfg.Section("types").KeyStrings(), ","), ShouldEqual, "STRING,BOOL,BOOL_FALSE,FLOAT64,INT,TIME,DURATION,UINT")
+ })
+
+ Convey("Delete a key", func() {
+ cfg.Section("package.sub").DeleteKey("UNUSED_KEY")
+ _, err := cfg.Section("package.sub").GetKey("UNUSED_KEY")
+ So(err, ShouldNotBeNil)
+ })
+
+ Convey("Get section strings", func() {
+ So(strings.Join(cfg.SectionStrings(), ","), ShouldEqual, "DEFAULT,author,package,package.sub,features,types,array,note,advance")
+ })
+
+ Convey("Delete a section", func() {
+ cfg.DeleteSection("")
+ So(cfg.SectionStrings()[0], ShouldNotEqual, DEFAULT_SECTION)
+ })
+
+ Convey("Create new sections", func() {
+ cfg.NewSections("test", "test2")
+ _, err := cfg.GetSection("test")
+ So(err, ShouldBeNil)
+ _, err = cfg.GetSection("test2")
+ So(err, ShouldBeNil)
+ })
+ })
+
+ Convey("Test getting and setting bad values", t, func() {
+ cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini")
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ Convey("Create new key with empty name", func() {
+ k, err := cfg.Section("").NewKey("", "")
+ So(err, ShouldNotBeNil)
+ So(k, ShouldBeNil)
+ })
+
+ Convey("Create new section with empty name", func() {
+ s, err := cfg.NewSection("")
+ So(err, ShouldNotBeNil)
+ So(s, ShouldBeNil)
+ })
+
+ Convey("Create new sections with empty name", func() {
+ So(cfg.NewSections(""), ShouldNotBeNil)
+ })
+
+ Convey("Get section that not exists", func() {
+ s, err := cfg.GetSection("404")
+ So(err, ShouldNotBeNil)
+ So(s, ShouldBeNil)
+
+ s = cfg.Section("404")
+ So(s, ShouldNotBeNil)
+ })
+ })
+}
+
+func Test_File_Append(t *testing.T) {
+ Convey("Append data sources", t, func() {
+ cfg, err := Load([]byte(""))
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ So(cfg.Append([]byte(""), []byte("")), ShouldBeNil)
+
+ Convey("Append bad data sources", func() {
+ So(cfg.Append(1), ShouldNotBeNil)
+ So(cfg.Append([]byte(""), 1), ShouldNotBeNil)
+ })
+ })
+}
+
+func Test_File_SaveTo(t *testing.T) {
+ Convey("Save file", t, func() {
+ cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini")
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ cfg.Section("").Key("NAME").Comment = "Package name"
+ cfg.Section("author").Comment = `Information about package author
+# Bio can be written in multiple lines.`
+ cfg.Section("advanced").Key("val w/ pound").SetValue("my#password")
+ So(cfg.SaveTo("testdata/conf_out.ini"), ShouldBeNil)
+
+ cfg.Section("author").Key("NAME").Comment = "This is author name"
+ So(cfg.SaveToIndent("testdata/conf_out.ini", "\t"), ShouldBeNil)
+ })
+}
+
+func Benchmark_Key_Value(b *testing.B) {
+ c, _ := Load([]byte(_CONF_DATA))
+ for i := 0; i < b.N; i++ {
+ c.Section("").Key("NAME").Value()
+ }
+}
+
+func Benchmark_Key_String(b *testing.B) {
+ c, _ := Load([]byte(_CONF_DATA))
+ for i := 0; i < b.N; i++ {
+ c.Section("").Key("NAME").String()
+ }
+}
+
+func Benchmark_Key_Value_NonBlock(b *testing.B) {
+ c, _ := Load([]byte(_CONF_DATA))
+ c.BlockMode = false
+ for i := 0; i < b.N; i++ {
+ c.Section("").Key("NAME").Value()
+ }
+}
+
+func Benchmark_Key_String_NonBlock(b *testing.B) {
+ c, _ := Load([]byte(_CONF_DATA))
+ c.BlockMode = false
+ for i := 0; i < b.N; i++ {
+ c.Section("").Key("NAME").String()
+ }
+}
+
+func Benchmark_Key_SetValue(b *testing.B) {
+ c, _ := Load([]byte(_CONF_DATA))
+ for i := 0; i < b.N; i++ {
+ c.Section("").Key("NAME").SetValue("10")
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/struct.go b/Godeps/_workspace/src/github.com/go-ini/ini/struct.go
new file mode 100644
index 00000000000..c1184371010
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/struct.go
@@ -0,0 +1,350 @@
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package ini
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "reflect"
+ "time"
+ "unicode"
+)
+
+// NameMapper represents a ini tag name mapper.
+type NameMapper func(string) string
+
+// Built-in name getters.
+var (
+ // AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE.
+ AllCapsUnderscore NameMapper = func(raw string) string {
+ newstr := make([]rune, 0, len(raw))
+ for i, chr := range raw {
+ if isUpper := 'A' <= chr && chr <= 'Z'; isUpper {
+ if i > 0 {
+ newstr = append(newstr, '_')
+ }
+ }
+ newstr = append(newstr, unicode.ToUpper(chr))
+ }
+ return string(newstr)
+ }
+ // TitleUnderscore converts to format title_underscore.
+ TitleUnderscore NameMapper = func(raw string) string {
+ newstr := make([]rune, 0, len(raw))
+ for i, chr := range raw {
+ if isUpper := 'A' <= chr && chr <= 'Z'; isUpper {
+ if i > 0 {
+ newstr = append(newstr, '_')
+ }
+ chr -= ('A' - 'a')
+ }
+ newstr = append(newstr, chr)
+ }
+ return string(newstr)
+ }
+)
+
+func (s *Section) parseFieldName(raw, actual string) string {
+ if len(actual) > 0 {
+ return actual
+ }
+ if s.f.NameMapper != nil {
+ return s.f.NameMapper(raw)
+ }
+ return raw
+}
+
+func parseDelim(actual string) string {
+ if len(actual) > 0 {
+ return actual
+ }
+ return ","
+}
+
+var reflectTime = reflect.TypeOf(time.Now()).Kind()
+
+// setWithProperType sets proper value to field based on its type,
+// but it does not return error for failing parsing,
+// because we want to use default value that is already assigned to strcut.
+func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error {
+ switch t.Kind() {
+ case reflect.String:
+ if len(key.String()) == 0 {
+ return nil
+ }
+ field.SetString(key.String())
+ case reflect.Bool:
+ boolVal, err := key.Bool()
+ if err != nil {
+ return nil
+ }
+ field.SetBool(boolVal)
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ durationVal, err := key.Duration()
+ if err == nil {
+ field.Set(reflect.ValueOf(durationVal))
+ return nil
+ }
+
+ intVal, err := key.Int64()
+ if err != nil {
+ return nil
+ }
+ field.SetInt(intVal)
+ // byte is an alias for uint8, so supporting uint8 breaks support for byte
+ case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ durationVal, err := key.Duration()
+ if err == nil {
+ field.Set(reflect.ValueOf(durationVal))
+ return nil
+ }
+
+ uintVal, err := key.Uint64()
+ if err != nil {
+ return nil
+ }
+ field.SetUint(uintVal)
+
+ case reflect.Float64:
+ floatVal, err := key.Float64()
+ if err != nil {
+ return nil
+ }
+ field.SetFloat(floatVal)
+ case reflectTime:
+ timeVal, err := key.Time()
+ if err != nil {
+ return nil
+ }
+ field.Set(reflect.ValueOf(timeVal))
+ case reflect.Slice:
+ vals := key.Strings(delim)
+ numVals := len(vals)
+ if numVals == 0 {
+ return nil
+ }
+
+ sliceOf := field.Type().Elem().Kind()
+
+ var times []time.Time
+ if sliceOf == reflectTime {
+ times = key.Times(delim)
+ }
+
+ slice := reflect.MakeSlice(field.Type(), numVals, numVals)
+ for i := 0; i < numVals; i++ {
+ switch sliceOf {
+ case reflectTime:
+ slice.Index(i).Set(reflect.ValueOf(times[i]))
+ default:
+ slice.Index(i).Set(reflect.ValueOf(vals[i]))
+ }
+ }
+ field.Set(slice)
+ default:
+ return fmt.Errorf("unsupported type '%s'", t)
+ }
+ return nil
+}
+
+func (s *Section) mapTo(val reflect.Value) error {
+ if val.Kind() == reflect.Ptr {
+ val = val.Elem()
+ }
+ typ := val.Type()
+
+ for i := 0; i < typ.NumField(); i++ {
+ field := val.Field(i)
+ tpField := typ.Field(i)
+
+ tag := tpField.Tag.Get("ini")
+ if tag == "-" {
+ continue
+ }
+
+ fieldName := s.parseFieldName(tpField.Name, tag)
+ if len(fieldName) == 0 || !field.CanSet() {
+ continue
+ }
+
+ isAnonymous := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous
+ isStruct := tpField.Type.Kind() == reflect.Struct
+ if isAnonymous {
+ field.Set(reflect.New(tpField.Type.Elem()))
+ }
+
+ if isAnonymous || isStruct {
+ if sec, err := s.f.GetSection(fieldName); err == nil {
+ if err = sec.mapTo(field); err != nil {
+ return fmt.Errorf("error mapping field(%s): %v", fieldName, err)
+ }
+ continue
+ }
+ }
+
+ if key, err := s.GetKey(fieldName); err == nil {
+ if err = setWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get("delim"))); err != nil {
+ return fmt.Errorf("error mapping field(%s): %v", fieldName, err)
+ }
+ }
+ }
+ return nil
+}
+
+// MapTo maps section to given struct.
+func (s *Section) MapTo(v interface{}) error {
+ typ := reflect.TypeOf(v)
+ val := reflect.ValueOf(v)
+ if typ.Kind() == reflect.Ptr {
+ typ = typ.Elem()
+ val = val.Elem()
+ } else {
+ return errors.New("cannot map to non-pointer struct")
+ }
+
+ return s.mapTo(val)
+}
+
+// MapTo maps file to given struct.
+func (f *File) MapTo(v interface{}) error {
+ return f.Section("").MapTo(v)
+}
+
+// MapTo maps data sources to given struct with name mapper.
+func MapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error {
+ cfg, err := Load(source, others...)
+ if err != nil {
+ return err
+ }
+ cfg.NameMapper = mapper
+ return cfg.MapTo(v)
+}
+
+// MapTo maps data sources to given struct.
+func MapTo(v, source interface{}, others ...interface{}) error {
+ return MapToWithMapper(v, nil, source, others...)
+}
+
+// reflectWithProperType does the opposite thing with setWithProperType.
+func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error {
+ switch t.Kind() {
+ case reflect.String:
+ key.SetValue(field.String())
+ case reflect.Bool,
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Float64,
+ reflectTime:
+ key.SetValue(fmt.Sprint(field))
+ case reflect.Slice:
+ vals := field.Slice(0, field.Len())
+ if field.Len() == 0 {
+ return nil
+ }
+
+ var buf bytes.Buffer
+ isTime := fmt.Sprint(field.Type()) == "[]time.Time"
+ for i := 0; i < field.Len(); i++ {
+ if isTime {
+ buf.WriteString(vals.Index(i).Interface().(time.Time).Format(time.RFC3339))
+ } else {
+ buf.WriteString(fmt.Sprint(vals.Index(i)))
+ }
+ buf.WriteString(delim)
+ }
+ key.SetValue(buf.String()[:buf.Len()-1])
+ default:
+ return fmt.Errorf("unsupported type '%s'", t)
+ }
+ return nil
+}
+
+func (s *Section) reflectFrom(val reflect.Value) error {
+ if val.Kind() == reflect.Ptr {
+ val = val.Elem()
+ }
+ typ := val.Type()
+
+ for i := 0; i < typ.NumField(); i++ {
+ field := val.Field(i)
+ tpField := typ.Field(i)
+
+ tag := tpField.Tag.Get("ini")
+ if tag == "-" {
+ continue
+ }
+
+ fieldName := s.parseFieldName(tpField.Name, tag)
+ if len(fieldName) == 0 || !field.CanSet() {
+ continue
+ }
+
+ if (tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous) ||
+ (tpField.Type.Kind() == reflect.Struct) {
+ // Note: The only error here is section doesn't exist.
+ sec, err := s.f.GetSection(fieldName)
+ if err != nil {
+ // Note: fieldName can never be empty here, ignore error.
+ sec, _ = s.f.NewSection(fieldName)
+ }
+ if err = sec.reflectFrom(field); err != nil {
+ return fmt.Errorf("error reflecting field(%s): %v", fieldName, err)
+ }
+ continue
+ }
+
+ // Note: Same reason as secion.
+ key, err := s.GetKey(fieldName)
+ if err != nil {
+ key, _ = s.NewKey(fieldName, "")
+ }
+ if err = reflectWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get("delim"))); err != nil {
+ return fmt.Errorf("error reflecting field(%s): %v", fieldName, err)
+ }
+
+ }
+ return nil
+}
+
+// ReflectFrom reflects secion from given struct.
+func (s *Section) ReflectFrom(v interface{}) error {
+ typ := reflect.TypeOf(v)
+ val := reflect.ValueOf(v)
+ if typ.Kind() == reflect.Ptr {
+ typ = typ.Elem()
+ val = val.Elem()
+ } else {
+ return errors.New("cannot reflect from non-pointer struct")
+ }
+
+ return s.reflectFrom(val)
+}
+
+// ReflectFrom reflects file from given struct.
+func (f *File) ReflectFrom(v interface{}) error {
+ return f.Section("").ReflectFrom(v)
+}
+
+// ReflectFrom reflects data sources from given struct with name mapper.
+func ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) error {
+ cfg.NameMapper = mapper
+ return cfg.ReflectFrom(v)
+}
+
+// ReflectFrom reflects data sources from given struct.
+func ReflectFrom(cfg *File, v interface{}) error {
+ return ReflectFromWithMapper(cfg, v, nil)
+}
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/struct_test.go b/Godeps/_workspace/src/github.com/go-ini/ini/struct_test.go
new file mode 100644
index 00000000000..d865ad78eb7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/struct_test.go
@@ -0,0 +1,239 @@
+// Copyright 2014 Unknwon
+//
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
+// under the License.
+
+package ini
+
+import (
+ "strings"
+ "testing"
+ "time"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+type testNested struct {
+ Cities []string `delim:"|"`
+ Visits []time.Time
+ Note string
+ Unused int `ini:"-"`
+}
+
+type testEmbeded struct {
+ GPA float64
+}
+
+type testStruct struct {
+ Name string `ini:"NAME"`
+ Age int
+ Male bool
+ Money float64
+ Born time.Time
+ Time time.Duration `ini:"Duration"`
+ Others testNested
+ *testEmbeded `ini:"grade"`
+ Unused int `ini:"-"`
+ Unsigned uint
+}
+
+const _CONF_DATA_STRUCT = `
+NAME = Unknwon
+Age = 21
+Male = true
+Money = 1.25
+Born = 1993-10-07T20:17:05Z
+Duration = 2h45m
+Unsigned = 3
+
+[Others]
+Cities = HangZhou|Boston
+Visits = 1993-10-07T20:17:05Z, 1993-10-07T20:17:05Z
+Note = Hello world!
+
+[grade]
+GPA = 2.8
+
+[foo.bar]
+Here = there
+When = then
+`
+
+type unsupport struct {
+ Byte byte
+}
+
+type unsupport2 struct {
+ Others struct {
+ Cities byte
+ }
+}
+
+type unsupport3 struct {
+ Cities byte
+}
+
+type unsupport4 struct {
+ *unsupport3 `ini:"Others"`
+}
+
+type defaultValue struct {
+ Name string
+ Age int
+ Male bool
+ Money float64
+ Born time.Time
+ Cities []string
+}
+
+type fooBar struct {
+ Here, When string
+}
+
+const _INVALID_DATA_CONF_STRUCT = `
+Name =
+Age = age
+Male = 123
+Money = money
+Born = nil
+Cities =
+`
+
+func Test_Struct(t *testing.T) {
+ Convey("Map to struct", t, func() {
+ Convey("Map file to struct", func() {
+ ts := new(testStruct)
+ So(MapTo(ts, []byte(_CONF_DATA_STRUCT)), ShouldBeNil)
+
+ So(ts.Name, ShouldEqual, "Unknwon")
+ So(ts.Age, ShouldEqual, 21)
+ So(ts.Male, ShouldBeTrue)
+ So(ts.Money, ShouldEqual, 1.25)
+ So(ts.Unsigned, ShouldEqual, 3)
+
+ t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z")
+ So(err, ShouldBeNil)
+ So(ts.Born.String(), ShouldEqual, t.String())
+
+ dur, err := time.ParseDuration("2h45m")
+ So(err, ShouldBeNil)
+ So(ts.Time.Seconds(), ShouldEqual, dur.Seconds())
+
+ So(strings.Join(ts.Others.Cities, ","), ShouldEqual, "HangZhou,Boston")
+ So(ts.Others.Visits[0].String(), ShouldEqual, t.String())
+ So(ts.Others.Note, ShouldEqual, "Hello world!")
+ So(ts.testEmbeded.GPA, ShouldEqual, 2.8)
+ })
+
+ Convey("Map section to struct", func() {
+ foobar := new(fooBar)
+ f, err := Load([]byte(_CONF_DATA_STRUCT))
+ So(err, ShouldBeNil)
+
+ So(f.Section("foo.bar").MapTo(foobar), ShouldBeNil)
+ So(foobar.Here, ShouldEqual, "there")
+ So(foobar.When, ShouldEqual, "then")
+ })
+
+ Convey("Map to non-pointer struct", func() {
+ cfg, err := Load([]byte(_CONF_DATA_STRUCT))
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ So(cfg.MapTo(testStruct{}), ShouldNotBeNil)
+ })
+
+ Convey("Map to unsupported type", func() {
+ cfg, err := Load([]byte(_CONF_DATA_STRUCT))
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ cfg.NameMapper = func(raw string) string {
+ if raw == "Byte" {
+ return "NAME"
+ }
+ return raw
+ }
+ So(cfg.MapTo(&unsupport{}), ShouldNotBeNil)
+ So(cfg.MapTo(&unsupport2{}), ShouldNotBeNil)
+ So(cfg.MapTo(&unsupport4{}), ShouldNotBeNil)
+ })
+
+ Convey("Map from invalid data source", func() {
+ So(MapTo(&testStruct{}, "hi"), ShouldNotBeNil)
+ })
+
+ Convey("Map to wrong types and gain default values", func() {
+ cfg, err := Load([]byte(_INVALID_DATA_CONF_STRUCT))
+ So(err, ShouldBeNil)
+
+ t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z")
+ So(err, ShouldBeNil)
+ dv := &defaultValue{"Joe", 10, true, 1.25, t, []string{"HangZhou", "Boston"}}
+ So(cfg.MapTo(dv), ShouldBeNil)
+ So(dv.Name, ShouldEqual, "Joe")
+ So(dv.Age, ShouldEqual, 10)
+ So(dv.Male, ShouldBeTrue)
+ So(dv.Money, ShouldEqual, 1.25)
+ So(dv.Born.String(), ShouldEqual, t.String())
+ So(strings.Join(dv.Cities, ","), ShouldEqual, "HangZhou,Boston")
+ })
+ })
+
+ Convey("Reflect from struct", t, func() {
+ type Embeded struct {
+ Dates []time.Time `delim:"|"`
+ Places []string
+ None []int
+ }
+ type Author struct {
+ Name string `ini:"NAME"`
+ Male bool
+ Age int
+ GPA float64
+ NeverMind string `ini:"-"`
+ *Embeded `ini:"infos"`
+ }
+ a := &Author{"Unknwon", true, 21, 2.8, "",
+ &Embeded{
+ []time.Time{time.Now(), time.Now()},
+ []string{"HangZhou", "Boston"},
+ []int{},
+ }}
+ cfg := Empty()
+ So(ReflectFrom(cfg, a), ShouldBeNil)
+ cfg.SaveTo("testdata/conf_reflect.ini")
+
+ Convey("Reflect from non-point struct", func() {
+ So(ReflectFrom(cfg, Author{}), ShouldNotBeNil)
+ })
+ })
+}
+
+type testMapper struct {
+ PackageName string
+}
+
+func Test_NameGetter(t *testing.T) {
+ Convey("Test name mappers", t, func() {
+ So(MapToWithMapper(&testMapper{}, TitleUnderscore, []byte("packag_name=ini")), ShouldBeNil)
+
+ cfg, err := Load([]byte("PACKAGE_NAME=ini"))
+ So(err, ShouldBeNil)
+ So(cfg, ShouldNotBeNil)
+
+ cfg.NameMapper = AllCapsUnderscore
+ tg := new(testMapper)
+ So(cfg.MapTo(tg), ShouldBeNil)
+ So(tg.PackageName, ShouldEqual, "ini")
+ })
+}
diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/testdata/conf.ini b/Godeps/_workspace/src/github.com/go-ini/ini/testdata/conf.ini
new file mode 100644
index 00000000000..2ed0ac1d3ac
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/go-ini/ini/testdata/conf.ini
@@ -0,0 +1,2 @@
+[author]
+E-MAIL = u@gogs.io
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.gitignore b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.gitignore
new file mode 100644
index 00000000000..531fcc11c70
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.gitignore
@@ -0,0 +1,4 @@
+jpgo
+jmespath-fuzz.zip
+cpu.out
+go-jmespath.test
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.travis.yml b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.travis.yml
new file mode 100644
index 00000000000..1f98077570d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.travis.yml
@@ -0,0 +1,9 @@
+language: go
+
+sudo: false
+
+go:
+ - 1.4
+
+install: go get -v -t ./...
+script: make test
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE
new file mode 100644
index 00000000000..b03310a91fd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2015 James Saryerwinnie
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/Makefile b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/Makefile
new file mode 100644
index 00000000000..ad17bf0012e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/Makefile
@@ -0,0 +1,44 @@
+
+CMD = jpgo
+
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " test to run all the tests"
+ @echo " build to build the library and jp executable"
+ @echo " generate to run codegen"
+
+
+generate:
+ go generate ./...
+
+build:
+ rm -f $(CMD)
+ go build ./...
+ rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./...
+ mv cmd/$(CMD)/$(CMD) .
+
+test:
+ go test -v ./...
+
+check:
+ go vet ./...
+ @echo "golint ./..."
+ @lint=`golint ./...`; \
+ lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \
+ echo "$$lint"; \
+ if [ "$$lint" != "" ]; then exit 1; fi
+
+htmlc:
+ go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov
+
+buildfuzz:
+ go-fuzz-build github.com/jmespath/go-jmespath/fuzz
+
+fuzz: buildfuzz
+ go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/corpus
+
+bench:
+ go test -bench . -cpuprofile cpu.out
+
+pprof-cpu:
+ go tool pprof ./go-jmespath.test ./cpu.out
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/README.md b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/README.md
new file mode 100644
index 00000000000..187ef676dc9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/README.md
@@ -0,0 +1,7 @@
+# go-jmespath - A JMESPath implementation in Go
+
+[](https://travis-ci.org/jmespath/go-jmespath)
+
+
+
+See http://jmespath.org for more info.
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go
new file mode 100644
index 00000000000..67df3fc1c87
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go
@@ -0,0 +1,12 @@
+package jmespath
+
+// Search evaluates a JMESPath expression against input data and returns the result.
+func Search(expression string, data interface{}) (interface{}, error) {
+ intr := newInterpreter()
+ parser := NewParser()
+ ast, err := parser.Parse(expression)
+ if err != nil {
+ return nil, err
+ }
+ return intr.Execute(ast, data)
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/astnodetype_string.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/astnodetype_string.go
new file mode 100644
index 00000000000..1cd2d239c96
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/astnodetype_string.go
@@ -0,0 +1,16 @@
+// generated by stringer -type astNodeType; DO NOT EDIT
+
+package jmespath
+
+import "fmt"
+
+const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection"
+
+var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307}
+
+func (i astNodeType) String() string {
+ if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) {
+ return fmt.Sprintf("astNodeType(%d)", i)
+ }
+ return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]]
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/basic.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/basic.json
new file mode 100644
index 00000000000..d550e969547
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/basic.json
@@ -0,0 +1,96 @@
+[{
+ "given":
+ {"foo": {"bar": {"baz": "correct"}}},
+ "cases": [
+ {
+ "expression": "foo",
+ "result": {"bar": {"baz": "correct"}}
+ },
+ {
+ "expression": "foo.bar",
+ "result": {"baz": "correct"}
+ },
+ {
+ "expression": "foo.bar.baz",
+ "result": "correct"
+ },
+ {
+ "expression": "foo\n.\nbar\n.baz",
+ "result": "correct"
+ },
+ {
+ "expression": "foo.bar.baz.bad",
+ "result": null
+ },
+ {
+ "expression": "foo.bar.bad",
+ "result": null
+ },
+ {
+ "expression": "foo.bad",
+ "result": null
+ },
+ {
+ "expression": "bad",
+ "result": null
+ },
+ {
+ "expression": "bad.morebad.morebad",
+ "result": null
+ }
+ ]
+},
+{
+ "given":
+ {"foo": {"bar": ["one", "two", "three"]}},
+ "cases": [
+ {
+ "expression": "foo",
+ "result": {"bar": ["one", "two", "three"]}
+ },
+ {
+ "expression": "foo.bar",
+ "result": ["one", "two", "three"]
+ }
+ ]
+},
+{
+ "given": ["one", "two", "three"],
+ "cases": [
+ {
+ "expression": "one",
+ "result": null
+ },
+ {
+ "expression": "two",
+ "result": null
+ },
+ {
+ "expression": "three",
+ "result": null
+ },
+ {
+ "expression": "one.two",
+ "result": null
+ }
+ ]
+},
+{
+ "given":
+ {"foo": {"1": ["one", "two", "three"], "-1": "bar"}},
+ "cases": [
+ {
+ "expression": "foo.\"1\"",
+ "result": ["one", "two", "three"]
+ },
+ {
+ "expression": "foo.\"1\"[0]",
+ "result": "one"
+ },
+ {
+ "expression": "foo.\"-1\"",
+ "result": "bar"
+ }
+ ]
+}
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/boolean.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/boolean.json
new file mode 100644
index 00000000000..e3fa196b14f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/boolean.json
@@ -0,0 +1,257 @@
+[
+ {
+ "given": {
+ "outer": {
+ "foo": "foo",
+ "bar": "bar",
+ "baz": "baz"
+ }
+ },
+ "cases": [
+ {
+ "expression": "outer.foo || outer.bar",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.foo||outer.bar",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.bar || outer.baz",
+ "result": "bar"
+ },
+ {
+ "expression": "outer.bar||outer.baz",
+ "result": "bar"
+ },
+ {
+ "expression": "outer.bad || outer.foo",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.bad||outer.foo",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.foo || outer.bad",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.foo||outer.bad",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.bad || outer.alsobad",
+ "result": null
+ },
+ {
+ "expression": "outer.bad||outer.alsobad",
+ "result": null
+ }
+ ]
+ },
+ {
+ "given": {
+ "outer": {
+ "foo": "foo",
+ "bool": false,
+ "empty_list": [],
+ "empty_string": ""
+ }
+ },
+ "cases": [
+ {
+ "expression": "outer.empty_string || outer.foo",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo",
+ "result": "foo"
+ }
+ ]
+ },
+ {
+ "given": {
+ "True": true,
+ "False": false,
+ "Number": 5,
+ "EmptyList": [],
+ "Zero": 0
+ },
+ "cases": [
+ {
+ "expression": "True && False",
+ "result": false
+ },
+ {
+ "expression": "False && True",
+ "result": false
+ },
+ {
+ "expression": "True && True",
+ "result": true
+ },
+ {
+ "expression": "False && False",
+ "result": false
+ },
+ {
+ "expression": "True && Number",
+ "result": 5
+ },
+ {
+ "expression": "Number && True",
+ "result": true
+ },
+ {
+ "expression": "Number && False",
+ "result": false
+ },
+ {
+ "expression": "Number && EmptyList",
+ "result": []
+ },
+ {
+ "expression": "Number && True",
+ "result": true
+ },
+ {
+ "expression": "EmptyList && True",
+ "result": []
+ },
+ {
+ "expression": "EmptyList && False",
+ "result": []
+ },
+ {
+ "expression": "True || False",
+ "result": true
+ },
+ {
+ "expression": "True || True",
+ "result": true
+ },
+ {
+ "expression": "False || True",
+ "result": true
+ },
+ {
+ "expression": "False || False",
+ "result": false
+ },
+ {
+ "expression": "Number || EmptyList",
+ "result": 5
+ },
+ {
+ "expression": "Number || True",
+ "result": 5
+ },
+ {
+ "expression": "Number || True && False",
+ "result": 5
+ },
+ {
+ "expression": "(Number || True) && False",
+ "result": false
+ },
+ {
+ "expression": "Number || (True && False)",
+ "result": 5
+ },
+ {
+ "expression": "!True",
+ "result": false
+ },
+ {
+ "expression": "!False",
+ "result": true
+ },
+ {
+ "expression": "!Number",
+ "result": false
+ },
+ {
+ "expression": "!EmptyList",
+ "result": true
+ },
+ {
+ "expression": "True && !False",
+ "result": true
+ },
+ {
+ "expression": "True && !EmptyList",
+ "result": true
+ },
+ {
+ "expression": "!False && !EmptyList",
+ "result": true
+ },
+ {
+ "expression": "!(True && False)",
+ "result": true
+ },
+ {
+ "expression": "!Zero",
+ "result": false
+ },
+ {
+ "expression": "!!Zero",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "one": 1,
+ "two": 2,
+ "three": 3
+ },
+ "cases": [
+ {
+ "expression": "one < two",
+ "result": true
+ },
+ {
+ "expression": "one <= two",
+ "result": true
+ },
+ {
+ "expression": "one == one",
+ "result": true
+ },
+ {
+ "expression": "one == two",
+ "result": false
+ },
+ {
+ "expression": "one > two",
+ "result": false
+ },
+ {
+ "expression": "one >= two",
+ "result": false
+ },
+ {
+ "expression": "one != two",
+ "result": true
+ },
+ {
+ "expression": "one < two && three > one",
+ "result": true
+ },
+ {
+ "expression": "one < two || three > one",
+ "result": true
+ },
+ {
+ "expression": "one < two || three < one",
+ "result": true
+ },
+ {
+ "expression": "two < one || three < one",
+ "result": false
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/current.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/current.json
new file mode 100644
index 00000000000..0c26248d079
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/current.json
@@ -0,0 +1,25 @@
+[
+ {
+ "given": {
+ "foo": [{"name": "a"}, {"name": "b"}],
+ "bar": {"baz": "qux"}
+ },
+ "cases": [
+ {
+ "expression": "@",
+ "result": {
+ "foo": [{"name": "a"}, {"name": "b"}],
+ "bar": {"baz": "qux"}
+ }
+ },
+ {
+ "expression": "@.bar",
+ "result": {"baz": "qux"}
+ },
+ {
+ "expression": "@.foo[0]",
+ "result": {"name": "a"}
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/escape.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/escape.json
new file mode 100644
index 00000000000..4a62d951a65
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/escape.json
@@ -0,0 +1,46 @@
+[{
+ "given": {
+ "foo.bar": "dot",
+ "foo bar": "space",
+ "foo\nbar": "newline",
+ "foo\"bar": "doublequote",
+ "c:\\\\windows\\path": "windows",
+ "/unix/path": "unix",
+ "\"\"\"": "threequotes",
+ "bar": {"baz": "qux"}
+ },
+ "cases": [
+ {
+ "expression": "\"foo.bar\"",
+ "result": "dot"
+ },
+ {
+ "expression": "\"foo bar\"",
+ "result": "space"
+ },
+ {
+ "expression": "\"foo\\nbar\"",
+ "result": "newline"
+ },
+ {
+ "expression": "\"foo\\\"bar\"",
+ "result": "doublequote"
+ },
+ {
+ "expression": "\"c:\\\\\\\\windows\\\\path\"",
+ "result": "windows"
+ },
+ {
+ "expression": "\"/unix/path\"",
+ "result": "unix"
+ },
+ {
+ "expression": "\"\\\"\\\"\\\"\"",
+ "result": "threequotes"
+ },
+ {
+ "expression": "\"bar\".\"baz\"",
+ "result": "qux"
+ }
+ ]
+}]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/filters.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/filters.json
new file mode 100644
index 00000000000..5b9f52b1159
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/filters.json
@@ -0,0 +1,468 @@
+[
+ {
+ "given": {"foo": [{"name": "a"}, {"name": "b"}]},
+ "cases": [
+ {
+ "comment": "Matching a literal",
+ "expression": "foo[?name == 'a']",
+ "result": [{"name": "a"}]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [0, 1], "bar": [2, 3]},
+ "cases": [
+ {
+ "comment": "Matching a literal",
+ "expression": "*[?[0] == `0`]",
+ "result": [[], []]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"first": "foo", "last": "bar"},
+ {"first": "foo", "last": "foo"},
+ {"first": "foo", "last": "baz"}]},
+ "cases": [
+ {
+ "comment": "Matching an expression",
+ "expression": "foo[?first == last]",
+ "result": [{"first": "foo", "last": "foo"}]
+ },
+ {
+ "comment": "Verify projection created from filter",
+ "expression": "foo[?first == last].first",
+ "result": ["foo"]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"age": 20},
+ {"age": 25},
+ {"age": 30}]},
+ "cases": [
+ {
+ "comment": "Greater than with a number",
+ "expression": "foo[?age > `25`]",
+ "result": [{"age": 30}]
+ },
+ {
+ "expression": "foo[?age >= `25`]",
+ "result": [{"age": 25}, {"age": 30}]
+ },
+ {
+ "comment": "Greater than with a number",
+ "expression": "foo[?age > `30`]",
+ "result": []
+ },
+ {
+ "comment": "Greater than with a number",
+ "expression": "foo[?age < `25`]",
+ "result": [{"age": 20}]
+ },
+ {
+ "comment": "Greater than with a number",
+ "expression": "foo[?age <= `25`]",
+ "result": [{"age": 20}, {"age": 25}]
+ },
+ {
+ "comment": "Greater than with a number",
+ "expression": "foo[?age < `20`]",
+ "result": []
+ },
+ {
+ "expression": "foo[?age == `20`]",
+ "result": [{"age": 20}]
+ },
+ {
+ "expression": "foo[?age != `20`]",
+ "result": [{"age": 25}, {"age": 30}]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"top": {"name": "a"}},
+ {"top": {"name": "b"}}]},
+ "cases": [
+ {
+ "comment": "Filter with subexpression",
+ "expression": "foo[?top.name == 'a']",
+ "result": [{"top": {"name": "a"}}]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"top": {"first": "foo", "last": "bar"}},
+ {"top": {"first": "foo", "last": "foo"}},
+ {"top": {"first": "foo", "last": "baz"}}]},
+ "cases": [
+ {
+ "comment": "Matching an expression",
+ "expression": "foo[?top.first == top.last]",
+ "result": [{"top": {"first": "foo", "last": "foo"}}]
+ },
+ {
+ "comment": "Matching a JSON array",
+ "expression": "foo[?top == `{\"first\": \"foo\", \"last\": \"bar\"}`]",
+ "result": [{"top": {"first": "foo", "last": "bar"}}]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [
+ {"key": true},
+ {"key": false},
+ {"key": 0},
+ {"key": 1},
+ {"key": [0]},
+ {"key": {"bar": [0]}},
+ {"key": null},
+ {"key": [1]},
+ {"key": {"a":2}}
+ ]},
+ "cases": [
+ {
+ "expression": "foo[?key == `true`]",
+ "result": [{"key": true}]
+ },
+ {
+ "expression": "foo[?key == `false`]",
+ "result": [{"key": false}]
+ },
+ {
+ "expression": "foo[?key == `0`]",
+ "result": [{"key": 0}]
+ },
+ {
+ "expression": "foo[?key == `1`]",
+ "result": [{"key": 1}]
+ },
+ {
+ "expression": "foo[?key == `[0]`]",
+ "result": [{"key": [0]}]
+ },
+ {
+ "expression": "foo[?key == `{\"bar\": [0]}`]",
+ "result": [{"key": {"bar": [0]}}]
+ },
+ {
+ "expression": "foo[?key == `null`]",
+ "result": [{"key": null}]
+ },
+ {
+ "expression": "foo[?key == `[1]`]",
+ "result": [{"key": [1]}]
+ },
+ {
+ "expression": "foo[?key == `{\"a\":2}`]",
+ "result": [{"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`true` == key]",
+ "result": [{"key": true}]
+ },
+ {
+ "expression": "foo[?`false` == key]",
+ "result": [{"key": false}]
+ },
+ {
+ "expression": "foo[?`0` == key]",
+ "result": [{"key": 0}]
+ },
+ {
+ "expression": "foo[?`1` == key]",
+ "result": [{"key": 1}]
+ },
+ {
+ "expression": "foo[?`[0]` == key]",
+ "result": [{"key": [0]}]
+ },
+ {
+ "expression": "foo[?`{\"bar\": [0]}` == key]",
+ "result": [{"key": {"bar": [0]}}]
+ },
+ {
+ "expression": "foo[?`null` == key]",
+ "result": [{"key": null}]
+ },
+ {
+ "expression": "foo[?`[1]` == key]",
+ "result": [{"key": [1]}]
+ },
+ {
+ "expression": "foo[?`{\"a\":2}` == key]",
+ "result": [{"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `true`]",
+ "result": [{"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `false`]",
+ "result": [{"key": true}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `0`]",
+ "result": [{"key": true}, {"key": false}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `1`]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `null`]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `[1]`]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?key != `{\"a\":2}`]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}]
+ },
+ {
+ "expression": "foo[?`true` != key]",
+ "result": [{"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`false` != key]",
+ "result": [{"key": true}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`0` != key]",
+ "result": [{"key": true}, {"key": false}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`1` != key]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`null` != key]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": [1]}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`[1]` != key]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": {"a":2}}]
+ },
+ {
+ "expression": "foo[?`{\"a\":2}` != key]",
+ "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]},
+ {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}]
+ }
+ ]
+ },
+ {
+ "given": {"reservations": [
+ {"instances": [
+ {"foo": 1, "bar": 2}, {"foo": 1, "bar": 3},
+ {"foo": 1, "bar": 2}, {"foo": 2, "bar": 1}]}]},
+ "cases": [
+ {
+ "expression": "reservations[].instances[?bar==`1`]",
+ "result": [[{"foo": 2, "bar": 1}]]
+ },
+ {
+ "expression": "reservations[*].instances[?bar==`1`]",
+ "result": [[{"foo": 2, "bar": 1}]]
+ },
+ {
+ "expression": "reservations[].instances[?bar==`1`][]",
+ "result": [{"foo": 2, "bar": 1}]
+ }
+ ]
+ },
+ {
+ "given": {
+ "baz": "other",
+ "foo": [
+ {"bar": 1}, {"bar": 2}, {"bar": 3}, {"bar": 4}, {"bar": 1, "baz": 2}
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo[?bar==`1`].bar[0]",
+ "result": []
+ }
+ ]
+ },
+ {
+ "given": {
+ "foo": [
+ {"a": 1, "b": {"c": "x"}},
+ {"a": 1, "b": {"c": "y"}},
+ {"a": 1, "b": {"c": "z"}},
+ {"a": 2, "b": {"c": "z"}},
+ {"a": 1, "baz": 2}
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo[?a==`1`].b.c",
+ "result": ["x", "y", "z"]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"name": "a"}, {"name": "b"}, {"name": "c"}]},
+ "cases": [
+ {
+ "comment": "Filter with or expression",
+ "expression": "foo[?name == 'a' || name == 'b']",
+ "result": [{"name": "a"}, {"name": "b"}]
+ },
+ {
+ "expression": "foo[?name == 'a' || name == 'e']",
+ "result": [{"name": "a"}]
+ },
+ {
+ "expression": "foo[?name == 'a' || name == 'b' || name == 'c']",
+ "result": [{"name": "a"}, {"name": "b"}, {"name": "c"}]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"a": 1, "b": 2}, {"a": 1, "b": 3}]},
+ "cases": [
+ {
+ "comment": "Filter with and expression",
+ "expression": "foo[?a == `1` && b == `2`]",
+ "result": [{"a": 1, "b": 2}]
+ },
+ {
+ "expression": "foo[?a == `1` && b == `4`]",
+ "result": []
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]},
+ "cases": [
+ {
+ "comment": "Filter with Or and And expressions",
+ "expression": "foo[?c == `3` || a == `1` && b == `4`]",
+ "result": [{"a": 1, "b": 2, "c": 3}]
+ },
+ {
+ "expression": "foo[?b == `2` || a == `3` && b == `4`]",
+ "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]
+ },
+ {
+ "expression": "foo[?a == `3` && b == `4` || b == `2`]",
+ "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]
+ },
+ {
+ "expression": "foo[?(a == `3` && b == `4`) || b == `2`]",
+ "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]
+ },
+ {
+ "expression": "foo[?((a == `3` && b == `4`)) || b == `2`]",
+ "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]
+ },
+ {
+ "expression": "foo[?a == `3` && (b == `4` || b == `2`)]",
+ "result": [{"a": 3, "b": 4}]
+ },
+ {
+ "expression": "foo[?a == `3` && ((b == `4` || b == `2`))]",
+ "result": [{"a": 3, "b": 4}]
+ }
+ ]
+ },
+ {
+ "given": {"foo": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]},
+ "cases": [
+ {
+ "comment": "Verify precedence of or/and expressions",
+ "expression": "foo[?a == `1` || b ==`2` && c == `5`]",
+ "result": [{"a": 1, "b": 2, "c": 3}]
+ },
+ {
+ "comment": "Parentheses can alter precedence",
+ "expression": "foo[?(a == `1` || b ==`2`) && c == `5`]",
+ "result": []
+ },
+ {
+ "comment": "Not expressions combined with and/or",
+ "expression": "foo[?!(a == `1` || b ==`2`)]",
+ "result": [{"a": 3, "b": 4}]
+ }
+ ]
+ },
+ {
+ "given": {
+ "foo": [
+ {"key": true},
+ {"key": false},
+ {"key": []},
+ {"key": {}},
+ {"key": [0]},
+ {"key": {"a": "b"}},
+ {"key": 0},
+ {"key": 1},
+ {"key": null},
+ {"notkey": true}
+ ]
+ },
+ "cases": [
+ {
+ "comment": "Unary filter expression",
+ "expression": "foo[?key]",
+ "result": [
+ {"key": true}, {"key": [0]}, {"key": {"a": "b"}},
+ {"key": 0}, {"key": 1}
+ ]
+ },
+ {
+ "comment": "Unary not filter expression",
+ "expression": "foo[?!key]",
+ "result": [
+ {"key": false}, {"key": []}, {"key": {}},
+ {"key": null}, {"notkey": true}
+ ]
+ },
+ {
+ "comment": "Equality with null RHS",
+ "expression": "foo[?key == `null`]",
+ "result": [
+ {"key": null}, {"notkey": true}
+ ]
+ }
+ ]
+ },
+ {
+ "given": {
+ "foo": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ "cases": [
+ {
+ "comment": "Using @ in a filter expression",
+ "expression": "foo[?@ < `5`]",
+ "result": [0, 1, 2, 3, 4]
+ },
+ {
+ "comment": "Using @ in a filter expression",
+ "expression": "foo[?`5` > @]",
+ "result": [0, 1, 2, 3, 4]
+ },
+ {
+ "comment": "Using @ in a filter expression",
+ "expression": "foo[?@ == @]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/functions.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/functions.json
new file mode 100644
index 00000000000..8b8db363a2b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/functions.json
@@ -0,0 +1,825 @@
+[{
+ "given":
+ {
+ "foo": -1,
+ "zero": 0,
+ "numbers": [-1, 3, 4, 5],
+ "array": [-1, 3, 4, 5, "a", "100"],
+ "strings": ["a", "b", "c"],
+ "decimals": [1.01, 1.2, -1.5],
+ "str": "Str",
+ "false": false,
+ "empty_list": [],
+ "empty_hash": {},
+ "objects": {"foo": "bar", "bar": "baz"},
+ "null_key": null
+ },
+ "cases": [
+ {
+ "expression": "abs(foo)",
+ "result": 1
+ },
+ {
+ "expression": "abs(foo)",
+ "result": 1
+ },
+ {
+ "expression": "abs(str)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "abs(array[1])",
+ "result": 3
+ },
+ {
+ "expression": "abs(array[1])",
+ "result": 3
+ },
+ {
+ "expression": "abs(`false`)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "abs(`-24`)",
+ "result": 24
+ },
+ {
+ "expression": "abs(`-24`)",
+ "result": 24
+ },
+ {
+ "expression": "abs(`1`, `2`)",
+ "error": "invalid-arity"
+ },
+ {
+ "expression": "abs()",
+ "error": "invalid-arity"
+ },
+ {
+ "expression": "unknown_function(`1`, `2`)",
+ "error": "unknown-function"
+ },
+ {
+ "expression": "avg(numbers)",
+ "result": 2.75
+ },
+ {
+ "expression": "avg(array)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "avg('abc')",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "avg(foo)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "avg(@)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "avg(strings)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "ceil(`1.2`)",
+ "result": 2
+ },
+ {
+ "expression": "ceil(decimals[0])",
+ "result": 2
+ },
+ {
+ "expression": "ceil(decimals[1])",
+ "result": 2
+ },
+ {
+ "expression": "ceil(decimals[2])",
+ "result": -1
+ },
+ {
+ "expression": "ceil('string')",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "contains('abc', 'a')",
+ "result": true
+ },
+ {
+ "expression": "contains('abc', 'd')",
+ "result": false
+ },
+ {
+ "expression": "contains(`false`, 'd')",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "contains(strings, 'a')",
+ "result": true
+ },
+ {
+ "expression": "contains(decimals, `1.2`)",
+ "result": true
+ },
+ {
+ "expression": "contains(decimals, `false`)",
+ "result": false
+ },
+ {
+ "expression": "ends_with(str, 'r')",
+ "result": true
+ },
+ {
+ "expression": "ends_with(str, 'tr')",
+ "result": true
+ },
+ {
+ "expression": "ends_with(str, 'Str')",
+ "result": true
+ },
+ {
+ "expression": "ends_with(str, 'SStr')",
+ "result": false
+ },
+ {
+ "expression": "ends_with(str, 'foo')",
+ "result": false
+ },
+ {
+ "expression": "ends_with(str, `0`)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "floor(`1.2`)",
+ "result": 1
+ },
+ {
+ "expression": "floor('string')",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "floor(decimals[0])",
+ "result": 1
+ },
+ {
+ "expression": "floor(foo)",
+ "result": -1
+ },
+ {
+ "expression": "floor(str)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "length('abc')",
+ "result": 3
+ },
+ {
+ "expression": "length('✓foo')",
+ "result": 4
+ },
+ {
+ "expression": "length('')",
+ "result": 0
+ },
+ {
+ "expression": "length(@)",
+ "result": 12
+ },
+ {
+ "expression": "length(strings[0])",
+ "result": 1
+ },
+ {
+ "expression": "length(str)",
+ "result": 3
+ },
+ {
+ "expression": "length(array)",
+ "result": 6
+ },
+ {
+ "expression": "length(objects)",
+ "result": 2
+ },
+ {
+ "expression": "length(`false`)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "length(foo)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "length(strings[0])",
+ "result": 1
+ },
+ {
+ "expression": "max(numbers)",
+ "result": 5
+ },
+ {
+ "expression": "max(decimals)",
+ "result": 1.2
+ },
+ {
+ "expression": "max(strings)",
+ "result": "c"
+ },
+ {
+ "expression": "max(abc)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "max(array)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "max(decimals)",
+ "result": 1.2
+ },
+ {
+ "expression": "max(empty_list)",
+ "result": null
+ },
+ {
+ "expression": "merge(`{}`)",
+ "result": {}
+ },
+ {
+ "expression": "merge(`{}`, `{}`)",
+ "result": {}
+ },
+ {
+ "expression": "merge(`{\"a\": 1}`, `{\"b\": 2}`)",
+ "result": {"a": 1, "b": 2}
+ },
+ {
+ "expression": "merge(`{\"a\": 1}`, `{\"a\": 2}`)",
+ "result": {"a": 2}
+ },
+ {
+ "expression": "merge(`{\"a\": 1, \"b\": 2}`, `{\"a\": 2, \"c\": 3}`, `{\"d\": 4}`)",
+ "result": {"a": 2, "b": 2, "c": 3, "d": 4}
+ },
+ {
+ "expression": "min(numbers)",
+ "result": -1
+ },
+ {
+ "expression": "min(decimals)",
+ "result": -1.5
+ },
+ {
+ "expression": "min(abc)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "min(array)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "min(empty_list)",
+ "result": null
+ },
+ {
+ "expression": "min(decimals)",
+ "result": -1.5
+ },
+ {
+ "expression": "min(strings)",
+ "result": "a"
+ },
+ {
+ "expression": "type('abc')",
+ "result": "string"
+ },
+ {
+ "expression": "type(`1.0`)",
+ "result": "number"
+ },
+ {
+ "expression": "type(`2`)",
+ "result": "number"
+ },
+ {
+ "expression": "type(`true`)",
+ "result": "boolean"
+ },
+ {
+ "expression": "type(`false`)",
+ "result": "boolean"
+ },
+ {
+ "expression": "type(`null`)",
+ "result": "null"
+ },
+ {
+ "expression": "type(`[0]`)",
+ "result": "array"
+ },
+ {
+ "expression": "type(`{\"a\": \"b\"}`)",
+ "result": "object"
+ },
+ {
+ "expression": "type(@)",
+ "result": "object"
+ },
+ {
+ "expression": "sort(keys(objects))",
+ "result": ["bar", "foo"]
+ },
+ {
+ "expression": "keys(foo)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "keys(strings)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "keys(`false`)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort(values(objects))",
+ "result": ["bar", "baz"]
+ },
+ {
+ "expression": "keys(empty_hash)",
+ "result": []
+ },
+ {
+ "expression": "values(foo)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "join(', ', strings)",
+ "result": "a, b, c"
+ },
+ {
+ "expression": "join(', ', strings)",
+ "result": "a, b, c"
+ },
+ {
+ "expression": "join(',', `[\"a\", \"b\"]`)",
+ "result": "a,b"
+ },
+ {
+ "expression": "join(',', `[\"a\", 0]`)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "join(', ', str)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "join('|', strings)",
+ "result": "a|b|c"
+ },
+ {
+ "expression": "join(`2`, strings)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "join('|', decimals)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "join('|', decimals[].to_string(@))",
+ "result": "1.01|1.2|-1.5"
+ },
+ {
+ "expression": "join('|', empty_list)",
+ "result": ""
+ },
+ {
+ "expression": "reverse(numbers)",
+ "result": [5, 4, 3, -1]
+ },
+ {
+ "expression": "reverse(array)",
+ "result": ["100", "a", 5, 4, 3, -1]
+ },
+ {
+ "expression": "reverse(`[]`)",
+ "result": []
+ },
+ {
+ "expression": "reverse('')",
+ "result": ""
+ },
+ {
+ "expression": "reverse('hello world')",
+ "result": "dlrow olleh"
+ },
+ {
+ "expression": "starts_with(str, 'S')",
+ "result": true
+ },
+ {
+ "expression": "starts_with(str, 'St')",
+ "result": true
+ },
+ {
+ "expression": "starts_with(str, 'Str')",
+ "result": true
+ },
+ {
+ "expression": "starts_with(str, 'String')",
+ "result": false
+ },
+ {
+ "expression": "starts_with(str, `0`)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sum(numbers)",
+ "result": 11
+ },
+ {
+ "expression": "sum(decimals)",
+ "result": 0.71
+ },
+ {
+ "expression": "sum(array)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sum(array[].to_number(@))",
+ "result": 111
+ },
+ {
+ "expression": "sum(`[]`)",
+ "result": 0
+ },
+ {
+ "expression": "to_array('foo')",
+ "result": ["foo"]
+ },
+ {
+ "expression": "to_array(`0`)",
+ "result": [0]
+ },
+ {
+ "expression": "to_array(objects)",
+ "result": [{"foo": "bar", "bar": "baz"}]
+ },
+ {
+ "expression": "to_array(`[1, 2, 3]`)",
+ "result": [1, 2, 3]
+ },
+ {
+ "expression": "to_array(false)",
+ "result": [false]
+ },
+ {
+ "expression": "to_string('foo')",
+ "result": "foo"
+ },
+ {
+ "expression": "to_string(`1.2`)",
+ "result": "1.2"
+ },
+ {
+ "expression": "to_string(`[0, 1]`)",
+ "result": "[0,1]"
+ },
+ {
+ "expression": "to_number('1.0')",
+ "result": 1.0
+ },
+ {
+ "expression": "to_number('1.1')",
+ "result": 1.1
+ },
+ {
+ "expression": "to_number('4')",
+ "result": 4
+ },
+ {
+ "expression": "to_number('notanumber')",
+ "result": null
+ },
+ {
+ "expression": "to_number(`false`)",
+ "result": null
+ },
+ {
+ "expression": "to_number(`null`)",
+ "result": null
+ },
+ {
+ "expression": "to_number(`[0]`)",
+ "result": null
+ },
+ {
+ "expression": "to_number(`{\"foo\": 0}`)",
+ "result": null
+ },
+ {
+ "expression": "\"to_string\"(`1.0`)",
+ "error": "syntax"
+ },
+ {
+ "expression": "sort(numbers)",
+ "result": [-1, 3, 4, 5]
+ },
+ {
+ "expression": "sort(strings)",
+ "result": ["a", "b", "c"]
+ },
+ {
+ "expression": "sort(decimals)",
+ "result": [-1.5, 1.01, 1.2]
+ },
+ {
+ "expression": "sort(array)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort(abc)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort(empty_list)",
+ "result": []
+ },
+ {
+ "expression": "sort(@)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "not_null(unknown_key, str)",
+ "result": "Str"
+ },
+ {
+ "expression": "not_null(unknown_key, foo.bar, empty_list, str)",
+ "result": []
+ },
+ {
+ "expression": "not_null(unknown_key, null_key, empty_list, str)",
+ "result": []
+ },
+ {
+ "expression": "not_null(all, expressions, are_null)",
+ "result": null
+ },
+ {
+ "expression": "not_null()",
+ "error": "invalid-arity"
+ },
+ {
+ "description": "function projection on single arg function",
+ "expression": "numbers[].to_string(@)",
+ "result": ["-1", "3", "4", "5"]
+ },
+ {
+ "description": "function projection on single arg function",
+ "expression": "array[].to_number(@)",
+ "result": [-1, 3, 4, 5, 100]
+ }
+ ]
+}, {
+ "given":
+ {
+ "foo": [
+ {"b": "b", "a": "a"},
+ {"c": "c", "b": "b"},
+ {"d": "d", "c": "c"},
+ {"e": "e", "d": "d"},
+ {"f": "f", "e": "e"}
+ ]
+ },
+ "cases": [
+ {
+ "description": "function projection on variadic function",
+ "expression": "foo[].not_null(f, e, d, c, b, a)",
+ "result": ["b", "c", "d", "e", "f"]
+ }
+ ]
+}, {
+ "given":
+ {
+ "people": [
+ {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
+ {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
+ {"age": 30, "age_str": "30", "bool": true, "name": "c"},
+ {"age": 50, "age_str": "50", "bool": false, "name": "d"},
+ {"age": 10, "age_str": "10", "bool": true, "name": 3}
+ ]
+ },
+ "cases": [
+ {
+ "description": "sort by field expression",
+ "expression": "sort_by(people, &age)",
+ "result": [
+ {"age": 10, "age_str": "10", "bool": true, "name": 3},
+ {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
+ {"age": 30, "age_str": "30", "bool": true, "name": "c"},
+ {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
+ {"age": 50, "age_str": "50", "bool": false, "name": "d"}
+ ]
+ },
+ {
+ "expression": "sort_by(people, &age_str)",
+ "result": [
+ {"age": 10, "age_str": "10", "bool": true, "name": 3},
+ {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
+ {"age": 30, "age_str": "30", "bool": true, "name": "c"},
+ {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
+ {"age": 50, "age_str": "50", "bool": false, "name": "d"}
+ ]
+ },
+ {
+ "description": "sort by function expression",
+ "expression": "sort_by(people, &to_number(age_str))",
+ "result": [
+ {"age": 10, "age_str": "10", "bool": true, "name": 3},
+ {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"},
+ {"age": 30, "age_str": "30", "bool": true, "name": "c"},
+ {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"},
+ {"age": 50, "age_str": "50", "bool": false, "name": "d"}
+ ]
+ },
+ {
+ "description": "function projection on sort_by function",
+ "expression": "sort_by(people, &age)[].name",
+ "result": [3, "a", "c", "b", "d"]
+ },
+ {
+ "expression": "sort_by(people, &extra)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort_by(people, &bool)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort_by(people, &name)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort_by(people, name)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "sort_by(people, &age)[].extra",
+ "result": ["foo", "bar"]
+ },
+ {
+ "expression": "sort_by(`[]`, &age)",
+ "result": []
+ },
+ {
+ "expression": "max_by(people, &age)",
+ "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"}
+ },
+ {
+ "expression": "max_by(people, &age_str)",
+ "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"}
+ },
+ {
+ "expression": "max_by(people, &bool)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "max_by(people, &extra)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "max_by(people, &to_number(age_str))",
+ "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"}
+ },
+ {
+ "expression": "min_by(people, &age)",
+ "result": {"age": 10, "age_str": "10", "bool": true, "name": 3}
+ },
+ {
+ "expression": "min_by(people, &age_str)",
+ "result": {"age": 10, "age_str": "10", "bool": true, "name": 3}
+ },
+ {
+ "expression": "min_by(people, &bool)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "min_by(people, &extra)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "min_by(people, &to_number(age_str))",
+ "result": {"age": 10, "age_str": "10", "bool": true, "name": 3}
+ }
+ ]
+}, {
+ "given":
+ {
+ "people": [
+ {"age": 10, "order": "1"},
+ {"age": 10, "order": "2"},
+ {"age": 10, "order": "3"},
+ {"age": 10, "order": "4"},
+ {"age": 10, "order": "5"},
+ {"age": 10, "order": "6"},
+ {"age": 10, "order": "7"},
+ {"age": 10, "order": "8"},
+ {"age": 10, "order": "9"},
+ {"age": 10, "order": "10"},
+ {"age": 10, "order": "11"}
+ ]
+ },
+ "cases": [
+ {
+ "description": "stable sort order",
+ "expression": "sort_by(people, &age)",
+ "result": [
+ {"age": 10, "order": "1"},
+ {"age": 10, "order": "2"},
+ {"age": 10, "order": "3"},
+ {"age": 10, "order": "4"},
+ {"age": 10, "order": "5"},
+ {"age": 10, "order": "6"},
+ {"age": 10, "order": "7"},
+ {"age": 10, "order": "8"},
+ {"age": 10, "order": "9"},
+ {"age": 10, "order": "10"},
+ {"age": 10, "order": "11"}
+ ]
+ }
+ ]
+}, {
+ "given":
+ {
+ "people": [
+ {"a": 10, "b": 1, "c": "z"},
+ {"a": 10, "b": 2, "c": null},
+ {"a": 10, "b": 3},
+ {"a": 10, "b": 4, "c": "z"},
+ {"a": 10, "b": 5, "c": null},
+ {"a": 10, "b": 6},
+ {"a": 10, "b": 7, "c": "z"},
+ {"a": 10, "b": 8, "c": null},
+ {"a": 10, "b": 9}
+ ],
+ "empty": []
+ },
+ "cases": [
+ {
+ "expression": "map(&a, people)",
+ "result": [10, 10, 10, 10, 10, 10, 10, 10, 10]
+ },
+ {
+ "expression": "map(&c, people)",
+ "result": ["z", null, null, "z", null, null, "z", null, null]
+ },
+ {
+ "expression": "map(&a, badkey)",
+ "error": "invalid-type"
+ },
+ {
+ "expression": "map(&foo, empty)",
+ "result": []
+ }
+ ]
+}, {
+ "given": {
+ "array": [
+ {
+ "foo": {"bar": "yes1"}
+ },
+ {
+ "foo": {"bar": "yes2"}
+ },
+ {
+ "foo1": {"bar": "no"}
+ }
+ ]},
+ "cases": [
+ {
+ "expression": "map(&foo.bar, array)",
+ "result": ["yes1", "yes2", null]
+ },
+ {
+ "expression": "map(&foo1.bar, array)",
+ "result": [null, null, "no"]
+ },
+ {
+ "expression": "map(&foo.bar.baz, array)",
+ "result": [null, null, null]
+ }
+ ]
+}, {
+ "given": {
+ "array": [[1, 2, 3, [4]], [5, 6, 7, [8, 9]]]
+ },
+ "cases": [
+ {
+ "expression": "map(&[], array)",
+ "result": [[1, 2, 3, 4], [5, 6, 7, 8, 9]]
+ }
+ ]
+}
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/identifiers.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/identifiers.json
new file mode 100644
index 00000000000..7998a41ac9d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/identifiers.json
@@ -0,0 +1,1377 @@
+[
+ {
+ "given": {
+ "__L": true
+ },
+ "cases": [
+ {
+ "expression": "__L",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "!\r": true
+ },
+ "cases": [
+ {
+ "expression": "\"!\\r\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "Y_1623": true
+ },
+ "cases": [
+ {
+ "expression": "Y_1623",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "x": true
+ },
+ "cases": [
+ {
+ "expression": "x",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\tF\uCebb": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\tF\\uCebb\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ " \t": true
+ },
+ "cases": [
+ {
+ "expression": "\" \\t\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ " ": true
+ },
+ "cases": [
+ {
+ "expression": "\" \"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "v2": true
+ },
+ "cases": [
+ {
+ "expression": "v2",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\t": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\t\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_X": true
+ },
+ "cases": [
+ {
+ "expression": "_X",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\t4\ud9da\udd15": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\t4\\ud9da\\udd15\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "v24_W": true
+ },
+ "cases": [
+ {
+ "expression": "v24_W",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "H": true
+ },
+ "cases": [
+ {
+ "expression": "\"H\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\f": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\f\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "E4": true
+ },
+ "cases": [
+ {
+ "expression": "\"E4\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "!": true
+ },
+ "cases": [
+ {
+ "expression": "\"!\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "tM": true
+ },
+ "cases": [
+ {
+ "expression": "tM",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ " [": true
+ },
+ "cases": [
+ {
+ "expression": "\" [\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "R!": true
+ },
+ "cases": [
+ {
+ "expression": "\"R!\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_6W": true
+ },
+ "cases": [
+ {
+ "expression": "_6W",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\uaBA1\r": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\uaBA1\\r\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "tL7": true
+ },
+ "cases": [
+ {
+ "expression": "tL7",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "<": true
+ },
+ "cases": [
+ {
+ "expression": "\">\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "hvu": true
+ },
+ "cases": [
+ {
+ "expression": "hvu",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "; !": true
+ },
+ "cases": [
+ {
+ "expression": "\"; !\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "hU": true
+ },
+ "cases": [
+ {
+ "expression": "hU",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "!I\n\/": true
+ },
+ "cases": [
+ {
+ "expression": "\"!I\\n\\/\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\uEEbF": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\uEEbF\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "U)\t": true
+ },
+ "cases": [
+ {
+ "expression": "\"U)\\t\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "fa0_9": true
+ },
+ "cases": [
+ {
+ "expression": "fa0_9",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "/": true
+ },
+ "cases": [
+ {
+ "expression": "\"/\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "Gy": true
+ },
+ "cases": [
+ {
+ "expression": "Gy",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\b": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\b\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "<": true
+ },
+ "cases": [
+ {
+ "expression": "\"<\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\t": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\t\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\t&\\\r": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\t&\\\\\\r\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "#": true
+ },
+ "cases": [
+ {
+ "expression": "\"#\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "B__": true
+ },
+ "cases": [
+ {
+ "expression": "B__",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\nS \n": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\nS \\n\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "Bp": true
+ },
+ "cases": [
+ {
+ "expression": "Bp",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ ",\t;": true
+ },
+ "cases": [
+ {
+ "expression": "\",\\t;\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "B_q": true
+ },
+ "cases": [
+ {
+ "expression": "B_q",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\/+\t\n\b!Z": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\/+\\t\\n\\b!Z\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\udadd\udfc7\\ueFAc": true
+ },
+ "cases": [
+ {
+ "expression": "\"\udadd\udfc7\\\\ueFAc\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ ":\f": true
+ },
+ "cases": [
+ {
+ "expression": "\":\\f\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\/": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\/\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_BW_6Hg_Gl": true
+ },
+ "cases": [
+ {
+ "expression": "_BW_6Hg_Gl",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\udbcf\udc02": true
+ },
+ "cases": [
+ {
+ "expression": "\"\udbcf\udc02\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "zs1DC": true
+ },
+ "cases": [
+ {
+ "expression": "zs1DC",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "__434": true
+ },
+ "cases": [
+ {
+ "expression": "__434",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\udb94\udd41": true
+ },
+ "cases": [
+ {
+ "expression": "\"\udb94\udd41\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "Z_5": true
+ },
+ "cases": [
+ {
+ "expression": "Z_5",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "z_M_": true
+ },
+ "cases": [
+ {
+ "expression": "z_M_",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "YU_2": true
+ },
+ "cases": [
+ {
+ "expression": "YU_2",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_0": true
+ },
+ "cases": [
+ {
+ "expression": "_0",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\b+": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\b+\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\"": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\\"\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "D7": true
+ },
+ "cases": [
+ {
+ "expression": "D7",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_62L": true
+ },
+ "cases": [
+ {
+ "expression": "_62L",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\tK\t": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\tK\\t\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\n\\\f": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\n\\\\\\f\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "I_": true
+ },
+ "cases": [
+ {
+ "expression": "I_",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "W_a0_": true
+ },
+ "cases": [
+ {
+ "expression": "W_a0_",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "BQ": true
+ },
+ "cases": [
+ {
+ "expression": "BQ",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\tX$\uABBb": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\tX$\\uABBb\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "Z9": true
+ },
+ "cases": [
+ {
+ "expression": "Z9",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\b%\"\uda38\udd0f": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\b%\\\"\uda38\udd0f\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_F": true
+ },
+ "cases": [
+ {
+ "expression": "_F",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "!,": true
+ },
+ "cases": [
+ {
+ "expression": "\"!,\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\"!": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\\"!\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "Hh": true
+ },
+ "cases": [
+ {
+ "expression": "Hh",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "&": true
+ },
+ "cases": [
+ {
+ "expression": "\"&\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "9\r\\R": true
+ },
+ "cases": [
+ {
+ "expression": "\"9\\r\\\\R\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "M_k": true
+ },
+ "cases": [
+ {
+ "expression": "M_k",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "!\b\n\udb06\ude52\"\"": true
+ },
+ "cases": [
+ {
+ "expression": "\"!\\b\\n\udb06\ude52\\\"\\\"\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "6": true
+ },
+ "cases": [
+ {
+ "expression": "\"6\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_7": true
+ },
+ "cases": [
+ {
+ "expression": "_7",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "0": true
+ },
+ "cases": [
+ {
+ "expression": "\"0\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\\8\\": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\\\8\\\\\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "b7eo": true
+ },
+ "cases": [
+ {
+ "expression": "b7eo",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "xIUo9": true
+ },
+ "cases": [
+ {
+ "expression": "xIUo9",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "5": true
+ },
+ "cases": [
+ {
+ "expression": "\"5\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "?": true
+ },
+ "cases": [
+ {
+ "expression": "\"?\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "sU": true
+ },
+ "cases": [
+ {
+ "expression": "sU",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "VH2&H\\\/": true
+ },
+ "cases": [
+ {
+ "expression": "\"VH2&H\\\\\\/\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_C": true
+ },
+ "cases": [
+ {
+ "expression": "_C",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "_": true
+ },
+ "cases": [
+ {
+ "expression": "_",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "<\t": true
+ },
+ "cases": [
+ {
+ "expression": "\"<\\t\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {
+ "\uD834\uDD1E": true
+ },
+ "cases": [
+ {
+ "expression": "\"\\uD834\\uDD1E\"",
+ "result": true
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/indices.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/indices.json
new file mode 100644
index 00000000000..aa03b35dd7f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/indices.json
@@ -0,0 +1,346 @@
+[{
+ "given":
+ {"foo": {"bar": ["zero", "one", "two"]}},
+ "cases": [
+ {
+ "expression": "foo.bar[0]",
+ "result": "zero"
+ },
+ {
+ "expression": "foo.bar[1]",
+ "result": "one"
+ },
+ {
+ "expression": "foo.bar[2]",
+ "result": "two"
+ },
+ {
+ "expression": "foo.bar[3]",
+ "result": null
+ },
+ {
+ "expression": "foo.bar[-1]",
+ "result": "two"
+ },
+ {
+ "expression": "foo.bar[-2]",
+ "result": "one"
+ },
+ {
+ "expression": "foo.bar[-3]",
+ "result": "zero"
+ },
+ {
+ "expression": "foo.bar[-4]",
+ "result": null
+ }
+ ]
+},
+{
+ "given":
+ {"foo": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]},
+ "cases": [
+ {
+ "expression": "foo.bar",
+ "result": null
+ },
+ {
+ "expression": "foo[0].bar",
+ "result": "one"
+ },
+ {
+ "expression": "foo[1].bar",
+ "result": "two"
+ },
+ {
+ "expression": "foo[2].bar",
+ "result": "three"
+ },
+ {
+ "expression": "foo[3].notbar",
+ "result": "four"
+ },
+ {
+ "expression": "foo[3].bar",
+ "result": null
+ },
+ {
+ "expression": "foo[0]",
+ "result": {"bar": "one"}
+ },
+ {
+ "expression": "foo[1]",
+ "result": {"bar": "two"}
+ },
+ {
+ "expression": "foo[2]",
+ "result": {"bar": "three"}
+ },
+ {
+ "expression": "foo[3]",
+ "result": {"notbar": "four"}
+ },
+ {
+ "expression": "foo[4]",
+ "result": null
+ }
+ ]
+},
+{
+ "given": [
+ "one", "two", "three"
+ ],
+ "cases": [
+ {
+ "expression": "[0]",
+ "result": "one"
+ },
+ {
+ "expression": "[1]",
+ "result": "two"
+ },
+ {
+ "expression": "[2]",
+ "result": "three"
+ },
+ {
+ "expression": "[-1]",
+ "result": "three"
+ },
+ {
+ "expression": "[-2]",
+ "result": "two"
+ },
+ {
+ "expression": "[-3]",
+ "result": "one"
+ }
+ ]
+},
+{
+ "given": {"reservations": [
+ {"instances": [{"foo": 1}, {"foo": 2}]}
+ ]},
+ "cases": [
+ {
+ "expression": "reservations[].instances[].foo",
+ "result": [1, 2]
+ },
+ {
+ "expression": "reservations[].instances[].bar",
+ "result": []
+ },
+ {
+ "expression": "reservations[].notinstances[].foo",
+ "result": []
+ },
+ {
+ "expression": "reservations[].notinstances[].foo",
+ "result": []
+ }
+ ]
+},
+{
+ "given": {"reservations": [{
+ "instances": [
+ {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]},
+ {"foo": [{"bar": 5}, {"bar": 6}, {"notbar": [7]}, {"bar": 8}]},
+ {"foo": "bar"},
+ {"notfoo": [{"bar": 20}, {"bar": 21}, {"notbar": [7]}, {"bar": 22}]},
+ {"bar": [{"baz": [1]}, {"baz": [2]}, {"baz": [3]}, {"baz": [4]}]},
+ {"baz": [{"baz": [1, 2]}, {"baz": []}, {"baz": []}, {"baz": [3, 4]}]},
+ {"qux": [{"baz": []}, {"baz": [1, 2, 3]}, {"baz": [4]}, {"baz": []}]}
+ ],
+ "otherkey": {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]}
+ }, {
+ "instances": [
+ {"a": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]},
+ {"b": [{"bar": 5}, {"bar": 6}, {"notbar": [7]}, {"bar": 8}]},
+ {"c": "bar"},
+ {"notfoo": [{"bar": 23}, {"bar": 24}, {"notbar": [7]}, {"bar": 25}]},
+ {"qux": [{"baz": []}, {"baz": [1, 2, 3]}, {"baz": [4]}, {"baz": []}]}
+ ],
+ "otherkey": {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]}
+ }
+ ]},
+ "cases": [
+ {
+ "expression": "reservations[].instances[].foo[].bar",
+ "result": [1, 2, 4, 5, 6, 8]
+ },
+ {
+ "expression": "reservations[].instances[].foo[].baz",
+ "result": []
+ },
+ {
+ "expression": "reservations[].instances[].notfoo[].bar",
+ "result": [20, 21, 22, 23, 24, 25]
+ },
+ {
+ "expression": "reservations[].instances[].notfoo[].notbar",
+ "result": [[7], [7]]
+ },
+ {
+ "expression": "reservations[].notinstances[].foo",
+ "result": []
+ },
+ {
+ "expression": "reservations[].instances[].foo[].notbar",
+ "result": [3, [7]]
+ },
+ {
+ "expression": "reservations[].instances[].bar[].baz",
+ "result": [[1], [2], [3], [4]]
+ },
+ {
+ "expression": "reservations[].instances[].baz[].baz",
+ "result": [[1, 2], [], [], [3, 4]]
+ },
+ {
+ "expression": "reservations[].instances[].qux[].baz",
+ "result": [[], [1, 2, 3], [4], [], [], [1, 2, 3], [4], []]
+ },
+ {
+ "expression": "reservations[].instances[].qux[].baz[]",
+ "result": [1, 2, 3, 4, 1, 2, 3, 4]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [
+ [["one", "two"], ["three", "four"]],
+ [["five", "six"], ["seven", "eight"]],
+ [["nine"], ["ten"]]
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo[]",
+ "result": [["one", "two"], ["three", "four"], ["five", "six"],
+ ["seven", "eight"], ["nine"], ["ten"]]
+ },
+ {
+ "expression": "foo[][0]",
+ "result": ["one", "three", "five", "seven", "nine", "ten"]
+ },
+ {
+ "expression": "foo[][1]",
+ "result": ["two", "four", "six", "eight"]
+ },
+ {
+ "expression": "foo[][0][0]",
+ "result": []
+ },
+ {
+ "expression": "foo[][2][2]",
+ "result": []
+ },
+ {
+ "expression": "foo[][0][0][100]",
+ "result": []
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [{
+ "bar": [
+ {
+ "qux": 2,
+ "baz": 1
+ },
+ {
+ "qux": 4,
+ "baz": 3
+ }
+ ]
+ },
+ {
+ "bar": [
+ {
+ "qux": 6,
+ "baz": 5
+ },
+ {
+ "qux": 8,
+ "baz": 7
+ }
+ ]
+ }
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo",
+ "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]},
+ {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}]
+ },
+ {
+ "expression": "foo[]",
+ "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]},
+ {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}]
+ },
+ {
+ "expression": "foo[].bar",
+ "result": [[{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}],
+ [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]]
+ },
+ {
+ "expression": "foo[].bar[]",
+ "result": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3},
+ {"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]
+ },
+ {
+ "expression": "foo[].bar[].baz",
+ "result": [1, 3, 5, 7]
+ }
+ ]
+},
+{
+ "given": {
+ "string": "string",
+ "hash": {"foo": "bar", "bar": "baz"},
+ "number": 23,
+ "nullvalue": null
+ },
+ "cases": [
+ {
+ "expression": "string[]",
+ "result": null
+ },
+ {
+ "expression": "hash[]",
+ "result": null
+ },
+ {
+ "expression": "number[]",
+ "result": null
+ },
+ {
+ "expression": "nullvalue[]",
+ "result": null
+ },
+ {
+ "expression": "string[].foo",
+ "result": null
+ },
+ {
+ "expression": "hash[].foo",
+ "result": null
+ },
+ {
+ "expression": "number[].foo",
+ "result": null
+ },
+ {
+ "expression": "nullvalue[].foo",
+ "result": null
+ },
+ {
+ "expression": "nullvalue[].foo[].bar",
+ "result": null
+ }
+ ]
+}
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/literal.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/literal.json
new file mode 100644
index 00000000000..c6706b97196
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/literal.json
@@ -0,0 +1,185 @@
+[
+ {
+ "given": {
+ "foo": [{"name": "a"}, {"name": "b"}],
+ "bar": {"baz": "qux"}
+ },
+ "cases": [
+ {
+ "expression": "`\"foo\"`",
+ "result": "foo"
+ },
+ {
+ "comment": "Interpret escaped unicode.",
+ "expression": "`\"\\u03a6\"`",
+ "result": "Φ"
+ },
+ {
+ "expression": "`\"✓\"`",
+ "result": "✓"
+ },
+ {
+ "expression": "`[1, 2, 3]`",
+ "result": [1, 2, 3]
+ },
+ {
+ "expression": "`{\"a\": \"b\"}`",
+ "result": {"a": "b"}
+ },
+ {
+ "expression": "`true`",
+ "result": true
+ },
+ {
+ "expression": "`false`",
+ "result": false
+ },
+ {
+ "expression": "`null`",
+ "result": null
+ },
+ {
+ "expression": "`0`",
+ "result": 0
+ },
+ {
+ "expression": "`1`",
+ "result": 1
+ },
+ {
+ "expression": "`2`",
+ "result": 2
+ },
+ {
+ "expression": "`3`",
+ "result": 3
+ },
+ {
+ "expression": "`4`",
+ "result": 4
+ },
+ {
+ "expression": "`5`",
+ "result": 5
+ },
+ {
+ "expression": "`6`",
+ "result": 6
+ },
+ {
+ "expression": "`7`",
+ "result": 7
+ },
+ {
+ "expression": "`8`",
+ "result": 8
+ },
+ {
+ "expression": "`9`",
+ "result": 9
+ },
+ {
+ "comment": "Escaping a backtick in quotes",
+ "expression": "`\"foo\\`bar\"`",
+ "result": "foo`bar"
+ },
+ {
+ "comment": "Double quote in literal",
+ "expression": "`\"foo\\\"bar\"`",
+ "result": "foo\"bar"
+ },
+ {
+ "expression": "`\"1\\`\"`",
+ "result": "1`"
+ },
+ {
+ "comment": "Multiple literal expressions with escapes",
+ "expression": "`\"\\\\\"`.{a:`\"b\"`}",
+ "result": {"a": "b"}
+ },
+ {
+ "comment": "literal . identifier",
+ "expression": "`{\"a\": \"b\"}`.a",
+ "result": "b"
+ },
+ {
+ "comment": "literal . identifier . identifier",
+ "expression": "`{\"a\": {\"b\": \"c\"}}`.a.b",
+ "result": "c"
+ },
+ {
+ "comment": "literal . identifier bracket-expr",
+ "expression": "`[0, 1, 2]`[1]",
+ "result": 1
+ }
+ ]
+ },
+ {
+ "comment": "Literals",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "comment": "Literal with leading whitespace",
+ "expression": "` {\"foo\": true}`",
+ "result": {"foo": true}
+ },
+ {
+ "comment": "Literal with trailing whitespace",
+ "expression": "`{\"foo\": true} `",
+ "result": {"foo": true}
+ },
+ {
+ "comment": "Literal on RHS of subexpr not allowed",
+ "expression": "foo.`\"bar\"`",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Raw String Literals",
+ "given": {},
+ "cases": [
+ {
+ "expression": "'foo'",
+ "result": "foo"
+ },
+ {
+ "expression": "' foo '",
+ "result": " foo "
+ },
+ {
+ "expression": "'0'",
+ "result": "0"
+ },
+ {
+ "expression": "'newline\n'",
+ "result": "newline\n"
+ },
+ {
+ "expression": "'\n'",
+ "result": "\n"
+ },
+ {
+ "expression": "'✓'",
+ "result": "✓"
+ },
+ {
+ "expression": "'𝄞'",
+ "result": "𝄞"
+ },
+ {
+ "expression": "' [foo] '",
+ "result": " [foo] "
+ },
+ {
+ "expression": "'[foo]'",
+ "result": "[foo]"
+ },
+ {
+ "comment": "Do not interpret escaped unicode.",
+ "expression": "'\\u03a6'",
+ "result": "\\u03a6"
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/multiselect.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/multiselect.json
new file mode 100644
index 00000000000..8f2a481ed7c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/multiselect.json
@@ -0,0 +1,393 @@
+[{
+ "given": {
+ "foo": {
+ "bar": "bar",
+ "baz": "baz",
+ "qux": "qux",
+ "nested": {
+ "one": {
+ "a": "first",
+ "b": "second",
+ "c": "third"
+ },
+ "two": {
+ "a": "first",
+ "b": "second",
+ "c": "third"
+ },
+ "three": {
+ "a": "first",
+ "b": "second",
+ "c": {"inner": "third"}
+ }
+ }
+ },
+ "bar": 1,
+ "baz": 2,
+ "qux\"": 3
+ },
+ "cases": [
+ {
+ "expression": "foo.{bar: bar}",
+ "result": {"bar": "bar"}
+ },
+ {
+ "expression": "foo.{\"bar\": bar}",
+ "result": {"bar": "bar"}
+ },
+ {
+ "expression": "foo.{\"foo.bar\": bar}",
+ "result": {"foo.bar": "bar"}
+ },
+ {
+ "expression": "foo.{bar: bar, baz: baz}",
+ "result": {"bar": "bar", "baz": "baz"}
+ },
+ {
+ "expression": "foo.{\"bar\": bar, \"baz\": baz}",
+ "result": {"bar": "bar", "baz": "baz"}
+ },
+ {
+ "expression": "{\"baz\": baz, \"qux\\\"\": \"qux\\\"\"}",
+ "result": {"baz": 2, "qux\"": 3}
+ },
+ {
+ "expression": "foo.{bar:bar,baz:baz}",
+ "result": {"bar": "bar", "baz": "baz"}
+ },
+ {
+ "expression": "foo.{bar: bar,qux: qux}",
+ "result": {"bar": "bar", "qux": "qux"}
+ },
+ {
+ "expression": "foo.{bar: bar, noexist: noexist}",
+ "result": {"bar": "bar", "noexist": null}
+ },
+ {
+ "expression": "foo.{noexist: noexist, alsonoexist: alsonoexist}",
+ "result": {"noexist": null, "alsonoexist": null}
+ },
+ {
+ "expression": "foo.badkey.{nokey: nokey, alsonokey: alsonokey}",
+ "result": null
+ },
+ {
+ "expression": "foo.nested.*.{a: a,b: b}",
+ "result": [{"a": "first", "b": "second"},
+ {"a": "first", "b": "second"},
+ {"a": "first", "b": "second"}]
+ },
+ {
+ "expression": "foo.nested.three.{a: a, cinner: c.inner}",
+ "result": {"a": "first", "cinner": "third"}
+ },
+ {
+ "expression": "foo.nested.three.{a: a, c: c.inner.bad.key}",
+ "result": {"a": "first", "c": null}
+ },
+ {
+ "expression": "foo.{a: nested.one.a, b: nested.two.b}",
+ "result": {"a": "first", "b": "second"}
+ },
+ {
+ "expression": "{bar: bar, baz: baz}",
+ "result": {"bar": 1, "baz": 2}
+ },
+ {
+ "expression": "{bar: bar}",
+ "result": {"bar": 1}
+ },
+ {
+ "expression": "{otherkey: bar}",
+ "result": {"otherkey": 1}
+ },
+ {
+ "expression": "{no: no, exist: exist}",
+ "result": {"no": null, "exist": null}
+ },
+ {
+ "expression": "foo.[bar]",
+ "result": ["bar"]
+ },
+ {
+ "expression": "foo.[bar,baz]",
+ "result": ["bar", "baz"]
+ },
+ {
+ "expression": "foo.[bar,qux]",
+ "result": ["bar", "qux"]
+ },
+ {
+ "expression": "foo.[bar,noexist]",
+ "result": ["bar", null]
+ },
+ {
+ "expression": "foo.[noexist,alsonoexist]",
+ "result": [null, null]
+ }
+ ]
+}, {
+ "given": {
+ "foo": {"bar": 1, "baz": [2, 3, 4]}
+ },
+ "cases": [
+ {
+ "expression": "foo.{bar:bar,baz:baz}",
+ "result": {"bar": 1, "baz": [2, 3, 4]}
+ },
+ {
+ "expression": "foo.[bar,baz[0]]",
+ "result": [1, 2]
+ },
+ {
+ "expression": "foo.[bar,baz[1]]",
+ "result": [1, 3]
+ },
+ {
+ "expression": "foo.[bar,baz[2]]",
+ "result": [1, 4]
+ },
+ {
+ "expression": "foo.[bar,baz[3]]",
+ "result": [1, null]
+ },
+ {
+ "expression": "foo.[bar[0],baz[3]]",
+ "result": [null, null]
+ }
+ ]
+}, {
+ "given": {
+ "foo": {"bar": 1, "baz": 2}
+ },
+ "cases": [
+ {
+ "expression": "foo.{bar: bar, baz: baz}",
+ "result": {"bar": 1, "baz": 2}
+ },
+ {
+ "expression": "foo.[bar,baz]",
+ "result": [1, 2]
+ }
+ ]
+}, {
+ "given": {
+ "foo": {
+ "bar": {"baz": [{"common": "first", "one": 1},
+ {"common": "second", "two": 2}]},
+ "ignoreme": 1,
+ "includeme": true
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.{bar: bar.baz[1],includeme: includeme}",
+ "result": {"bar": {"common": "second", "two": 2}, "includeme": true}
+ },
+ {
+ "expression": "foo.{\"bar.baz.two\": bar.baz[1].two, includeme: includeme}",
+ "result": {"bar.baz.two": 2, "includeme": true}
+ },
+ {
+ "expression": "foo.[includeme, bar.baz[*].common]",
+ "result": [true, ["first", "second"]]
+ },
+ {
+ "expression": "foo.[includeme, bar.baz[*].none]",
+ "result": [true, []]
+ },
+ {
+ "expression": "foo.[includeme, bar.baz[].common]",
+ "result": [true, ["first", "second"]]
+ }
+ ]
+}, {
+ "given": {
+ "reservations": [{
+ "instances": [
+ {"id": "id1",
+ "name": "first"},
+ {"id": "id2",
+ "name": "second"}
+ ]}, {
+ "instances": [
+ {"id": "id3",
+ "name": "third"},
+ {"id": "id4",
+ "name": "fourth"}
+ ]}
+ ]},
+ "cases": [
+ {
+ "expression": "reservations[*].instances[*].{id: id, name: name}",
+ "result": [[{"id": "id1", "name": "first"}, {"id": "id2", "name": "second"}],
+ [{"id": "id3", "name": "third"}, {"id": "id4", "name": "fourth"}]]
+ },
+ {
+ "expression": "reservations[].instances[].{id: id, name: name}",
+ "result": [{"id": "id1", "name": "first"},
+ {"id": "id2", "name": "second"},
+ {"id": "id3", "name": "third"},
+ {"id": "id4", "name": "fourth"}]
+ },
+ {
+ "expression": "reservations[].instances[].[id, name]",
+ "result": [["id1", "first"],
+ ["id2", "second"],
+ ["id3", "third"],
+ ["id4", "fourth"]]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [{
+ "bar": [
+ {
+ "qux": 2,
+ "baz": 1
+ },
+ {
+ "qux": 4,
+ "baz": 3
+ }
+ ]
+ },
+ {
+ "bar": [
+ {
+ "qux": 6,
+ "baz": 5
+ },
+ {
+ "qux": 8,
+ "baz": 7
+ }
+ ]
+ }
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo",
+ "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]},
+ {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}]
+ },
+ {
+ "expression": "foo[]",
+ "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]},
+ {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}]
+ },
+ {
+ "expression": "foo[].bar",
+ "result": [[{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}],
+ [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]]
+ },
+ {
+ "expression": "foo[].bar[]",
+ "result": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3},
+ {"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]
+ },
+ {
+ "expression": "foo[].bar[].[baz, qux]",
+ "result": [[1, 2], [3, 4], [5, 6], [7, 8]]
+ },
+ {
+ "expression": "foo[].bar[].[baz]",
+ "result": [[1], [3], [5], [7]]
+ },
+ {
+ "expression": "foo[].bar[].[baz, qux][]",
+ "result": [1, 2, 3, 4, 5, 6, 7, 8]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": {
+ "baz": [
+ {
+ "bar": "abc"
+ }, {
+ "bar": "def"
+ }
+ ],
+ "qux": ["zero"]
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.[baz[*].bar, qux[0]]",
+ "result": [["abc", "def"], "zero"]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": {
+ "baz": [
+ {
+ "bar": "a",
+ "bam": "b",
+ "boo": "c"
+ }, {
+ "bar": "d",
+ "bam": "e",
+ "boo": "f"
+ }
+ ],
+ "qux": ["zero"]
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.[baz[*].[bar, boo], qux[0]]",
+ "result": [[["a", "c" ], ["d", "f" ]], "zero"]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": {
+ "baz": [
+ {
+ "bar": "a",
+ "bam": "b",
+ "boo": "c"
+ }, {
+ "bar": "d",
+ "bam": "e",
+ "boo": "f"
+ }
+ ],
+ "qux": ["zero"]
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.[baz[*].not_there || baz[*].bar, qux[0]]",
+ "result": [["a", "d"], "zero"]
+ }
+ ]
+},
+{
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "comment": "Nested multiselect",
+ "expression": "[[*],*]",
+ "result": [null, ["object"]]
+ }
+ ]
+},
+{
+ "given": [],
+ "cases": [
+ {
+ "comment": "Nested multiselect",
+ "expression": "[[*]]",
+ "result": [[]]
+ }
+ ]
+}
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/ormatch.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/ormatch.json
new file mode 100644
index 00000000000..2127cf441ba
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/ormatch.json
@@ -0,0 +1,59 @@
+[{
+ "given":
+ {"outer": {"foo": "foo", "bar": "bar", "baz": "baz"}},
+ "cases": [
+ {
+ "expression": "outer.foo || outer.bar",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.foo||outer.bar",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.bar || outer.baz",
+ "result": "bar"
+ },
+ {
+ "expression": "outer.bar||outer.baz",
+ "result": "bar"
+ },
+ {
+ "expression": "outer.bad || outer.foo",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.bad||outer.foo",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.foo || outer.bad",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.foo||outer.bad",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.bad || outer.alsobad",
+ "result": null
+ },
+ {
+ "expression": "outer.bad||outer.alsobad",
+ "result": null
+ }
+ ]
+}, {
+ "given":
+ {"outer": {"foo": "foo", "bool": false, "empty_list": [], "empty_string": ""}},
+ "cases": [
+ {
+ "expression": "outer.empty_string || outer.foo",
+ "result": "foo"
+ },
+ {
+ "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo",
+ "result": "foo"
+ }
+ ]
+}]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/pipe.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/pipe.json
new file mode 100644
index 00000000000..b10c0a496d6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/pipe.json
@@ -0,0 +1,131 @@
+[{
+ "given": {
+ "foo": {
+ "bar": {
+ "baz": "subkey"
+ },
+ "other": {
+ "baz": "subkey"
+ },
+ "other2": {
+ "baz": "subkey"
+ },
+ "other3": {
+ "notbaz": ["a", "b", "c"]
+ },
+ "other4": {
+ "notbaz": ["a", "b", "c"]
+ }
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.*.baz | [0]",
+ "result": "subkey"
+ },
+ {
+ "expression": "foo.*.baz | [1]",
+ "result": "subkey"
+ },
+ {
+ "expression": "foo.*.baz | [2]",
+ "result": "subkey"
+ },
+ {
+ "expression": "foo.bar.* | [0]",
+ "result": "subkey"
+ },
+ {
+ "expression": "foo.*.notbaz | [*]",
+ "result": [["a", "b", "c"], ["a", "b", "c"]]
+ },
+ {
+ "expression": "{\"a\": foo.bar, \"b\": foo.other} | *.baz",
+ "result": ["subkey", "subkey"]
+ }
+ ]
+}, {
+ "given": {
+ "foo": {
+ "bar": {
+ "baz": "one"
+ },
+ "other": {
+ "baz": "two"
+ },
+ "other2": {
+ "baz": "three"
+ },
+ "other3": {
+ "notbaz": ["a", "b", "c"]
+ },
+ "other4": {
+ "notbaz": ["d", "e", "f"]
+ }
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo | bar",
+ "result": {"baz": "one"}
+ },
+ {
+ "expression": "foo | bar | baz",
+ "result": "one"
+ },
+ {
+ "expression": "foo|bar| baz",
+ "result": "one"
+ },
+ {
+ "expression": "not_there | [0]",
+ "result": null
+ },
+ {
+ "expression": "not_there | [0]",
+ "result": null
+ },
+ {
+ "expression": "[foo.bar, foo.other] | [0]",
+ "result": {"baz": "one"}
+ },
+ {
+ "expression": "{\"a\": foo.bar, \"b\": foo.other} | a",
+ "result": {"baz": "one"}
+ },
+ {
+ "expression": "{\"a\": foo.bar, \"b\": foo.other} | b",
+ "result": {"baz": "two"}
+ },
+ {
+ "expression": "foo.bam || foo.bar | baz",
+ "result": "one"
+ },
+ {
+ "expression": "foo | not_there || bar",
+ "result": {"baz": "one"}
+ }
+ ]
+}, {
+ "given": {
+ "foo": [{
+ "bar": [{
+ "baz": "one"
+ }, {
+ "baz": "two"
+ }]
+ }, {
+ "bar": [{
+ "baz": "three"
+ }, {
+ "baz": "four"
+ }]
+ }]
+ },
+ "cases": [
+ {
+ "expression": "foo[*].bar[*] | [0][0]",
+ "result": {"baz": "one"}
+ }
+ ]
+}]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/slice.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/slice.json
new file mode 100644
index 00000000000..359477278c8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/slice.json
@@ -0,0 +1,187 @@
+[{
+ "given": {
+ "foo": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
+ "bar": {
+ "baz": 1
+ }
+ },
+ "cases": [
+ {
+ "expression": "bar[0:10]",
+ "result": null
+ },
+ {
+ "expression": "foo[0:10:1]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[0:10]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[0:10:]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[0::1]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[0::]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[0:]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[:10:1]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[::1]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[:10:]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[::]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[:]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[1:9]",
+ "result": [1, 2, 3, 4, 5, 6, 7, 8]
+ },
+ {
+ "expression": "foo[0:10:2]",
+ "result": [0, 2, 4, 6, 8]
+ },
+ {
+ "expression": "foo[5:]",
+ "result": [5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[5::2]",
+ "result": [5, 7, 9]
+ },
+ {
+ "expression": "foo[::2]",
+ "result": [0, 2, 4, 6, 8]
+ },
+ {
+ "expression": "foo[::-1]",
+ "result": [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
+ },
+ {
+ "expression": "foo[1::2]",
+ "result": [1, 3, 5, 7, 9]
+ },
+ {
+ "expression": "foo[10:0:-1]",
+ "result": [9, 8, 7, 6, 5, 4, 3, 2, 1]
+ },
+ {
+ "expression": "foo[10:5:-1]",
+ "result": [9, 8, 7, 6]
+ },
+ {
+ "expression": "foo[8:2:-2]",
+ "result": [8, 6, 4]
+ },
+ {
+ "expression": "foo[0:20]",
+ "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ {
+ "expression": "foo[10:-20:-1]",
+ "result": [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
+ },
+ {
+ "expression": "foo[10:-20]",
+ "result": []
+ },
+ {
+ "expression": "foo[-4:-1]",
+ "result": [6, 7, 8]
+ },
+ {
+ "expression": "foo[:-5:-1]",
+ "result": [9, 8, 7, 6]
+ },
+ {
+ "expression": "foo[8:2:0]",
+ "error": "invalid-value"
+ },
+ {
+ "expression": "foo[8:2:0:1]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[8:2&]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[2:a:3]",
+ "error": "syntax"
+ }
+ ]
+}, {
+ "given": {
+ "foo": [{"a": 1}, {"a": 2}, {"a": 3}],
+ "bar": [{"a": {"b": 1}}, {"a": {"b": 2}},
+ {"a": {"b": 3}}],
+ "baz": 50
+ },
+ "cases": [
+ {
+ "expression": "foo[:2].a",
+ "result": [1, 2]
+ },
+ {
+ "expression": "foo[:2].b",
+ "result": []
+ },
+ {
+ "expression": "foo[:2].a.b",
+ "result": []
+ },
+ {
+ "expression": "bar[::-1].a.b",
+ "result": [3, 2, 1]
+ },
+ {
+ "expression": "bar[:2].a.b",
+ "result": [1, 2]
+ },
+ {
+ "expression": "baz[:2].a",
+ "result": null
+ }
+ ]
+}, {
+ "given": [{"a": 1}, {"a": 2}, {"a": 3}],
+ "cases": [
+ {
+ "expression": "[:]",
+ "result": [{"a": 1}, {"a": 2}, {"a": 3}]
+ },
+ {
+ "expression": "[:2].a",
+ "result": [1, 2]
+ },
+ {
+ "expression": "[::-1].a",
+ "result": [3, 2, 1]
+ },
+ {
+ "expression": "[:2].b",
+ "result": []
+ }
+ ]
+}]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/syntax.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/syntax.json
new file mode 100644
index 00000000000..003c2945887
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/syntax.json
@@ -0,0 +1,616 @@
+[{
+ "comment": "Dot syntax",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "foo.bar",
+ "result": null
+ },
+ {
+ "expression": "foo.1",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.-11",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo",
+ "result": null
+ },
+ {
+ "expression": "foo.",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.",
+ "error": "syntax"
+ },
+ {
+ "expression": ".foo",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo..bar",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.bar.",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[.]",
+ "error": "syntax"
+ }
+ ]
+},
+ {
+ "comment": "Simple token errors",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": ".",
+ "error": "syntax"
+ },
+ {
+ "expression": ":",
+ "error": "syntax"
+ },
+ {
+ "expression": ",",
+ "error": "syntax"
+ },
+ {
+ "expression": "]",
+ "error": "syntax"
+ },
+ {
+ "expression": "[",
+ "error": "syntax"
+ },
+ {
+ "expression": "}",
+ "error": "syntax"
+ },
+ {
+ "expression": "{",
+ "error": "syntax"
+ },
+ {
+ "expression": ")",
+ "error": "syntax"
+ },
+ {
+ "expression": "(",
+ "error": "syntax"
+ },
+ {
+ "expression": "((&",
+ "error": "syntax"
+ },
+ {
+ "expression": "a[",
+ "error": "syntax"
+ },
+ {
+ "expression": "a]",
+ "error": "syntax"
+ },
+ {
+ "expression": "a][",
+ "error": "syntax"
+ },
+ {
+ "expression": "!",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Boolean syntax errors",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "![!(!",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Wildcard syntax",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "*",
+ "result": ["object"]
+ },
+ {
+ "expression": "*.*",
+ "result": []
+ },
+ {
+ "expression": "*.foo",
+ "result": []
+ },
+ {
+ "expression": "*[0]",
+ "result": []
+ },
+ {
+ "expression": ".*",
+ "error": "syntax"
+ },
+ {
+ "expression": "*foo",
+ "error": "syntax"
+ },
+ {
+ "expression": "*0",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[*]bar",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[*]*",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Flatten syntax",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "[]",
+ "result": null
+ }
+ ]
+ },
+ {
+ "comment": "Simple bracket syntax",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "[0]",
+ "result": null
+ },
+ {
+ "expression": "[*]",
+ "result": null
+ },
+ {
+ "expression": "*.[0]",
+ "error": "syntax"
+ },
+ {
+ "expression": "*.[\"0\"]",
+ "result": [[null]]
+ },
+ {
+ "expression": "[*].bar",
+ "result": null
+ },
+ {
+ "expression": "[*][0]",
+ "result": null
+ },
+ {
+ "expression": "foo[#]",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Multi-select list syntax",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "foo[0]",
+ "result": null
+ },
+ {
+ "comment": "Valid multi-select of a list",
+ "expression": "foo[0, 1]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.[0]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.[*]",
+ "result": null
+ },
+ {
+ "comment": "Multi-select of a list with trailing comma",
+ "expression": "foo[0, ]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list with trailing comma and no close",
+ "expression": "foo[0,",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list with trailing comma and no close",
+ "expression": "foo.[a",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list with extra comma",
+ "expression": "foo[0,, 1]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list using an identifier index",
+ "expression": "foo[abc]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list using identifier indices",
+ "expression": "foo[abc, def]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list using an identifier index",
+ "expression": "foo[abc, 1]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a list using an identifier index with trailing comma",
+ "expression": "foo[abc, ]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Valid multi-select of a hash using an identifier index",
+ "expression": "foo.[abc]",
+ "result": null
+ },
+ {
+ "comment": "Valid multi-select of a hash",
+ "expression": "foo.[abc, def]",
+ "result": null
+ },
+ {
+ "comment": "Multi-select of a hash using a numeric index",
+ "expression": "foo.[abc, 1]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a hash with a trailing comma",
+ "expression": "foo.[abc, ]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a hash with extra commas",
+ "expression": "foo.[abc,, def]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Multi-select of a hash using number indices",
+ "expression": "foo.[0, 1]",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Multi-select hash syntax",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "comment": "No key or value",
+ "expression": "a{}",
+ "error": "syntax"
+ },
+ {
+ "comment": "No closing token",
+ "expression": "a{",
+ "error": "syntax"
+ },
+ {
+ "comment": "Not a key value pair",
+ "expression": "a{foo}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing value and closing character",
+ "expression": "a{foo:",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing closing character",
+ "expression": "a{foo: 0",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing value",
+ "expression": "a{foo:}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Trailing comma and no closing character",
+ "expression": "a{foo: 0, ",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing value with trailing comma",
+ "expression": "a{foo: ,}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Accessing Array using an identifier",
+ "expression": "a{foo: bar}",
+ "error": "syntax"
+ },
+ {
+ "expression": "a{foo: 0}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing key-value pair",
+ "expression": "a.{}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Not a key-value pair",
+ "expression": "a.{foo}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing value",
+ "expression": "a.{foo:}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing value with trailing comma",
+ "expression": "a.{foo: ,}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Valid multi-select hash extraction",
+ "expression": "a.{foo: bar}",
+ "result": null
+ },
+ {
+ "comment": "Valid multi-select hash extraction",
+ "expression": "a.{foo: bar, baz: bam}",
+ "result": null
+ },
+ {
+ "comment": "Trailing comma",
+ "expression": "a.{foo: bar, }",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing key in second key-value pair",
+ "expression": "a.{foo: bar, baz}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Missing value in second key-value pair",
+ "expression": "a.{foo: bar, baz:}",
+ "error": "syntax"
+ },
+ {
+ "comment": "Trailing comma",
+ "expression": "a.{foo: bar, baz: bam, }",
+ "error": "syntax"
+ },
+ {
+ "comment": "Nested multi select",
+ "expression": "{\"\\\\\":{\" \":*}}",
+ "result": {"\\": {" ": ["object"]}}
+ }
+ ]
+ },
+ {
+ "comment": "Or expressions",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "foo || bar",
+ "result": null
+ },
+ {
+ "expression": "foo ||",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.|| bar",
+ "error": "syntax"
+ },
+ {
+ "expression": " || foo",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo || || foo",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo.[a || b]",
+ "result": null
+ },
+ {
+ "expression": "foo.[a ||]",
+ "error": "syntax"
+ },
+ {
+ "expression": "\"foo",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Filter expressions",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "foo[?bar==`\"baz\"`]",
+ "result": null
+ },
+ {
+ "expression": "foo[? bar == `\"baz\"` ]",
+ "result": null
+ },
+ {
+ "expression": "foo[ ?bar==`\"baz\"`]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[?bar==]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[?==]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[?==bar]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[?bar==baz?]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[?a.b.c==d.e.f]",
+ "result": null
+ },
+ {
+ "expression": "foo[?bar==`[0, 1, 2]`]",
+ "result": null
+ },
+ {
+ "expression": "foo[?bar==`[\"a\", \"b\", \"c\"]`]",
+ "result": null
+ },
+ {
+ "comment": "Literal char not escaped",
+ "expression": "foo[?bar==`[\"foo`bar\"]`]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Literal char escaped",
+ "expression": "foo[?bar==`[\"foo\\`bar\"]`]",
+ "result": null
+ },
+ {
+ "comment": "Unknown comparator",
+ "expression": "foo[?bar<>baz]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Unknown comparator",
+ "expression": "foo[?bar^baz]",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[bar==baz]",
+ "error": "syntax"
+ },
+ {
+ "comment": "Quoted identifier in filter expression no spaces",
+ "expression": "[?\"\\\\\">`\"foo\"`]",
+ "result": null
+ },
+ {
+ "comment": "Quoted identifier in filter expression with spaces",
+ "expression": "[?\"\\\\\" > `\"foo\"`]",
+ "result": null
+ }
+ ]
+ },
+ {
+ "comment": "Filter expression errors",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "bar.`\"anything\"`",
+ "error": "syntax"
+ },
+ {
+ "expression": "bar.baz.noexists.`\"literal\"`",
+ "error": "syntax"
+ },
+ {
+ "comment": "Literal wildcard projection",
+ "expression": "foo[*].`\"literal\"`",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[*].name.`\"literal\"`",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[].name.`\"literal\"`",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[].name.`\"literal\"`.`\"subliteral\"`",
+ "error": "syntax"
+ },
+ {
+ "comment": "Projecting a literal onto an empty list",
+ "expression": "foo[*].name.noexist.`\"literal\"`",
+ "error": "syntax"
+ },
+ {
+ "expression": "foo[].name.noexist.`\"literal\"`",
+ "error": "syntax"
+ },
+ {
+ "expression": "twolen[*].`\"foo\"`",
+ "error": "syntax"
+ },
+ {
+ "comment": "Two level projection of a literal",
+ "expression": "twolen[*].threelen[*].`\"bar\"`",
+ "error": "syntax"
+ },
+ {
+ "comment": "Two level flattened projection of a literal",
+ "expression": "twolen[].threelen[].`\"bar\"`",
+ "error": "syntax"
+ }
+ ]
+ },
+ {
+ "comment": "Identifiers",
+ "given": {"type": "object"},
+ "cases": [
+ {
+ "expression": "foo",
+ "result": null
+ },
+ {
+ "expression": "\"foo\"",
+ "result": null
+ },
+ {
+ "expression": "\"\\\\\"",
+ "result": null
+ }
+ ]
+ },
+ {
+ "comment": "Combined syntax",
+ "given": [],
+ "cases": [
+ {
+ "expression": "*||*|*|*",
+ "result": null
+ },
+ {
+ "expression": "*[]||[*]",
+ "result": []
+ },
+ {
+ "expression": "[*.*]",
+ "result": [null]
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/unicode.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/unicode.json
new file mode 100644
index 00000000000..6b07b0b6dae
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/unicode.json
@@ -0,0 +1,38 @@
+[
+ {
+ "given": {"foo": [{"✓": "✓"}, {"✓": "✗"}]},
+ "cases": [
+ {
+ "expression": "foo[].\"✓\"",
+ "result": ["✓", "✗"]
+ }
+ ]
+ },
+ {
+ "given": {"☯": true},
+ "cases": [
+ {
+ "expression": "\"☯\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {"♪♫•*¨*•.¸¸❤¸¸.•*¨*•♫♪": true},
+ "cases": [
+ {
+ "expression": "\"♪♫•*¨*•.¸¸❤¸¸.•*¨*•♫♪\"",
+ "result": true
+ }
+ ]
+ },
+ {
+ "given": {"☃": true},
+ "cases": [
+ {
+ "expression": "\"☃\"",
+ "result": true
+ }
+ ]
+ }
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/wildcard.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/wildcard.json
new file mode 100644
index 00000000000..3bcec302815
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/wildcard.json
@@ -0,0 +1,460 @@
+[{
+ "given": {
+ "foo": {
+ "bar": {
+ "baz": "val"
+ },
+ "other": {
+ "baz": "val"
+ },
+ "other2": {
+ "baz": "val"
+ },
+ "other3": {
+ "notbaz": ["a", "b", "c"]
+ },
+ "other4": {
+ "notbaz": ["a", "b", "c"]
+ },
+ "other5": {
+ "other": {
+ "a": 1,
+ "b": 1,
+ "c": 1
+ }
+ }
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.*.baz",
+ "result": ["val", "val", "val"]
+ },
+ {
+ "expression": "foo.bar.*",
+ "result": ["val"]
+ },
+ {
+ "expression": "foo.*.notbaz",
+ "result": [["a", "b", "c"], ["a", "b", "c"]]
+ },
+ {
+ "expression": "foo.*.notbaz[0]",
+ "result": ["a", "a"]
+ },
+ {
+ "expression": "foo.*.notbaz[-1]",
+ "result": ["c", "c"]
+ }
+ ]
+}, {
+ "given": {
+ "foo": {
+ "first-1": {
+ "second-1": "val"
+ },
+ "first-2": {
+ "second-1": "val"
+ },
+ "first-3": {
+ "second-1": "val"
+ }
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.*",
+ "result": [{"second-1": "val"}, {"second-1": "val"},
+ {"second-1": "val"}]
+ },
+ {
+ "expression": "foo.*.*",
+ "result": [["val"], ["val"], ["val"]]
+ },
+ {
+ "expression": "foo.*.*.*",
+ "result": [[], [], []]
+ },
+ {
+ "expression": "foo.*.*.*.*",
+ "result": [[], [], []]
+ }
+ ]
+}, {
+ "given": {
+ "foo": {
+ "bar": "one"
+ },
+ "other": {
+ "bar": "one"
+ },
+ "nomatch": {
+ "notbar": "three"
+ }
+ },
+ "cases": [
+ {
+ "expression": "*.bar",
+ "result": ["one", "one"]
+ }
+ ]
+}, {
+ "given": {
+ "top1": {
+ "sub1": {"foo": "one"}
+ },
+ "top2": {
+ "sub1": {"foo": "one"}
+ }
+ },
+ "cases": [
+ {
+ "expression": "*",
+ "result": [{"sub1": {"foo": "one"}},
+ {"sub1": {"foo": "one"}}]
+ },
+ {
+ "expression": "*.sub1",
+ "result": [{"foo": "one"},
+ {"foo": "one"}]
+ },
+ {
+ "expression": "*.*",
+ "result": [[{"foo": "one"}],
+ [{"foo": "one"}]]
+ },
+ {
+ "expression": "*.*.foo[]",
+ "result": ["one", "one"]
+ },
+ {
+ "expression": "*.sub1.foo",
+ "result": ["one", "one"]
+ }
+ ]
+},
+{
+ "given":
+ {"foo": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]},
+ "cases": [
+ {
+ "expression": "foo[*].bar",
+ "result": ["one", "two", "three"]
+ },
+ {
+ "expression": "foo[*].notbar",
+ "result": ["four"]
+ }
+ ]
+},
+{
+ "given":
+ [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}],
+ "cases": [
+ {
+ "expression": "[*]",
+ "result": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]
+ },
+ {
+ "expression": "[*].bar",
+ "result": ["one", "two", "three"]
+ },
+ {
+ "expression": "[*].notbar",
+ "result": ["four"]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": {
+ "bar": [
+ {"baz": ["one", "two", "three"]},
+ {"baz": ["four", "five", "six"]},
+ {"baz": ["seven", "eight", "nine"]}
+ ]
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.bar[*].baz",
+ "result": [["one", "two", "three"], ["four", "five", "six"], ["seven", "eight", "nine"]]
+ },
+ {
+ "expression": "foo.bar[*].baz[0]",
+ "result": ["one", "four", "seven"]
+ },
+ {
+ "expression": "foo.bar[*].baz[1]",
+ "result": ["two", "five", "eight"]
+ },
+ {
+ "expression": "foo.bar[*].baz[2]",
+ "result": ["three", "six", "nine"]
+ },
+ {
+ "expression": "foo.bar[*].baz[3]",
+ "result": []
+ }
+ ]
+},
+{
+ "given": {
+ "foo": {
+ "bar": [["one", "two"], ["three", "four"]]
+ }
+ },
+ "cases": [
+ {
+ "expression": "foo.bar[*]",
+ "result": [["one", "two"], ["three", "four"]]
+ },
+ {
+ "expression": "foo.bar[0]",
+ "result": ["one", "two"]
+ },
+ {
+ "expression": "foo.bar[0][0]",
+ "result": "one"
+ },
+ {
+ "expression": "foo.bar[0][0][0]",
+ "result": null
+ },
+ {
+ "expression": "foo.bar[0][0][0][0]",
+ "result": null
+ },
+ {
+ "expression": "foo[0][0]",
+ "result": null
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [
+ {"bar": [{"kind": "basic"}, {"kind": "intermediate"}]},
+ {"bar": [{"kind": "advanced"}, {"kind": "expert"}]},
+ {"bar": "string"}
+ ]
+
+ },
+ "cases": [
+ {
+ "expression": "foo[*].bar[*].kind",
+ "result": [["basic", "intermediate"], ["advanced", "expert"]]
+ },
+ {
+ "expression": "foo[*].bar[0].kind",
+ "result": ["basic", "advanced"]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [
+ {"bar": {"kind": "basic"}},
+ {"bar": {"kind": "intermediate"}},
+ {"bar": {"kind": "advanced"}},
+ {"bar": {"kind": "expert"}},
+ {"bar": "string"}
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo[*].bar.kind",
+ "result": ["basic", "intermediate", "advanced", "expert"]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [{"bar": ["one", "two"]}, {"bar": ["three", "four"]}, {"bar": ["five"]}]
+ },
+ "cases": [
+ {
+ "expression": "foo[*].bar[0]",
+ "result": ["one", "three", "five"]
+ },
+ {
+ "expression": "foo[*].bar[1]",
+ "result": ["two", "four"]
+ },
+ {
+ "expression": "foo[*].bar[2]",
+ "result": []
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [{"bar": []}, {"bar": []}, {"bar": []}]
+ },
+ "cases": [
+ {
+ "expression": "foo[*].bar[0]",
+ "result": []
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [["one", "two"], ["three", "four"], ["five"]]
+ },
+ "cases": [
+ {
+ "expression": "foo[*][0]",
+ "result": ["one", "three", "five"]
+ },
+ {
+ "expression": "foo[*][1]",
+ "result": ["two", "four"]
+ }
+ ]
+},
+{
+ "given": {
+ "foo": [
+ [
+ ["one", "two"], ["three", "four"]
+ ], [
+ ["five", "six"], ["seven", "eight"]
+ ], [
+ ["nine"], ["ten"]
+ ]
+ ]
+ },
+ "cases": [
+ {
+ "expression": "foo[*][0]",
+ "result": [["one", "two"], ["five", "six"], ["nine"]]
+ },
+ {
+ "expression": "foo[*][1]",
+ "result": [["three", "four"], ["seven", "eight"], ["ten"]]
+ },
+ {
+ "expression": "foo[*][0][0]",
+ "result": ["one", "five", "nine"]
+ },
+ {
+ "expression": "foo[*][1][0]",
+ "result": ["three", "seven", "ten"]
+ },
+ {
+ "expression": "foo[*][0][1]",
+ "result": ["two", "six"]
+ },
+ {
+ "expression": "foo[*][1][1]",
+ "result": ["four", "eight"]
+ },
+ {
+ "expression": "foo[*][2]",
+ "result": []
+ },
+ {
+ "expression": "foo[*][2][2]",
+ "result": []
+ },
+ {
+ "expression": "bar[*]",
+ "result": null
+ },
+ {
+ "expression": "bar[*].baz[*]",
+ "result": null
+ }
+ ]
+},
+{
+ "given": {
+ "string": "string",
+ "hash": {"foo": "bar", "bar": "baz"},
+ "number": 23,
+ "nullvalue": null
+ },
+ "cases": [
+ {
+ "expression": "string[*]",
+ "result": null
+ },
+ {
+ "expression": "hash[*]",
+ "result": null
+ },
+ {
+ "expression": "number[*]",
+ "result": null
+ },
+ {
+ "expression": "nullvalue[*]",
+ "result": null
+ },
+ {
+ "expression": "string[*].foo",
+ "result": null
+ },
+ {
+ "expression": "hash[*].foo",
+ "result": null
+ },
+ {
+ "expression": "number[*].foo",
+ "result": null
+ },
+ {
+ "expression": "nullvalue[*].foo",
+ "result": null
+ },
+ {
+ "expression": "nullvalue[*].foo[*].bar",
+ "result": null
+ }
+ ]
+},
+{
+ "given": {
+ "string": "string",
+ "hash": {"foo": "val", "bar": "val"},
+ "number": 23,
+ "array": [1, 2, 3],
+ "nullvalue": null
+ },
+ "cases": [
+ {
+ "expression": "string.*",
+ "result": null
+ },
+ {
+ "expression": "hash.*",
+ "result": ["val", "val"]
+ },
+ {
+ "expression": "number.*",
+ "result": null
+ },
+ {
+ "expression": "array.*",
+ "result": null
+ },
+ {
+ "expression": "nullvalue.*",
+ "result": null
+ }
+ ]
+},
+{
+ "given": {
+ "a": [0, 1, 2],
+ "b": [0, 1, 2]
+ },
+ "cases": [
+ {
+ "expression": "*[0]",
+ "result": [0, 0]
+ }
+ ]
+}
+]
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance_test.go
new file mode 100644
index 00000000000..4ee9c959dc6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance_test.go
@@ -0,0 +1,123 @@
+package jmespath
+
+import (
+ "encoding/json"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+type TestSuite struct {
+ Given interface{}
+ TestCases []TestCase `json:"cases"`
+ Comment string
+}
+type TestCase struct {
+ Comment string
+ Expression string
+ Result interface{}
+ Error string
+}
+
+var whiteListed = []string{
+ "compliance/basic.json",
+ "compliance/current.json",
+ "compliance/escape.json",
+ "compliance/filters.json",
+ "compliance/functions.json",
+ "compliance/identifiers.json",
+ "compliance/indices.json",
+ "compliance/literal.json",
+ "compliance/multiselect.json",
+ "compliance/ormatch.json",
+ "compliance/pipe.json",
+ "compliance/slice.json",
+ "compliance/syntax.json",
+ "compliance/unicode.json",
+ "compliance/wildcard.json",
+ "compliance/boolean.json",
+}
+
+func allowed(path string) bool {
+ for _, el := range whiteListed {
+ if el == path {
+ return true
+ }
+ }
+ return false
+}
+
+func TestCompliance(t *testing.T) {
+ assert := assert.New(t)
+
+ var complianceFiles []string
+ err := filepath.Walk("compliance", func(path string, _ os.FileInfo, _ error) error {
+ //if strings.HasSuffix(path, ".json") {
+ if allowed(path) {
+ complianceFiles = append(complianceFiles, path)
+ }
+ return nil
+ })
+ if assert.Nil(err) {
+ for _, filename := range complianceFiles {
+ runComplianceTest(assert, filename)
+ }
+ }
+}
+
+func runComplianceTest(assert *assert.Assertions, filename string) {
+ var testSuites []TestSuite
+ data, err := ioutil.ReadFile(filename)
+ if assert.Nil(err) {
+ err := json.Unmarshal(data, &testSuites)
+ if assert.Nil(err) {
+ for _, testsuite := range testSuites {
+ runTestSuite(assert, testsuite, filename)
+ }
+ }
+ }
+}
+
+func runTestSuite(assert *assert.Assertions, testsuite TestSuite, filename string) {
+ for _, testcase := range testsuite.TestCases {
+ if testcase.Error != "" {
+ // This is a test case that verifies we error out properly.
+ runSyntaxTestCase(assert, testsuite.Given, testcase, filename)
+ } else {
+ runTestCase(assert, testsuite.Given, testcase, filename)
+ }
+ }
+}
+
+func runSyntaxTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) {
+ // Anything with an .Error means that we expect that JMESPath should return
+ // an error when we try to evaluate the expression.
+ _, err := Search(testcase.Expression, given)
+ assert.NotNil(err, fmt.Sprintf("Expression: %s", testcase.Expression))
+}
+
+func runTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) {
+ lexer := NewLexer()
+ var err error
+ _, err = lexer.tokenize(testcase.Expression)
+ if err != nil {
+ errMsg := fmt.Sprintf("(%s) Could not lex expression: %s -- %s", filename, testcase.Expression, err.Error())
+ assert.Fail(errMsg)
+ return
+ }
+ parser := NewParser()
+ _, err = parser.Parse(testcase.Expression)
+ if err != nil {
+ errMsg := fmt.Sprintf("(%s) Could not parse expression: %s -- %s", filename, testcase.Expression, err.Error())
+ assert.Fail(errMsg)
+ return
+ }
+ actual, err := Search(testcase.Expression, given)
+ if assert.Nil(err, fmt.Sprintf("Expression: %s", testcase.Expression)) {
+ assert.Equal(testcase.Result, actual, fmt.Sprintf("Expression: %s", testcase.Expression))
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go
new file mode 100644
index 00000000000..8a3f2ef0dce
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go
@@ -0,0 +1,840 @@
+package jmespath
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "math"
+ "sort"
+ "strconv"
+ "strings"
+ "unicode/utf8"
+)
+
+type jpFunction func(arguments []interface{}) (interface{}, error)
+
+type jpType string
+
+const (
+ jpUnknown jpType = "unknown"
+ jpNumber jpType = "number"
+ jpString jpType = "string"
+ jpArray jpType = "array"
+ jpObject jpType = "object"
+ jpArrayNumber jpType = "array[number]"
+ jpArrayString jpType = "array[string]"
+ jpExpref jpType = "expref"
+ jpAny jpType = "any"
+)
+
+type functionEntry struct {
+ name string
+ arguments []argSpec
+ handler jpFunction
+ hasExpRef bool
+}
+
+type argSpec struct {
+ types []jpType
+ variadic bool
+}
+
+type byExprString struct {
+ intr *treeInterpreter
+ node ASTNode
+ items []interface{}
+ hasError bool
+}
+
+func (a *byExprString) Len() int {
+ return len(a.items)
+}
+func (a *byExprString) Swap(i, j int) {
+ a.items[i], a.items[j] = a.items[j], a.items[i]
+}
+func (a *byExprString) Less(i, j int) bool {
+ first, err := a.intr.Execute(a.node, a.items[i])
+ if err != nil {
+ a.hasError = true
+ // Return a dummy value.
+ return true
+ }
+ ith, ok := first.(string)
+ if !ok {
+ a.hasError = true
+ return true
+ }
+ second, err := a.intr.Execute(a.node, a.items[j])
+ if err != nil {
+ a.hasError = true
+ // Return a dummy value.
+ return true
+ }
+ jth, ok := second.(string)
+ if !ok {
+ a.hasError = true
+ return true
+ }
+ return ith < jth
+}
+
+type byExprFloat struct {
+ intr *treeInterpreter
+ node ASTNode
+ items []interface{}
+ hasError bool
+}
+
+func (a *byExprFloat) Len() int {
+ return len(a.items)
+}
+func (a *byExprFloat) Swap(i, j int) {
+ a.items[i], a.items[j] = a.items[j], a.items[i]
+}
+func (a *byExprFloat) Less(i, j int) bool {
+ first, err := a.intr.Execute(a.node, a.items[i])
+ if err != nil {
+ a.hasError = true
+ // Return a dummy value.
+ return true
+ }
+ ith, ok := first.(float64)
+ if !ok {
+ a.hasError = true
+ return true
+ }
+ second, err := a.intr.Execute(a.node, a.items[j])
+ if err != nil {
+ a.hasError = true
+ // Return a dummy value.
+ return true
+ }
+ jth, ok := second.(float64)
+ if !ok {
+ a.hasError = true
+ return true
+ }
+ return ith < jth
+}
+
+type functionCaller struct {
+ functionTable map[string]functionEntry
+}
+
+func newFunctionCaller() *functionCaller {
+ caller := &functionCaller{}
+ caller.functionTable = map[string]functionEntry{
+ "length": functionEntry{
+ name: "length",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpString, jpArray, jpObject}},
+ },
+ handler: jpfLength,
+ },
+ "starts_with": functionEntry{
+ name: "starts_with",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpString}},
+ argSpec{types: []jpType{jpString}},
+ },
+ handler: jpfStartsWith,
+ },
+ "abs": functionEntry{
+ name: "abs",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpNumber}},
+ },
+ handler: jpfAbs,
+ },
+ "avg": functionEntry{
+ name: "avg",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArrayNumber}},
+ },
+ handler: jpfAvg,
+ },
+ "ceil": functionEntry{
+ name: "ceil",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpNumber}},
+ },
+ handler: jpfCeil,
+ },
+ "contains": functionEntry{
+ name: "contains",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArray, jpString}},
+ argSpec{types: []jpType{jpAny}},
+ },
+ handler: jpfContains,
+ },
+ "ends_with": functionEntry{
+ name: "ends_with",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpString}},
+ argSpec{types: []jpType{jpString}},
+ },
+ handler: jpfEndsWith,
+ },
+ "floor": functionEntry{
+ name: "floor",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpNumber}},
+ },
+ handler: jpfFloor,
+ },
+ "map": functionEntry{
+ name: "amp",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpExpref}},
+ argSpec{types: []jpType{jpArray}},
+ },
+ handler: jpfMap,
+ hasExpRef: true,
+ },
+ "max": functionEntry{
+ name: "max",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArrayNumber, jpArrayString}},
+ },
+ handler: jpfMax,
+ },
+ "merge": functionEntry{
+ name: "merge",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpObject}, variadic: true},
+ },
+ handler: jpfMerge,
+ },
+ "max_by": functionEntry{
+ name: "max_by",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArray}},
+ argSpec{types: []jpType{jpExpref}},
+ },
+ handler: jpfMaxBy,
+ hasExpRef: true,
+ },
+ "sum": functionEntry{
+ name: "sum",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArrayNumber}},
+ },
+ handler: jpfSum,
+ },
+ "min": functionEntry{
+ name: "min",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArrayNumber, jpArrayString}},
+ },
+ handler: jpfMin,
+ },
+ "min_by": functionEntry{
+ name: "min_by",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArray}},
+ argSpec{types: []jpType{jpExpref}},
+ },
+ handler: jpfMinBy,
+ hasExpRef: true,
+ },
+ "type": functionEntry{
+ name: "type",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpAny}},
+ },
+ handler: jpfType,
+ },
+ "keys": functionEntry{
+ name: "keys",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpObject}},
+ },
+ handler: jpfKeys,
+ },
+ "values": functionEntry{
+ name: "values",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpObject}},
+ },
+ handler: jpfValues,
+ },
+ "sort": functionEntry{
+ name: "sort",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArrayString, jpArrayNumber}},
+ },
+ handler: jpfSort,
+ },
+ "sort_by": functionEntry{
+ name: "sort_by",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArray}},
+ argSpec{types: []jpType{jpExpref}},
+ },
+ handler: jpfSortBy,
+ hasExpRef: true,
+ },
+ "join": functionEntry{
+ name: "join",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpString}},
+ argSpec{types: []jpType{jpArrayString}},
+ },
+ handler: jpfJoin,
+ },
+ "reverse": functionEntry{
+ name: "reverse",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpArray, jpString}},
+ },
+ handler: jpfReverse,
+ },
+ "to_array": functionEntry{
+ name: "to_array",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpAny}},
+ },
+ handler: jpfToArray,
+ },
+ "to_string": functionEntry{
+ name: "to_string",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpAny}},
+ },
+ handler: jpfToString,
+ },
+ "to_number": functionEntry{
+ name: "to_number",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpAny}},
+ },
+ handler: jpfToNumber,
+ },
+ "not_null": functionEntry{
+ name: "not_null",
+ arguments: []argSpec{
+ argSpec{types: []jpType{jpAny}, variadic: true},
+ },
+ handler: jpfNotNull,
+ },
+ }
+ return caller
+}
+
+func (e *functionEntry) resolveArgs(arguments []interface{}) ([]interface{}, error) {
+ if len(e.arguments) == 0 {
+ return arguments, nil
+ }
+ if !e.arguments[len(e.arguments)-1].variadic {
+ if len(e.arguments) != len(arguments) {
+ return nil, errors.New("incorrect number of args")
+ }
+ for i, spec := range e.arguments {
+ userArg := arguments[i]
+ err := spec.typeCheck(userArg)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return arguments, nil
+ }
+ if len(arguments) < len(e.arguments) {
+ return nil, errors.New("Invalid arity.")
+ }
+ return arguments, nil
+}
+
+func (a *argSpec) typeCheck(arg interface{}) error {
+ for _, t := range a.types {
+ switch t {
+ case jpNumber:
+ if _, ok := arg.(float64); ok {
+ return nil
+ }
+ case jpString:
+ if _, ok := arg.(string); ok {
+ return nil
+ }
+ case jpArray:
+ if _, ok := arg.([]interface{}); ok {
+ return nil
+ }
+ case jpObject:
+ if _, ok := arg.(map[string]interface{}); ok {
+ return nil
+ }
+ case jpArrayNumber:
+ if _, ok := toArrayNum(arg); ok {
+ return nil
+ }
+ case jpArrayString:
+ if _, ok := toArrayStr(arg); ok {
+ return nil
+ }
+ case jpAny:
+ return nil
+ case jpExpref:
+ if _, ok := arg.(expRef); ok {
+ return nil
+ }
+ }
+ }
+ return fmt.Errorf("Invalid type for: %v, expected: %#v", arg, a.types)
+}
+
+func (f *functionCaller) CallFunction(name string, arguments []interface{}, intr *treeInterpreter) (interface{}, error) {
+ entry, ok := f.functionTable[name]
+ if !ok {
+ return nil, errors.New("unknown function: " + name)
+ }
+ resolvedArgs, err := entry.resolveArgs(arguments)
+ if err != nil {
+ return nil, err
+ }
+ if entry.hasExpRef {
+ var extra []interface{}
+ extra = append(extra, intr)
+ resolvedArgs = append(extra, resolvedArgs...)
+ }
+ return entry.handler(resolvedArgs)
+}
+
+func jpfAbs(arguments []interface{}) (interface{}, error) {
+ num := arguments[0].(float64)
+ return math.Abs(num), nil
+}
+
+func jpfLength(arguments []interface{}) (interface{}, error) {
+ arg := arguments[0]
+ if c, ok := arg.(string); ok {
+ return float64(utf8.RuneCountInString(c)), nil
+ } else if c, ok := arg.([]interface{}); ok {
+ return float64(len(c)), nil
+ } else if c, ok := arg.(map[string]interface{}); ok {
+ return float64(len(c)), nil
+ }
+ return nil, errors.New("could not compute length()")
+}
+
+func jpfStartsWith(arguments []interface{}) (interface{}, error) {
+ search := arguments[0].(string)
+ prefix := arguments[1].(string)
+ return strings.HasPrefix(search, prefix), nil
+}
+
+func jpfAvg(arguments []interface{}) (interface{}, error) {
+ // We've already type checked the value so we can safely use
+ // type assertions.
+ args := arguments[0].([]interface{})
+ length := float64(len(args))
+ numerator := 0.0
+ for _, n := range args {
+ numerator += n.(float64)
+ }
+ return numerator / length, nil
+}
+func jpfCeil(arguments []interface{}) (interface{}, error) {
+ val := arguments[0].(float64)
+ return math.Ceil(val), nil
+}
+func jpfContains(arguments []interface{}) (interface{}, error) {
+ search := arguments[0]
+ el := arguments[1]
+ if searchStr, ok := search.(string); ok {
+ if elStr, ok := el.(string); ok {
+ return strings.Index(searchStr, elStr) != -1, nil
+ }
+ return false, nil
+ }
+ // Otherwise this is a generic contains for []interface{}
+ general := search.([]interface{})
+ for _, item := range general {
+ if item == el {
+ return true, nil
+ }
+ }
+ return false, nil
+}
+func jpfEndsWith(arguments []interface{}) (interface{}, error) {
+ search := arguments[0].(string)
+ suffix := arguments[1].(string)
+ return strings.HasSuffix(search, suffix), nil
+}
+func jpfFloor(arguments []interface{}) (interface{}, error) {
+ val := arguments[0].(float64)
+ return math.Floor(val), nil
+}
+func jpfMap(arguments []interface{}) (interface{}, error) {
+ intr := arguments[0].(*treeInterpreter)
+ exp := arguments[1].(expRef)
+ node := exp.ref
+ arr := arguments[2].([]interface{})
+ mapped := make([]interface{}, 0, len(arr))
+ for _, value := range arr {
+ current, err := intr.Execute(node, value)
+ if err != nil {
+ return nil, err
+ }
+ mapped = append(mapped, current)
+ }
+ return mapped, nil
+}
+func jpfMax(arguments []interface{}) (interface{}, error) {
+ if items, ok := toArrayNum(arguments[0]); ok {
+ if len(items) == 0 {
+ return nil, nil
+ }
+ if len(items) == 1 {
+ return items[0], nil
+ }
+ best := items[0]
+ for _, item := range items[1:] {
+ if item > best {
+ best = item
+ }
+ }
+ return best, nil
+ }
+ // Otherwise we're dealing with a max() of strings.
+ items, _ := toArrayStr(arguments[0])
+ if len(items) == 0 {
+ return nil, nil
+ }
+ if len(items) == 1 {
+ return items[0], nil
+ }
+ best := items[0]
+ for _, item := range items[1:] {
+ if item > best {
+ best = item
+ }
+ }
+ return best, nil
+}
+func jpfMerge(arguments []interface{}) (interface{}, error) {
+ final := make(map[string]interface{})
+ for _, m := range arguments {
+ mapped := m.(map[string]interface{})
+ for key, value := range mapped {
+ final[key] = value
+ }
+ }
+ return final, nil
+}
+func jpfMaxBy(arguments []interface{}) (interface{}, error) {
+ intr := arguments[0].(*treeInterpreter)
+ arr := arguments[1].([]interface{})
+ exp := arguments[2].(expRef)
+ node := exp.ref
+ if len(arr) == 0 {
+ return nil, nil
+ } else if len(arr) == 1 {
+ return arr[0], nil
+ }
+ start, err := intr.Execute(node, arr[0])
+ if err != nil {
+ return nil, err
+ }
+ switch t := start.(type) {
+ case float64:
+ bestVal := t
+ bestItem := arr[0]
+ for _, item := range arr[1:] {
+ result, err := intr.Execute(node, item)
+ if err != nil {
+ return nil, err
+ }
+ current, ok := result.(float64)
+ if !ok {
+ return nil, errors.New("invalid type, must be number")
+ }
+ if current > bestVal {
+ bestVal = current
+ bestItem = item
+ }
+ }
+ return bestItem, nil
+ case string:
+ bestVal := t
+ bestItem := arr[0]
+ for _, item := range arr[1:] {
+ result, err := intr.Execute(node, item)
+ if err != nil {
+ return nil, err
+ }
+ current, ok := result.(string)
+ if !ok {
+ return nil, errors.New("invalid type, must be string")
+ }
+ if current > bestVal {
+ bestVal = current
+ bestItem = item
+ }
+ }
+ return bestItem, nil
+ default:
+ return nil, errors.New("invalid type, must be number of string")
+ }
+}
+func jpfSum(arguments []interface{}) (interface{}, error) {
+ items, _ := toArrayNum(arguments[0])
+ sum := 0.0
+ for _, item := range items {
+ sum += item
+ }
+ return sum, nil
+}
+
+func jpfMin(arguments []interface{}) (interface{}, error) {
+ if items, ok := toArrayNum(arguments[0]); ok {
+ if len(items) == 0 {
+ return nil, nil
+ }
+ if len(items) == 1 {
+ return items[0], nil
+ }
+ best := items[0]
+ for _, item := range items[1:] {
+ if item < best {
+ best = item
+ }
+ }
+ return best, nil
+ }
+ items, _ := toArrayStr(arguments[0])
+ if len(items) == 0 {
+ return nil, nil
+ }
+ if len(items) == 1 {
+ return items[0], nil
+ }
+ best := items[0]
+ for _, item := range items[1:] {
+ if item < best {
+ best = item
+ }
+ }
+ return best, nil
+}
+
+func jpfMinBy(arguments []interface{}) (interface{}, error) {
+ intr := arguments[0].(*treeInterpreter)
+ arr := arguments[1].([]interface{})
+ exp := arguments[2].(expRef)
+ node := exp.ref
+ if len(arr) == 0 {
+ return nil, nil
+ } else if len(arr) == 1 {
+ return arr[0], nil
+ }
+ start, err := intr.Execute(node, arr[0])
+ if err != nil {
+ return nil, err
+ }
+ if t, ok := start.(float64); ok {
+ bestVal := t
+ bestItem := arr[0]
+ for _, item := range arr[1:] {
+ result, err := intr.Execute(node, item)
+ if err != nil {
+ return nil, err
+ }
+ current, ok := result.(float64)
+ if !ok {
+ return nil, errors.New("invalid type, must be number")
+ }
+ if current < bestVal {
+ bestVal = current
+ bestItem = item
+ }
+ }
+ return bestItem, nil
+ } else if t, ok := start.(string); ok {
+ bestVal := t
+ bestItem := arr[0]
+ for _, item := range arr[1:] {
+ result, err := intr.Execute(node, item)
+ if err != nil {
+ return nil, err
+ }
+ current, ok := result.(string)
+ if !ok {
+ return nil, errors.New("invalid type, must be string")
+ }
+ if current < bestVal {
+ bestVal = current
+ bestItem = item
+ }
+ }
+ return bestItem, nil
+ } else {
+ return nil, errors.New("invalid type, must be number of string")
+ }
+}
+func jpfType(arguments []interface{}) (interface{}, error) {
+ arg := arguments[0]
+ if _, ok := arg.(float64); ok {
+ return "number", nil
+ }
+ if _, ok := arg.(string); ok {
+ return "string", nil
+ }
+ if _, ok := arg.([]interface{}); ok {
+ return "array", nil
+ }
+ if _, ok := arg.(map[string]interface{}); ok {
+ return "object", nil
+ }
+ if arg == nil {
+ return "null", nil
+ }
+ if arg == true || arg == false {
+ return "boolean", nil
+ }
+ return nil, errors.New("unknown type")
+}
+func jpfKeys(arguments []interface{}) (interface{}, error) {
+ arg := arguments[0].(map[string]interface{})
+ collected := make([]interface{}, 0, len(arg))
+ for key := range arg {
+ collected = append(collected, key)
+ }
+ return collected, nil
+}
+func jpfValues(arguments []interface{}) (interface{}, error) {
+ arg := arguments[0].(map[string]interface{})
+ collected := make([]interface{}, 0, len(arg))
+ for _, value := range arg {
+ collected = append(collected, value)
+ }
+ return collected, nil
+}
+func jpfSort(arguments []interface{}) (interface{}, error) {
+ if items, ok := toArrayNum(arguments[0]); ok {
+ d := sort.Float64Slice(items)
+ sort.Stable(d)
+ final := make([]interface{}, len(d))
+ for i, val := range d {
+ final[i] = val
+ }
+ return final, nil
+ }
+ // Otherwise we're dealing with sort()'ing strings.
+ items, _ := toArrayStr(arguments[0])
+ d := sort.StringSlice(items)
+ sort.Stable(d)
+ final := make([]interface{}, len(d))
+ for i, val := range d {
+ final[i] = val
+ }
+ return final, nil
+}
+func jpfSortBy(arguments []interface{}) (interface{}, error) {
+ intr := arguments[0].(*treeInterpreter)
+ arr := arguments[1].([]interface{})
+ exp := arguments[2].(expRef)
+ node := exp.ref
+ if len(arr) == 0 {
+ return arr, nil
+ } else if len(arr) == 1 {
+ return arr, nil
+ }
+ start, err := intr.Execute(node, arr[0])
+ if err != nil {
+ return nil, err
+ }
+ if _, ok := start.(float64); ok {
+ sortable := &byExprFloat{intr, node, arr, false}
+ sort.Stable(sortable)
+ if sortable.hasError {
+ return nil, errors.New("error in sort_by comparison")
+ }
+ return arr, nil
+ } else if _, ok := start.(string); ok {
+ sortable := &byExprString{intr, node, arr, false}
+ sort.Stable(sortable)
+ if sortable.hasError {
+ return nil, errors.New("error in sort_by comparison")
+ }
+ return arr, nil
+ } else {
+ return nil, errors.New("invalid type, must be number of string")
+ }
+}
+func jpfJoin(arguments []interface{}) (interface{}, error) {
+ sep := arguments[0].(string)
+ // We can't just do arguments[1].([]string), we have to
+ // manually convert each item to a string.
+ arrayStr := []string{}
+ for _, item := range arguments[1].([]interface{}) {
+ arrayStr = append(arrayStr, item.(string))
+ }
+ return strings.Join(arrayStr, sep), nil
+}
+func jpfReverse(arguments []interface{}) (interface{}, error) {
+ if s, ok := arguments[0].(string); ok {
+ r := []rune(s)
+ for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
+ r[i], r[j] = r[j], r[i]
+ }
+ return string(r), nil
+ }
+ items := arguments[0].([]interface{})
+ length := len(items)
+ reversed := make([]interface{}, length)
+ for i, item := range items {
+ reversed[length-(i+1)] = item
+ }
+ return reversed, nil
+}
+func jpfToArray(arguments []interface{}) (interface{}, error) {
+ if _, ok := arguments[0].([]interface{}); ok {
+ return arguments[0], nil
+ }
+ return arguments[:1:1], nil
+}
+func jpfToString(arguments []interface{}) (interface{}, error) {
+ if v, ok := arguments[0].(string); ok {
+ return v, nil
+ }
+ result, err := json.Marshal(arguments[0])
+ if err != nil {
+ return nil, err
+ }
+ return string(result), nil
+}
+func jpfToNumber(arguments []interface{}) (interface{}, error) {
+ arg := arguments[0]
+ if v, ok := arg.(float64); ok {
+ return v, nil
+ }
+ if v, ok := arg.(string); ok {
+ conv, err := strconv.ParseFloat(v, 64)
+ if err != nil {
+ return nil, nil
+ }
+ return conv, nil
+ }
+ if _, ok := arg.([]interface{}); ok {
+ return nil, nil
+ }
+ if _, ok := arg.(map[string]interface{}); ok {
+ return nil, nil
+ }
+ if arg == nil {
+ return nil, nil
+ }
+ if arg == true || arg == false {
+ return nil, nil
+ }
+ return nil, errors.New("unknown type")
+}
+func jpfNotNull(arguments []interface{}) (interface{}, error) {
+ for _, arg := range arguments {
+ if arg != nil {
+ return arg, nil
+ }
+ }
+ return nil, nil
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10
new file mode 100644
index 00000000000..4d5f9756e55
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10
@@ -0,0 +1 @@
+foo.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100
new file mode 100644
index 00000000000..bc4f6a3f49c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100
@@ -0,0 +1 @@
+ends_with(str, 'SStr')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101
new file mode 100644
index 00000000000..81bf07a7a1b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101
@@ -0,0 +1 @@
+ends_with(str, 'foo')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102
new file mode 100644
index 00000000000..3225de91399
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102
@@ -0,0 +1 @@
+floor(`1.2`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103
new file mode 100644
index 00000000000..8cac9595822
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103
@@ -0,0 +1 @@
+floor(decimals[0])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104
new file mode 100644
index 00000000000..bd76f47e216
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104
@@ -0,0 +1 @@
+floor(foo)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105
new file mode 100644
index 00000000000..c719add3deb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105
@@ -0,0 +1 @@
+length('abc')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106
new file mode 100644
index 00000000000..ff12f04f148
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106
@@ -0,0 +1 @@
+length('')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107
new file mode 100644
index 00000000000..0eccba1d3a0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107
@@ -0,0 +1 @@
+length(@)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108
new file mode 100644
index 00000000000..ab14b0fa8e6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108
@@ -0,0 +1 @@
+length(strings[0])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109
new file mode 100644
index 00000000000..f1514bb7438
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109
@@ -0,0 +1 @@
+length(str)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110
new file mode 100644
index 00000000000..09276059a23
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110
@@ -0,0 +1 @@
+length(array)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112
new file mode 100644
index 00000000000..ab14b0fa8e6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112
@@ -0,0 +1 @@
+length(strings[0])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115
new file mode 100644
index 00000000000..bfb41ae9875
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115
@@ -0,0 +1 @@
+max(strings)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118
new file mode 100644
index 00000000000..915ec172ae7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118
@@ -0,0 +1 @@
+merge(`{}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119
new file mode 100644
index 00000000000..5b74e9b593f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119
@@ -0,0 +1 @@
+merge(`{}`, `{}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12
new file mode 100644
index 00000000000..64c5e5885a4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12
@@ -0,0 +1 @@
+two
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120
new file mode 100644
index 00000000000..f34dcd8fade
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120
@@ -0,0 +1 @@
+merge(`{"a": 1}`, `{"b": 2}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121
new file mode 100644
index 00000000000..e335dc96fea
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121
@@ -0,0 +1 @@
+merge(`{"a": 1}`, `{"a": 2}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122
new file mode 100644
index 00000000000..aac28fffeb3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122
@@ -0,0 +1 @@
+merge(`{"a": 1, "b": 2}`, `{"a": 2, "c": 3}`, `{"d": 4}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123
new file mode 100644
index 00000000000..1c6fd67198e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123
@@ -0,0 +1 @@
+min(numbers)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126
new file mode 100644
index 00000000000..93e68db7759
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126
@@ -0,0 +1 @@
+min(decimals)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128
new file mode 100644
index 00000000000..554601ea427
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128
@@ -0,0 +1 @@
+type('abc')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129
new file mode 100644
index 00000000000..1ab2d9834f8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129
@@ -0,0 +1 @@
+type(`1.0`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13
new file mode 100644
index 00000000000..1d19714ffbc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13
@@ -0,0 +1 @@
+three
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130
new file mode 100644
index 00000000000..3cee2f56f15
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130
@@ -0,0 +1 @@
+type(`2`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131
new file mode 100644
index 00000000000..4821f9aefcf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131
@@ -0,0 +1 @@
+type(`true`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132
new file mode 100644
index 00000000000..40b6913a6c0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132
@@ -0,0 +1 @@
+type(`false`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133
new file mode 100644
index 00000000000..c711252be28
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133
@@ -0,0 +1 @@
+type(`null`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134
new file mode 100644
index 00000000000..ec5d07e95cc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134
@@ -0,0 +1 @@
+type(`[0]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135
new file mode 100644
index 00000000000..2080401e1ea
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135
@@ -0,0 +1 @@
+type(`{"a": "b"}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136
new file mode 100644
index 00000000000..c5ee2ba5cb8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136
@@ -0,0 +1 @@
+type(@)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137
new file mode 100644
index 00000000000..1814ca17b87
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137
@@ -0,0 +1 @@
+keys(objects)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138
new file mode 100644
index 00000000000..e03cdb0d640
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138
@@ -0,0 +1 @@
+values(objects)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139
new file mode 100644
index 00000000000..7fea8d2ce5c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139
@@ -0,0 +1 @@
+keys(empty_hash)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14
new file mode 100644
index 00000000000..a17c92f5974
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14
@@ -0,0 +1 @@
+one.two
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140
new file mode 100644
index 00000000000..4f1d882a406
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140
@@ -0,0 +1 @@
+join(', ', strings)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141
new file mode 100644
index 00000000000..4f1d882a406
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141
@@ -0,0 +1 @@
+join(', ', strings)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142
new file mode 100644
index 00000000000..19ec1fe0900
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142
@@ -0,0 +1 @@
+join(',', `["a", "b"]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143
new file mode 100644
index 00000000000..761c68a6b59
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143
@@ -0,0 +1 @@
+join('|', strings)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144
new file mode 100644
index 00000000000..a0dd68eaa90
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144
@@ -0,0 +1 @@
+join('|', decimals[].to_string(@))
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145
new file mode 100644
index 00000000000..a4190b2ba25
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145
@@ -0,0 +1 @@
+join('|', empty_list)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146
new file mode 100644
index 00000000000..f5033c30223
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146
@@ -0,0 +1 @@
+reverse(numbers)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147
new file mode 100644
index 00000000000..822f054d50c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147
@@ -0,0 +1 @@
+reverse(array)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148
new file mode 100644
index 00000000000..a584adcc0c5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148
@@ -0,0 +1 @@
+reverse(`[]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149
new file mode 100644
index 00000000000..fb4cc5dc482
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149
@@ -0,0 +1 @@
+reverse('')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15
new file mode 100644
index 00000000000..693f9549627
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15
@@ -0,0 +1 @@
+foo."1"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150
new file mode 100644
index 00000000000..aa260fabc17
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150
@@ -0,0 +1 @@
+reverse('hello world')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151
new file mode 100644
index 00000000000..d8c58826afd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151
@@ -0,0 +1 @@
+starts_with(str, 'S')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152
new file mode 100644
index 00000000000..32e16b7bb00
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152
@@ -0,0 +1 @@
+starts_with(str, 'St')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153
new file mode 100644
index 00000000000..5f575ae7fc4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153
@@ -0,0 +1 @@
+starts_with(str, 'Str')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155
new file mode 100644
index 00000000000..f31551c62fd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155
@@ -0,0 +1 @@
+sum(numbers)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156
new file mode 100644
index 00000000000..18b90446cc9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156
@@ -0,0 +1 @@
+sum(decimals)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157
new file mode 100644
index 00000000000..def4d0bc19c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157
@@ -0,0 +1 @@
+sum(array[].to_number(@))
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158
new file mode 100644
index 00000000000..48e4a7707c7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158
@@ -0,0 +1 @@
+sum(`[]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159
new file mode 100644
index 00000000000..9fb939a0b1b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159
@@ -0,0 +1 @@
+to_array('foo')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16
new file mode 100644
index 00000000000..86155ed7546
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16
@@ -0,0 +1 @@
+foo."1"[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160
new file mode 100644
index 00000000000..74ba7cc67db
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160
@@ -0,0 +1 @@
+to_array(`0`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161
new file mode 100644
index 00000000000..57f8b983f08
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161
@@ -0,0 +1 @@
+to_array(objects)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162
new file mode 100644
index 00000000000..d17c7345faf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162
@@ -0,0 +1 @@
+to_array(`[1, 2, 3]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163
new file mode 100644
index 00000000000..15f70f78399
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163
@@ -0,0 +1 @@
+to_array(false)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164
new file mode 100644
index 00000000000..9b227529b40
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164
@@ -0,0 +1 @@
+to_string('foo')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165
new file mode 100644
index 00000000000..489a42935a6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165
@@ -0,0 +1 @@
+to_string(`1.2`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166
new file mode 100644
index 00000000000..d17106a00f5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166
@@ -0,0 +1 @@
+to_string(`[0, 1]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167
new file mode 100644
index 00000000000..4f4ae9e6890
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167
@@ -0,0 +1 @@
+to_number('1.0')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168
new file mode 100644
index 00000000000..ce932e2e6ac
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168
@@ -0,0 +1 @@
+to_number('1.1')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169
new file mode 100644
index 00000000000..e246fa4dbcb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169
@@ -0,0 +1 @@
+to_number('4')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17
new file mode 100644
index 00000000000..de0b4c39d99
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17
@@ -0,0 +1 @@
+foo."-1"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170
new file mode 100644
index 00000000000..f8c264747e9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170
@@ -0,0 +1 @@
+to_number('notanumber')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171
new file mode 100644
index 00000000000..7d423b1cd19
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171
@@ -0,0 +1 @@
+to_number(`false`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172
new file mode 100644
index 00000000000..503716b687c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172
@@ -0,0 +1 @@
+to_number(`null`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173
new file mode 100644
index 00000000000..7f61dfa157b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173
@@ -0,0 +1 @@
+to_number(`[0]`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174
new file mode 100644
index 00000000000..ee72a8c01ac
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174
@@ -0,0 +1 @@
+to_number(`{"foo": 0}`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175
new file mode 100644
index 00000000000..8d8f1f75906
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175
@@ -0,0 +1 @@
+sort(numbers)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178
new file mode 100644
index 00000000000..8cb54ba47b3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178
@@ -0,0 +1 @@
+sort(empty_list)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179
new file mode 100644
index 00000000000..cf2c9b1db2e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179
@@ -0,0 +1 @@
+not_null(unknown_key, str)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18
new file mode 100644
index 00000000000..b516b2c489f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18
@@ -0,0 +1 @@
+@
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180
new file mode 100644
index 00000000000..e047d486682
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180
@@ -0,0 +1 @@
+not_null(unknown_key, foo.bar, empty_list, str)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181
new file mode 100644
index 00000000000..c4cc87b9c12
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181
@@ -0,0 +1 @@
+not_null(unknown_key, null_key, empty_list, str)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182
new file mode 100644
index 00000000000..2c7fa0a9c1e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182
@@ -0,0 +1 @@
+not_null(all, expressions, are_null)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183
new file mode 100644
index 00000000000..eb096e61cdd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183
@@ -0,0 +1 @@
+numbers[].to_string(@)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184
new file mode 100644
index 00000000000..4958abaec45
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184
@@ -0,0 +1 @@
+array[].to_number(@)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185
new file mode 100644
index 00000000000..1027084724d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185
@@ -0,0 +1 @@
+foo[].not_null(f, e, d, c, b, a)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186
new file mode 100644
index 00000000000..83cb9161282
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186
@@ -0,0 +1 @@
+sort_by(people, &age)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187
new file mode 100644
index 00000000000..a494d6c4bf1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187
@@ -0,0 +1 @@
+sort_by(people, &to_number(age_str))
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188
new file mode 100644
index 00000000000..2294fc54d12
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188
@@ -0,0 +1 @@
+sort_by(people, &age)[].name
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189
new file mode 100644
index 00000000000..bb8c2b46d1f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189
@@ -0,0 +1 @@
+sort_by(people, &age)[].extra
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19
new file mode 100644
index 00000000000..e3ed49ac653
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19
@@ -0,0 +1 @@
+@.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190
new file mode 100644
index 00000000000..3ab0290340a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190
@@ -0,0 +1 @@
+sort_by(`[]`, &age)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191
new file mode 100644
index 00000000000..97db56f7b67
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191
@@ -0,0 +1 @@
+max_by(people, &age)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192
new file mode 100644
index 00000000000..a7e648de963
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192
@@ -0,0 +1 @@
+max_by(people, &age_str)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193
new file mode 100644
index 00000000000..be4348d0c1e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193
@@ -0,0 +1 @@
+max_by(people, &to_number(age_str))
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194
new file mode 100644
index 00000000000..a707283d499
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194
@@ -0,0 +1 @@
+min_by(people, &age)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195
new file mode 100644
index 00000000000..2cd6618d84b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195
@@ -0,0 +1 @@
+min_by(people, &age_str)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196
new file mode 100644
index 00000000000..833e6837382
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196
@@ -0,0 +1 @@
+min_by(people, &to_number(age_str))
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198
new file mode 100644
index 00000000000..706dbda89a8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198
@@ -0,0 +1 @@
+__L
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199
new file mode 100644
index 00000000000..ca593ca93c1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199
@@ -0,0 +1 @@
+"!\r"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2
new file mode 100644
index 00000000000..4d5f9756e55
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2
@@ -0,0 +1 @@
+foo.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20
new file mode 100644
index 00000000000..f300ab91782
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20
@@ -0,0 +1 @@
+@.foo[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200
new file mode 100644
index 00000000000..9c93843541d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200
@@ -0,0 +1 @@
+Y_1623
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201
new file mode 100644
index 00000000000..c1b0730e013
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201
@@ -0,0 +1 @@
+x
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202
new file mode 100644
index 00000000000..1552ec63a6f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202
@@ -0,0 +1 @@
+"\tF\uCebb"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203
new file mode 100644
index 00000000000..047041273f0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203
@@ -0,0 +1 @@
+" \t"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204
new file mode 100644
index 00000000000..efd782cc325
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204
@@ -0,0 +1 @@
+" "
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205
new file mode 100644
index 00000000000..8494ac27064
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205
@@ -0,0 +1 @@
+v2
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206
new file mode 100644
index 00000000000..c61f7f7ebd8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206
@@ -0,0 +1 @@
+"\t"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207
new file mode 100644
index 00000000000..f6055f1898f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207
@@ -0,0 +1 @@
+_X
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208
new file mode 100644
index 00000000000..4f58e0e7bd2
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208
@@ -0,0 +1 @@
+"\t4\ud9da\udd15"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209
new file mode 100644
index 00000000000..f536bfbf687
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209
@@ -0,0 +1 @@
+v24_W
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21
new file mode 100644
index 00000000000..ef47ff2c056
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21
@@ -0,0 +1 @@
+"foo.bar"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210
new file mode 100644
index 00000000000..69759281cb4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210
@@ -0,0 +1 @@
+"H"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211
new file mode 100644
index 00000000000..c3e8b5927fb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211
@@ -0,0 +1 @@
+"\f"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212
new file mode 100644
index 00000000000..24ecc222cbf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212
@@ -0,0 +1 @@
+"E4"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213
new file mode 100644
index 00000000000..5693009d2e4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213
@@ -0,0 +1 @@
+"!"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214
new file mode 100644
index 00000000000..62dd220e719
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214
@@ -0,0 +1 @@
+tM
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215
new file mode 100644
index 00000000000..3c1e81f55ae
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215
@@ -0,0 +1 @@
+" ["
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216
new file mode 100644
index 00000000000..493daa673c4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216
@@ -0,0 +1 @@
+"R!"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217
new file mode 100644
index 00000000000..116b50ab38b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217
@@ -0,0 +1 @@
+_6W
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218
new file mode 100644
index 00000000000..0073fac4520
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218
@@ -0,0 +1 @@
+"\uaBA1\r"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219
new file mode 100644
index 00000000000..00d8fa37eeb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219
@@ -0,0 +1 @@
+tL7
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22
new file mode 100644
index 00000000000..661ebcfa337
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22
@@ -0,0 +1 @@
+"foo bar"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220
new file mode 100644
index 00000000000..c14f16e0264
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220
@@ -0,0 +1 @@
+"<"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257
new file mode 100644
index 00000000000..8a2443e6e90
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257
@@ -0,0 +1 @@
+hvu
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258
new file mode 100644
index 00000000000..c9ddacbb61f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258
@@ -0,0 +1 @@
+"; !"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259
new file mode 100644
index 00000000000..d0209c6df0a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259
@@ -0,0 +1 @@
+hU
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26
new file mode 100644
index 00000000000..82649bd24ee
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26
@@ -0,0 +1 @@
+"/unix/path"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260
new file mode 100644
index 00000000000..c07242aa44b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260
@@ -0,0 +1 @@
+"!I\n\/"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261
new file mode 100644
index 00000000000..7aae4effc7c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261
@@ -0,0 +1 @@
+"\uEEbF"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262
new file mode 100644
index 00000000000..c1574f35ffa
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262
@@ -0,0 +1 @@
+"U)\t"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263
new file mode 100644
index 00000000000..5197e3a2bf5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263
@@ -0,0 +1 @@
+fa0_9
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264
new file mode 100644
index 00000000000..320558b0053
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264
@@ -0,0 +1 @@
+"/"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265
new file mode 100644
index 00000000000..4a2cb086527
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265
@@ -0,0 +1 @@
+Gy
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266
new file mode 100644
index 00000000000..9524c83813c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266
@@ -0,0 +1 @@
+"\b"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267
new file mode 100644
index 00000000000..066b8d98b78
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267
@@ -0,0 +1 @@
+"<"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268
new file mode 100644
index 00000000000..c61f7f7ebd8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268
@@ -0,0 +1 @@
+"\t"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269
new file mode 100644
index 00000000000..a582f62d282
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269
@@ -0,0 +1 @@
+"\t&\\\r"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27
new file mode 100644
index 00000000000..a1d50731c78
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27
@@ -0,0 +1 @@
+"\"\"\""
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270
new file mode 100644
index 00000000000..e3c5eedeb59
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270
@@ -0,0 +1 @@
+"#"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271
new file mode 100644
index 00000000000..e75309a5241
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271
@@ -0,0 +1 @@
+B__
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272
new file mode 100644
index 00000000000..027177272c5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272
@@ -0,0 +1 @@
+"\nS \n"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273
new file mode 100644
index 00000000000..99432276ec4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273
@@ -0,0 +1 @@
+Bp
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274
new file mode 100644
index 00000000000..d4f8a788b80
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274
@@ -0,0 +1 @@
+",\t;"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275
new file mode 100644
index 00000000000..56c384f7530
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275
@@ -0,0 +1 @@
+B_q
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276
new file mode 100644
index 00000000000..f093d2aa3bc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276
@@ -0,0 +1 @@
+"\/+\t\n\b!Z"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277
new file mode 100644
index 00000000000..11e1229d9e3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277
@@ -0,0 +1 @@
+"\\ueFAc"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278
new file mode 100644
index 00000000000..90dbfcfcd35
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278
@@ -0,0 +1 @@
+":\f"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279
new file mode 100644
index 00000000000..b06b8302524
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279
@@ -0,0 +1 @@
+"\/"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28
new file mode 100644
index 00000000000..5f55d73af66
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28
@@ -0,0 +1 @@
+"bar"."baz"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280
new file mode 100644
index 00000000000..0e4bf7c113b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280
@@ -0,0 +1 @@
+_BW_6Hg_Gl
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281
new file mode 100644
index 00000000000..81bb45f8059
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281
@@ -0,0 +1 @@
+""
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282
new file mode 100644
index 00000000000..d0b4de14642
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282
@@ -0,0 +1 @@
+zs1DC
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283
new file mode 100644
index 00000000000..68797580caa
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283
@@ -0,0 +1 @@
+__434
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284
new file mode 100644
index 00000000000..e61be91c4af
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284
@@ -0,0 +1 @@
+""
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285
new file mode 100644
index 00000000000..026cb9cbb51
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285
@@ -0,0 +1 @@
+Z_5
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286
new file mode 100644
index 00000000000..ca9587d06c0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286
@@ -0,0 +1 @@
+z_M_
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287
new file mode 100644
index 00000000000..67f6d9c42a3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287
@@ -0,0 +1 @@
+YU_2
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288
new file mode 100644
index 00000000000..927ab653a73
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288
@@ -0,0 +1 @@
+_0
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289
new file mode 100644
index 00000000000..39307ab938e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289
@@ -0,0 +1 @@
+"\b+"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29
new file mode 100644
index 00000000000..8b0c5b41bd9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29
@@ -0,0 +1 @@
+foo[?name == 'a']
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290
new file mode 100644
index 00000000000..a3ec2ed7a12
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290
@@ -0,0 +1 @@
+"\""
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291
new file mode 100644
index 00000000000..26bf7e122de
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291
@@ -0,0 +1 @@
+D7
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292
new file mode 100644
index 00000000000..d595c9f43a9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292
@@ -0,0 +1 @@
+_62L
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293
new file mode 100644
index 00000000000..f6869694967
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293
@@ -0,0 +1 @@
+"\tK\t"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294
new file mode 100644
index 00000000000..f3a9b7edb50
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294
@@ -0,0 +1 @@
+"\n\\\f"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295
new file mode 100644
index 00000000000..455f00ffc29
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295
@@ -0,0 +1 @@
+I_
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296
new file mode 100644
index 00000000000..ccd5968f9c1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296
@@ -0,0 +1 @@
+W_a0_
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297
new file mode 100644
index 00000000000..ee55c16fc81
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297
@@ -0,0 +1 @@
+BQ
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298
new file mode 100644
index 00000000000..0d1a169a67a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298
@@ -0,0 +1 @@
+"\tX$\uABBb"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299
new file mode 100644
index 00000000000..0573cfd73fd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299
@@ -0,0 +1 @@
+Z9
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3
new file mode 100644
index 00000000000..f0fcbd8eaf4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3
@@ -0,0 +1 @@
+foo.bar.baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30
new file mode 100644
index 00000000000..4f8e6a17aab
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30
@@ -0,0 +1 @@
+*[?[0] == `0`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300
new file mode 100644
index 00000000000..a0db02bebf1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300
@@ -0,0 +1 @@
+"\b%\""
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301
new file mode 100644
index 00000000000..56032f7a248
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301
@@ -0,0 +1 @@
+_F
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302
new file mode 100644
index 00000000000..4a8a3cff369
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302
@@ -0,0 +1 @@
+"!,"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303
new file mode 100644
index 00000000000..7c1efac0004
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303
@@ -0,0 +1 @@
+"\"!"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304
new file mode 100644
index 00000000000..a0f489d532f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304
@@ -0,0 +1 @@
+Hh
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305
new file mode 100644
index 00000000000..c64e8d5ac8b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305
@@ -0,0 +1 @@
+"&"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306
new file mode 100644
index 00000000000..0567e992f14
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306
@@ -0,0 +1 @@
+"9\r\\R"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307
new file mode 100644
index 00000000000..ce8245c5b97
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307
@@ -0,0 +1 @@
+M_k
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308
new file mode 100644
index 00000000000..8f16a5ac048
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308
@@ -0,0 +1 @@
+"!\b\n\"\""
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309
new file mode 100644
index 00000000000..504ff5ae39f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309
@@ -0,0 +1 @@
+"6"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31
new file mode 100644
index 00000000000..07fb57234b8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31
@@ -0,0 +1 @@
+foo[?first == last]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310
new file mode 100644
index 00000000000..533dd8e5460
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310
@@ -0,0 +1 @@
+_7
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311
new file mode 100644
index 00000000000..1e4a3a34155
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311
@@ -0,0 +1 @@
+"0"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312
new file mode 100644
index 00000000000..37961f6ca42
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312
@@ -0,0 +1 @@
+"\\8\\"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313
new file mode 100644
index 00000000000..23480cff14c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313
@@ -0,0 +1 @@
+b7eo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314
new file mode 100644
index 00000000000..e609f81a3b8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314
@@ -0,0 +1 @@
+xIUo9
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315
new file mode 100644
index 00000000000..d89a25f0b97
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315
@@ -0,0 +1 @@
+"5"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316
new file mode 100644
index 00000000000..5adcf5e7dc5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316
@@ -0,0 +1 @@
+"?"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317
new file mode 100644
index 00000000000..ace4a897d33
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317
@@ -0,0 +1 @@
+sU
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318
new file mode 100644
index 00000000000..feffb7061b3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318
@@ -0,0 +1 @@
+"VH2&H\\\/"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319
new file mode 100644
index 00000000000..8223f1e51e3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319
@@ -0,0 +1 @@
+_C
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32
new file mode 100644
index 00000000000..7e85c4bdfe9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32
@@ -0,0 +1 @@
+foo[?first == last].first
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320
new file mode 100644
index 00000000000..c9cdc63b070
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320
@@ -0,0 +1 @@
+_
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321
new file mode 100644
index 00000000000..c82f7982ee0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321
@@ -0,0 +1 @@
+"<\t"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322
new file mode 100644
index 00000000000..dae65c51554
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322
@@ -0,0 +1 @@
+"\uD834\uDD1E"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323
new file mode 100644
index 00000000000..b6b3695438a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323
@@ -0,0 +1 @@
+foo.bar[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324
new file mode 100644
index 00000000000..bf06e678c15
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324
@@ -0,0 +1 @@
+foo.bar[1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325
new file mode 100644
index 00000000000..5d48e0205ce
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325
@@ -0,0 +1 @@
+foo.bar[2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326
new file mode 100644
index 00000000000..de3af7230f9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326
@@ -0,0 +1 @@
+foo.bar[3]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327
new file mode 100644
index 00000000000..a1c33350841
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327
@@ -0,0 +1 @@
+foo.bar[-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328
new file mode 100644
index 00000000000..ad0fef91cfa
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328
@@ -0,0 +1 @@
+foo.bar[-2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329
new file mode 100644
index 00000000000..3e83c6f7306
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329
@@ -0,0 +1 @@
+foo.bar[-3]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33
new file mode 100644
index 00000000000..72fc0a53e79
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33
@@ -0,0 +1 @@
+foo[?age > `25`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330
new file mode 100644
index 00000000000..433a737d65e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330
@@ -0,0 +1 @@
+foo.bar[-4]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331
new file mode 100644
index 00000000000..4d5f9756e55
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331
@@ -0,0 +1 @@
+foo.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332
new file mode 100644
index 00000000000..5e0d9b71772
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332
@@ -0,0 +1 @@
+foo[0].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333
new file mode 100644
index 00000000000..3cd7e9460fe
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333
@@ -0,0 +1 @@
+foo[1].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334
new file mode 100644
index 00000000000..74cb1765558
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334
@@ -0,0 +1 @@
+foo[2].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335
new file mode 100644
index 00000000000..3cf2007f70d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335
@@ -0,0 +1 @@
+foo[3].notbar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336
new file mode 100644
index 00000000000..9674d880375
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336
@@ -0,0 +1 @@
+foo[3].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337
new file mode 100644
index 00000000000..9b0b2f8189b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337
@@ -0,0 +1 @@
+foo[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338
new file mode 100644
index 00000000000..83c639a185b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338
@@ -0,0 +1 @@
+foo[1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339
new file mode 100644
index 00000000000..3b76c9f64a4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339
@@ -0,0 +1 @@
+foo[2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34
new file mode 100644
index 00000000000..9a2b0184edf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34
@@ -0,0 +1 @@
+foo[?age >= `25`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340
new file mode 100644
index 00000000000..ff99e045d2e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340
@@ -0,0 +1 @@
+foo[3]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341
new file mode 100644
index 00000000000..040ecb240c8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341
@@ -0,0 +1 @@
+foo[4]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342
new file mode 100644
index 00000000000..6e7ea636eec
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342
@@ -0,0 +1 @@
+[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343
new file mode 100644
index 00000000000..bace2a0be17
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343
@@ -0,0 +1 @@
+[1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344
new file mode 100644
index 00000000000..5d50c80c068
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344
@@ -0,0 +1 @@
+[2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345
new file mode 100644
index 00000000000..99d21a2a0f0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345
@@ -0,0 +1 @@
+[-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346
new file mode 100644
index 00000000000..133a9c6272f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346
@@ -0,0 +1 @@
+[-2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347
new file mode 100644
index 00000000000..b7f78c5dc51
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347
@@ -0,0 +1 @@
+[-3]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348
new file mode 100644
index 00000000000..bd9de815f45
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348
@@ -0,0 +1 @@
+reservations[].instances[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349
new file mode 100644
index 00000000000..55e6257352f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349
@@ -0,0 +1 @@
+reservations[].instances[].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35
new file mode 100644
index 00000000000..fa83f1da3b7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35
@@ -0,0 +1 @@
+foo[?age > `30`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350
new file mode 100644
index 00000000000..1661747c04d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350
@@ -0,0 +1 @@
+reservations[].notinstances[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351
new file mode 100644
index 00000000000..1661747c04d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351
@@ -0,0 +1 @@
+reservations[].notinstances[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352
new file mode 100644
index 00000000000..3debc70f895
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352
@@ -0,0 +1 @@
+reservations[].instances[].foo[].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353
new file mode 100644
index 00000000000..75af2fda069
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353
@@ -0,0 +1 @@
+reservations[].instances[].foo[].baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354
new file mode 100644
index 00000000000..4a70cd8a03c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354
@@ -0,0 +1 @@
+reservations[].instances[].notfoo[].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355
new file mode 100644
index 00000000000..987985b002f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355
@@ -0,0 +1 @@
+reservations[].instances[].notfoo[].notbar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356
new file mode 100644
index 00000000000..1661747c04d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356
@@ -0,0 +1 @@
+reservations[].notinstances[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357
new file mode 100644
index 00000000000..634f937e555
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357
@@ -0,0 +1 @@
+reservations[].instances[].foo[].notbar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358
new file mode 100644
index 00000000000..09cb7b8bb1b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358
@@ -0,0 +1 @@
+reservations[].instances[].bar[].baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359
new file mode 100644
index 00000000000..f5d9ac5b763
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359
@@ -0,0 +1 @@
+reservations[].instances[].baz[].baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36
new file mode 100644
index 00000000000..463a2a542db
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36
@@ -0,0 +1 @@
+foo[?age < `25`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360
new file mode 100644
index 00000000000..d1016d6e75b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360
@@ -0,0 +1 @@
+reservations[].instances[].qux[].baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361
new file mode 100644
index 00000000000..ef54cf52d67
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361
@@ -0,0 +1 @@
+reservations[].instances[].qux[].baz[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362
new file mode 100644
index 00000000000..bea506ff235
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362
@@ -0,0 +1 @@
+foo[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363
new file mode 100644
index 00000000000..20dd081e0e4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363
@@ -0,0 +1 @@
+foo[][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364
new file mode 100644
index 00000000000..4803734b09e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364
@@ -0,0 +1 @@
+foo[][1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365
new file mode 100644
index 00000000000..1be56598534
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365
@@ -0,0 +1 @@
+foo[][0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366
new file mode 100644
index 00000000000..d2cf6da59fe
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366
@@ -0,0 +1 @@
+foo[][2][2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367
new file mode 100644
index 00000000000..c609ca64b16
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367
@@ -0,0 +1 @@
+foo[][0][0][100]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369
new file mode 100644
index 00000000000..bea506ff235
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369
@@ -0,0 +1 @@
+foo[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37
new file mode 100644
index 00000000000..10ed5d3f61f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37
@@ -0,0 +1 @@
+foo[?age <= `25`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370
new file mode 100644
index 00000000000..13f2c4a0b4f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370
@@ -0,0 +1 @@
+foo[].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371
new file mode 100644
index 00000000000..edf3d92775d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371
@@ -0,0 +1 @@
+foo[].bar[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372
new file mode 100644
index 00000000000..2a3b993af24
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372
@@ -0,0 +1 @@
+foo[].bar[].baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373
new file mode 100644
index 00000000000..d5ca878a13b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373
@@ -0,0 +1 @@
+string[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374
new file mode 100644
index 00000000000..fcd255f5d0c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374
@@ -0,0 +1 @@
+hash[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375
new file mode 100644
index 00000000000..2d53bd7cdcd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375
@@ -0,0 +1 @@
+number[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376
new file mode 100644
index 00000000000..cb10d2497e1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376
@@ -0,0 +1 @@
+nullvalue[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377
new file mode 100644
index 00000000000..f6c79ca84ff
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377
@@ -0,0 +1 @@
+string[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378
new file mode 100644
index 00000000000..09bf36e8a90
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378
@@ -0,0 +1 @@
+hash[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379
new file mode 100644
index 00000000000..4c357818919
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379
@@ -0,0 +1 @@
+number[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38
new file mode 100644
index 00000000000..16a4c36acbd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38
@@ -0,0 +1 @@
+foo[?age < `20`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380
new file mode 100644
index 00000000000..2dd8ae21855
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380
@@ -0,0 +1 @@
+nullvalue[].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381
new file mode 100644
index 00000000000..dfed8160389
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381
@@ -0,0 +1 @@
+nullvalue[].foo[].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382
new file mode 100644
index 00000000000..d7628e646e1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382
@@ -0,0 +1 @@
+`"foo"`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383
new file mode 100644
index 00000000000..49c5269b12e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383
@@ -0,0 +1 @@
+`"\u03a6"`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384
new file mode 100644
index 00000000000..d5db721d012
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384
@@ -0,0 +1 @@
+`"✓"`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385
new file mode 100644
index 00000000000..a2b6e4ec85d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385
@@ -0,0 +1 @@
+`[1, 2, 3]`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386
new file mode 100644
index 00000000000..f5801bdd680
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386
@@ -0,0 +1 @@
+`{"a": "b"}`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387
new file mode 100644
index 00000000000..f87db59a8b7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387
@@ -0,0 +1 @@
+`true`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388
new file mode 100644
index 00000000000..3b20d905f33
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388
@@ -0,0 +1 @@
+`false`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389
new file mode 100644
index 00000000000..70bcd29a7a8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389
@@ -0,0 +1 @@
+`null`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39
new file mode 100644
index 00000000000..351054d3e61
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39
@@ -0,0 +1 @@
+foo[?age == `20`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390
new file mode 100644
index 00000000000..0918d41559b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390
@@ -0,0 +1 @@
+`0`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391
new file mode 100644
index 00000000000..ef70c4c11e7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391
@@ -0,0 +1 @@
+`1`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392
new file mode 100644
index 00000000000..b39a922f403
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392
@@ -0,0 +1 @@
+`2`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393
new file mode 100644
index 00000000000..7e65687dbfc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393
@@ -0,0 +1 @@
+`3`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394
new file mode 100644
index 00000000000..770d1ece705
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394
@@ -0,0 +1 @@
+`4`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395
new file mode 100644
index 00000000000..a8b81985c76
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395
@@ -0,0 +1 @@
+`5`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396
new file mode 100644
index 00000000000..7f0861065e7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396
@@ -0,0 +1 @@
+`6`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397
new file mode 100644
index 00000000000..495114d919e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397
@@ -0,0 +1 @@
+`7`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398
new file mode 100644
index 00000000000..94f355c46ca
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398
@@ -0,0 +1 @@
+`8`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399
new file mode 100644
index 00000000000..600d2aa3f49
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399
@@ -0,0 +1 @@
+`9`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4
new file mode 100644
index 00000000000..31485223580
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4
@@ -0,0 +1 @@
+foo.bar.baz.bad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40
new file mode 100644
index 00000000000..99d9258a625
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40
@@ -0,0 +1 @@
+foo[?age != `20`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400
new file mode 100644
index 00000000000..637015b5fde
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400
@@ -0,0 +1 @@
+`"foo\`bar"`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401
new file mode 100644
index 00000000000..6fa7557b8d8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401
@@ -0,0 +1 @@
+`"foo\"bar"`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402
new file mode 100644
index 00000000000..5aabeec3419
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402
@@ -0,0 +1 @@
+`"1\`"`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403
new file mode 100644
index 00000000000..8302ea1984d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403
@@ -0,0 +1 @@
+`"\\"`.{a:`"b"`}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404
new file mode 100644
index 00000000000..d88d014a96c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404
@@ -0,0 +1 @@
+`{"a": "b"}`.a
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405
new file mode 100644
index 00000000000..47152dddb73
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405
@@ -0,0 +1 @@
+`{"a": {"b": "c"}}`.a.b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406
new file mode 100644
index 00000000000..895d4293878
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406
@@ -0,0 +1 @@
+`[0, 1, 2]`[1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407
new file mode 100644
index 00000000000..42500a368cc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407
@@ -0,0 +1 @@
+` {"foo": true}`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408
new file mode 100644
index 00000000000..08b944dad4a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408
@@ -0,0 +1 @@
+`{"foo": true} `
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409
new file mode 100644
index 00000000000..6de163f80bc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409
@@ -0,0 +1 @@
+'foo'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41
new file mode 100644
index 00000000000..5bc357d9fa6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41
@@ -0,0 +1 @@
+foo[?top.name == 'a']
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410
new file mode 100644
index 00000000000..b84bbdb29fb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410
@@ -0,0 +1 @@
+' foo '
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411
new file mode 100644
index 00000000000..bf6a07ace3d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411
@@ -0,0 +1 @@
+'0'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412
new file mode 100644
index 00000000000..c742f5b0c97
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412
@@ -0,0 +1,2 @@
+'newline
+'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413
new file mode 100644
index 00000000000..04e9b3ade60
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413
@@ -0,0 +1,2 @@
+'
+'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414
new file mode 100644
index 00000000000..ebdaf120d7b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414
@@ -0,0 +1 @@
+'✓'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415
new file mode 100644
index 00000000000..d0ba5d7facb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415
@@ -0,0 +1 @@
+'𝄞'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416
new file mode 100644
index 00000000000..19c2e2ef41c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416
@@ -0,0 +1 @@
+' [foo] '
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417
new file mode 100644
index 00000000000..5faa483b197
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417
@@ -0,0 +1 @@
+'[foo]'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418
new file mode 100644
index 00000000000..e3c05c163a3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418
@@ -0,0 +1 @@
+'\u03a6'
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419
new file mode 100644
index 00000000000..7c13861ac72
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419
@@ -0,0 +1 @@
+foo.{bar: bar}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42
new file mode 100644
index 00000000000..d037a0a4ddf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42
@@ -0,0 +1 @@
+foo[?top.first == top.last]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420
new file mode 100644
index 00000000000..f795c255219
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420
@@ -0,0 +1 @@
+foo.{"bar": bar}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421
new file mode 100644
index 00000000000..772c45639cc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421
@@ -0,0 +1 @@
+foo.{"foo.bar": bar}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422
new file mode 100644
index 00000000000..8808e92bf31
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422
@@ -0,0 +1 @@
+foo.{bar: bar, baz: baz}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423
new file mode 100644
index 00000000000..3f13757a10c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423
@@ -0,0 +1 @@
+foo.{"bar": bar, "baz": baz}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424
new file mode 100644
index 00000000000..23cd8903e73
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424
@@ -0,0 +1 @@
+{"baz": baz, "qux\"": "qux\""}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425
new file mode 100644
index 00000000000..fabb6da4fe8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425
@@ -0,0 +1 @@
+foo.{bar:bar,baz:baz}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426
new file mode 100644
index 00000000000..4c3f615b1cd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426
@@ -0,0 +1 @@
+foo.{bar: bar,qux: qux}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427
new file mode 100644
index 00000000000..8bc46535ac5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427
@@ -0,0 +1 @@
+foo.{bar: bar, noexist: noexist}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428
new file mode 100644
index 00000000000..2024b6f118d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428
@@ -0,0 +1 @@
+foo.{noexist: noexist, alsonoexist: alsonoexist}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429
new file mode 100644
index 00000000000..b52191d10a4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429
@@ -0,0 +1 @@
+foo.badkey.{nokey: nokey, alsonokey: alsonokey}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43
new file mode 100644
index 00000000000..8534a5cae9f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43
@@ -0,0 +1 @@
+foo[?top == `{"first": "foo", "last": "bar"}`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430
new file mode 100644
index 00000000000..5cd310b6d24
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430
@@ -0,0 +1 @@
+foo.nested.*.{a: a,b: b}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431
new file mode 100644
index 00000000000..0b24ef53526
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431
@@ -0,0 +1 @@
+foo.nested.three.{a: a, cinner: c.inner}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432
new file mode 100644
index 00000000000..473c1c351b4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432
@@ -0,0 +1 @@
+foo.nested.three.{a: a, c: c.inner.bad.key}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433
new file mode 100644
index 00000000000..44ba735ab10
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433
@@ -0,0 +1 @@
+foo.{a: nested.one.a, b: nested.two.b}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434
new file mode 100644
index 00000000000..f5f89b12b5c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434
@@ -0,0 +1 @@
+{bar: bar, baz: baz}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435
new file mode 100644
index 00000000000..697764cb306
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435
@@ -0,0 +1 @@
+{bar: bar}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436
new file mode 100644
index 00000000000..20447fb1054
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436
@@ -0,0 +1 @@
+{otherkey: bar}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437
new file mode 100644
index 00000000000..310b9b1dd27
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437
@@ -0,0 +1 @@
+{no: no, exist: exist}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438
new file mode 100644
index 00000000000..c79b2e24068
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438
@@ -0,0 +1 @@
+foo.[bar]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439
new file mode 100644
index 00000000000..ab498ef654c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439
@@ -0,0 +1 @@
+foo.[bar,baz]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44
new file mode 100644
index 00000000000..71307c40947
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44
@@ -0,0 +1 @@
+foo[?key == `true`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440
new file mode 100644
index 00000000000..4b8f39a468e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440
@@ -0,0 +1 @@
+foo.[bar,qux]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441
new file mode 100644
index 00000000000..b8f9020f8e7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441
@@ -0,0 +1 @@
+foo.[bar,noexist]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442
new file mode 100644
index 00000000000..b7c7b3f6556
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442
@@ -0,0 +1 @@
+foo.[noexist,alsonoexist]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443
new file mode 100644
index 00000000000..fabb6da4fe8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443
@@ -0,0 +1 @@
+foo.{bar:bar,baz:baz}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444
new file mode 100644
index 00000000000..c15c39f82c1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444
@@ -0,0 +1 @@
+foo.[bar,baz[0]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445
new file mode 100644
index 00000000000..9cebd89844f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445
@@ -0,0 +1 @@
+foo.[bar,baz[1]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446
new file mode 100644
index 00000000000..c5bbfbf848f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446
@@ -0,0 +1 @@
+foo.[bar,baz[2]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447
new file mode 100644
index 00000000000..d81cb2b9041
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447
@@ -0,0 +1 @@
+foo.[bar,baz[3]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448
new file mode 100644
index 00000000000..3a65aa7d6f1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448
@@ -0,0 +1 @@
+foo.[bar[0],baz[3]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449
new file mode 100644
index 00000000000..8808e92bf31
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449
@@ -0,0 +1 @@
+foo.{bar: bar, baz: baz}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45
new file mode 100644
index 00000000000..e142b22a25f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45
@@ -0,0 +1 @@
+foo[?key == `false`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450
new file mode 100644
index 00000000000..ab498ef654c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450
@@ -0,0 +1 @@
+foo.[bar,baz]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451
new file mode 100644
index 00000000000..8e3d22dc53f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451
@@ -0,0 +1 @@
+foo.{bar: bar.baz[1],includeme: includeme}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452
new file mode 100644
index 00000000000..398c7f8b06e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452
@@ -0,0 +1 @@
+foo.{"bar.baz.two": bar.baz[1].two, includeme: includeme}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453
new file mode 100644
index 00000000000..a1764448785
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453
@@ -0,0 +1 @@
+foo.[includeme, bar.baz[*].common]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454
new file mode 100644
index 00000000000..da5225ddccb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454
@@ -0,0 +1 @@
+foo.[includeme, bar.baz[*].none]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455
new file mode 100644
index 00000000000..a8870b22bcc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455
@@ -0,0 +1 @@
+foo.[includeme, bar.baz[].common]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456
new file mode 100644
index 00000000000..420b1a57c45
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456
@@ -0,0 +1 @@
+reservations[*].instances[*].{id: id, name: name}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457
new file mode 100644
index 00000000000..0761ee16dc0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457
@@ -0,0 +1 @@
+reservations[].instances[].{id: id, name: name}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458
new file mode 100644
index 00000000000..aa1191a48cd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458
@@ -0,0 +1 @@
+reservations[].instances[].[id, name]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46
new file mode 100644
index 00000000000..9a24a464eed
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46
@@ -0,0 +1 @@
+foo[?key == `0`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460
new file mode 100644
index 00000000000..bea506ff235
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460
@@ -0,0 +1 @@
+foo[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461
new file mode 100644
index 00000000000..13f2c4a0b4f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461
@@ -0,0 +1 @@
+foo[].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462
new file mode 100644
index 00000000000..edf3d92775d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462
@@ -0,0 +1 @@
+foo[].bar[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463
new file mode 100644
index 00000000000..d965466e91c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463
@@ -0,0 +1 @@
+foo[].bar[].[baz, qux]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464
new file mode 100644
index 00000000000..f1822a1742b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464
@@ -0,0 +1 @@
+foo[].bar[].[baz]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465
new file mode 100644
index 00000000000..c6f77b80c33
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465
@@ -0,0 +1 @@
+foo[].bar[].[baz, qux][]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466
new file mode 100644
index 00000000000..db56262a4ea
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466
@@ -0,0 +1 @@
+foo.[baz[*].bar, qux[0]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467
new file mode 100644
index 00000000000..b901067d271
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467
@@ -0,0 +1 @@
+foo.[baz[*].[bar, boo], qux[0]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468
new file mode 100644
index 00000000000..738479fa69b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468
@@ -0,0 +1 @@
+foo.[baz[*].not_there || baz[*].bar, qux[0]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469
new file mode 100644
index 00000000000..6926996a7b6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469
@@ -0,0 +1 @@
+[[*],*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47
new file mode 100644
index 00000000000..6d33cc72c4e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47
@@ -0,0 +1 @@
+foo[?key == `1`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470
new file mode 100644
index 00000000000..736be0a31f2
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470
@@ -0,0 +1 @@
+[[*]]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471
new file mode 100644
index 00000000000..29e1fb20a55
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471
@@ -0,0 +1 @@
+outer.foo || outer.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472
new file mode 100644
index 00000000000..c0070ba783a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472
@@ -0,0 +1 @@
+outer.foo||outer.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473
new file mode 100644
index 00000000000..661b0bec5e3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473
@@ -0,0 +1 @@
+outer.bar || outer.baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474
new file mode 100644
index 00000000000..296d5aeee16
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474
@@ -0,0 +1 @@
+outer.bar||outer.baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475
new file mode 100644
index 00000000000..ca140f8aa33
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475
@@ -0,0 +1 @@
+outer.bad || outer.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476
new file mode 100644
index 00000000000..15d30924274
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476
@@ -0,0 +1 @@
+outer.bad||outer.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477
new file mode 100644
index 00000000000..56148d957b7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477
@@ -0,0 +1 @@
+outer.foo || outer.bad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478
new file mode 100644
index 00000000000..6d3cf6d9069
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478
@@ -0,0 +1 @@
+outer.foo||outer.bad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479
new file mode 100644
index 00000000000..100fa8339d5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479
@@ -0,0 +1 @@
+outer.bad || outer.alsobad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48
new file mode 100644
index 00000000000..de56fc042cb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48
@@ -0,0 +1 @@
+foo[?key == `[0]`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480
new file mode 100644
index 00000000000..64490352bf0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480
@@ -0,0 +1 @@
+outer.bad||outer.alsobad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481
new file mode 100644
index 00000000000..af901bde17e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481
@@ -0,0 +1 @@
+outer.empty_string || outer.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482
new file mode 100644
index 00000000000..36b63e462c4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482
@@ -0,0 +1 @@
+outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483
new file mode 100644
index 00000000000..aba584f99ed
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483
@@ -0,0 +1 @@
+foo.*.baz | [0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484
new file mode 100644
index 00000000000..4234ac01922
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484
@@ -0,0 +1 @@
+foo.*.baz | [1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485
new file mode 100644
index 00000000000..12330d9902c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485
@@ -0,0 +1 @@
+foo.*.baz | [2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486
new file mode 100644
index 00000000000..1b2d93e1952
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486
@@ -0,0 +1 @@
+foo.bar.* | [0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487
new file mode 100644
index 00000000000..c371fc6457a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487
@@ -0,0 +1 @@
+foo.*.notbaz | [*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488
new file mode 100644
index 00000000000..3c835642eb2
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488
@@ -0,0 +1 @@
+foo | bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489
new file mode 100644
index 00000000000..decaa0421d6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489
@@ -0,0 +1 @@
+foo | bar | baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49
new file mode 100644
index 00000000000..49d9c63a390
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49
@@ -0,0 +1 @@
+foo[?key == `{"bar": [0]}`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490
new file mode 100644
index 00000000000..b91068037b1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490
@@ -0,0 +1 @@
+foo|bar| baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491
new file mode 100644
index 00000000000..11df74d8b46
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491
@@ -0,0 +1 @@
+not_there | [0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492
new file mode 100644
index 00000000000..11df74d8b46
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492
@@ -0,0 +1 @@
+not_there | [0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493
new file mode 100644
index 00000000000..37da9fc0b71
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493
@@ -0,0 +1 @@
+[foo.bar, foo.other] | [0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494
new file mode 100644
index 00000000000..1f4fc943d70
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494
@@ -0,0 +1 @@
+{"a": foo.bar, "b": foo.other} | a
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495
new file mode 100644
index 00000000000..67c7ea9cfe4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495
@@ -0,0 +1 @@
+{"a": foo.bar, "b": foo.other} | b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496
new file mode 100644
index 00000000000..d87f9bba4cd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496
@@ -0,0 +1 @@
+{"a": foo.bar, "b": foo.other} | *.baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497
new file mode 100644
index 00000000000..ebf8e271140
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497
@@ -0,0 +1 @@
+foo.bam || foo.bar | baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498
new file mode 100644
index 00000000000..f32bc6db510
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498
@@ -0,0 +1 @@
+foo | not_there || bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499
new file mode 100644
index 00000000000..d04459d9090
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499
@@ -0,0 +1 @@
+foo[*].bar[*] | [0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5
new file mode 100644
index 00000000000..b537264a1d5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5
@@ -0,0 +1 @@
+foo.bar.bad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50
new file mode 100644
index 00000000000..c17c1df1706
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50
@@ -0,0 +1 @@
+foo[?key == `null`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500
new file mode 100644
index 00000000000..3eb869f435b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500
@@ -0,0 +1 @@
+bar[0:10]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501
new file mode 100644
index 00000000000..aa5d6be52c7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501
@@ -0,0 +1 @@
+foo[0:10:1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502
new file mode 100644
index 00000000000..1a4d1682da0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502
@@ -0,0 +1 @@
+foo[0:10]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503
new file mode 100644
index 00000000000..5925a578b52
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503
@@ -0,0 +1 @@
+foo[0:10:]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504
new file mode 100644
index 00000000000..081e93abd98
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504
@@ -0,0 +1 @@
+foo[0::1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505
new file mode 100644
index 00000000000..92270014959
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505
@@ -0,0 +1 @@
+foo[0::]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506
new file mode 100644
index 00000000000..fd2294d6646
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506
@@ -0,0 +1 @@
+foo[0:]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507
new file mode 100644
index 00000000000..c6b551d5eae
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507
@@ -0,0 +1 @@
+foo[:10:1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508
new file mode 100644
index 00000000000..503f58da6e3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508
@@ -0,0 +1 @@
+foo[::1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509
new file mode 100644
index 00000000000..f78bb770caa
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509
@@ -0,0 +1 @@
+foo[:10:]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51
new file mode 100644
index 00000000000..589a214f453
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51
@@ -0,0 +1 @@
+foo[?key == `[1]`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510
new file mode 100644
index 00000000000..eb9d2ba881e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510
@@ -0,0 +1 @@
+foo[::]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511
new file mode 100644
index 00000000000..1921a3d9865
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511
@@ -0,0 +1 @@
+foo[:]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512
new file mode 100644
index 00000000000..a87afcb1b32
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512
@@ -0,0 +1 @@
+foo[1:9]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513
new file mode 100644
index 00000000000..dbf51d8cde4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513
@@ -0,0 +1 @@
+foo[0:10:2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514
new file mode 100644
index 00000000000..f7288763a71
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514
@@ -0,0 +1 @@
+foo[5:]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515
new file mode 100644
index 00000000000..64395761df6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515
@@ -0,0 +1 @@
+foo[5::2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516
new file mode 100644
index 00000000000..706bb14dd7e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516
@@ -0,0 +1 @@
+foo[::2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517
new file mode 100644
index 00000000000..8fcfaee95c6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517
@@ -0,0 +1 @@
+foo[::-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518
new file mode 100644
index 00000000000..f6a00bf9bbc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518
@@ -0,0 +1 @@
+foo[1::2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519
new file mode 100644
index 00000000000..ea068ee06fb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519
@@ -0,0 +1 @@
+foo[10:0:-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52
new file mode 100644
index 00000000000..214917ac068
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52
@@ -0,0 +1 @@
+foo[?key == `{"a":2}`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520
new file mode 100644
index 00000000000..1fe14258edc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520
@@ -0,0 +1 @@
+foo[10:5:-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521
new file mode 100644
index 00000000000..4ba0e130228
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521
@@ -0,0 +1 @@
+foo[8:2:-2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522
new file mode 100644
index 00000000000..25db439ff7d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522
@@ -0,0 +1 @@
+foo[0:20]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523
new file mode 100644
index 00000000000..8a965920af5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523
@@ -0,0 +1 @@
+foo[10:-20:-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524
new file mode 100644
index 00000000000..b1e5ba3734f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524
@@ -0,0 +1 @@
+foo[10:-20]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525
new file mode 100644
index 00000000000..06253112e4e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525
@@ -0,0 +1 @@
+foo[-4:-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526
new file mode 100644
index 00000000000..1e14a6a4c5e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526
@@ -0,0 +1 @@
+foo[:-5:-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527
new file mode 100644
index 00000000000..aef5c2747d2
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527
@@ -0,0 +1 @@
+foo[:2].a
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528
new file mode 100644
index 00000000000..93c95fcf689
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528
@@ -0,0 +1 @@
+foo[:2].b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529
new file mode 100644
index 00000000000..7e0733e595e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529
@@ -0,0 +1 @@
+foo[:2].a.b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53
new file mode 100644
index 00000000000..4c002ed80d6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53
@@ -0,0 +1 @@
+foo[?`true` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530
new file mode 100644
index 00000000000..2438b25762d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530
@@ -0,0 +1 @@
+bar[::-1].a.b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531
new file mode 100644
index 00000000000..549994b6bc4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531
@@ -0,0 +1 @@
+bar[:2].a.b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532
new file mode 100644
index 00000000000..ab98292b452
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532
@@ -0,0 +1 @@
+baz[:2].a
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533
new file mode 100644
index 00000000000..65fca968764
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533
@@ -0,0 +1 @@
+[:]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534
new file mode 100644
index 00000000000..18c5daf7bea
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534
@@ -0,0 +1 @@
+[:2].a
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535
new file mode 100644
index 00000000000..1bb84f7d4bd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535
@@ -0,0 +1 @@
+[::-1].a
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536
new file mode 100644
index 00000000000..7a0416f0566
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536
@@ -0,0 +1 @@
+[:2].b
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537
new file mode 100644
index 00000000000..4d5f9756e55
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537
@@ -0,0 +1 @@
+foo.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539
new file mode 100644
index 00000000000..f59ec20aabf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539
@@ -0,0 +1 @@
+*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54
new file mode 100644
index 00000000000..23d27073e97
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54
@@ -0,0 +1 @@
+foo[?`false` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540
new file mode 100644
index 00000000000..dee5695746e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540
@@ -0,0 +1 @@
+*.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541
new file mode 100644
index 00000000000..1a16f7418d2
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541
@@ -0,0 +1 @@
+*.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542
new file mode 100644
index 00000000000..7e8066d39f5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542
@@ -0,0 +1 @@
+*[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543
new file mode 100644
index 00000000000..0637a088a01
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544
new file mode 100644
index 00000000000..6e7ea636eec
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544
@@ -0,0 +1 @@
+[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545
new file mode 100644
index 00000000000..5a5194647ad
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545
@@ -0,0 +1 @@
+[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546
new file mode 100644
index 00000000000..416127425c2
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546
@@ -0,0 +1 @@
+*.["0"]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547
new file mode 100644
index 00000000000..cd9fb6ba778
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547
@@ -0,0 +1 @@
+[*].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548
new file mode 100644
index 00000000000..9f3ada48077
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548
@@ -0,0 +1 @@
+[*][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549
new file mode 100644
index 00000000000..9b0b2f8189b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549
@@ -0,0 +1 @@
+foo[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55
new file mode 100644
index 00000000000..6d840ee568f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55
@@ -0,0 +1 @@
+foo[?`0` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550
new file mode 100644
index 00000000000..b23413b92af
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550
@@ -0,0 +1 @@
+foo.[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551
new file mode 100644
index 00000000000..08ab2e1c420
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551
@@ -0,0 +1 @@
+foo.[abc]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552
new file mode 100644
index 00000000000..78b05a5c64e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552
@@ -0,0 +1 @@
+foo.[abc, def]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553
new file mode 100644
index 00000000000..1e7b886e79e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553
@@ -0,0 +1 @@
+a.{foo: bar}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554
new file mode 100644
index 00000000000..91b4c9896e1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554
@@ -0,0 +1 @@
+a.{foo: bar, baz: bam}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555
new file mode 100644
index 00000000000..8301ef981ef
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555
@@ -0,0 +1 @@
+{"\\":{" ":*}}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556
new file mode 100644
index 00000000000..8f75cc91334
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556
@@ -0,0 +1 @@
+foo || bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557
new file mode 100644
index 00000000000..e5f122c5691
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557
@@ -0,0 +1 @@
+foo.[a || b]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558
new file mode 100644
index 00000000000..39d1914328b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558
@@ -0,0 +1 @@
+foo[?bar==`"baz"`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559
new file mode 100644
index 00000000000..d08bbe2501e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559
@@ -0,0 +1 @@
+foo[? bar == `"baz"` ]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56
new file mode 100644
index 00000000000..addaf204c5b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56
@@ -0,0 +1 @@
+foo[?`1` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560
new file mode 100644
index 00000000000..a77f355812c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560
@@ -0,0 +1 @@
+foo[?a.b.c==d.e.f]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561
new file mode 100644
index 00000000000..c9697aa4870
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561
@@ -0,0 +1 @@
+foo[?bar==`[0, 1, 2]`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562
new file mode 100644
index 00000000000..fd7064a0868
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562
@@ -0,0 +1 @@
+foo[?bar==`["a", "b", "c"]`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563
new file mode 100644
index 00000000000..61e5e1b8f71
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563
@@ -0,0 +1 @@
+foo[?bar==`["foo\`bar"]`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564
new file mode 100644
index 00000000000..bc9d8af1d92
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564
@@ -0,0 +1 @@
+[?"\\">`"foo"`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565
new file mode 100644
index 00000000000..2dd54dc3904
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565
@@ -0,0 +1 @@
+[?"\\" > `"foo"`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567
new file mode 100644
index 00000000000..7e9668e7834
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567
@@ -0,0 +1 @@
+"foo"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568
new file mode 100644
index 00000000000..d58ac16bf03
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568
@@ -0,0 +1 @@
+"\\"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569
new file mode 100644
index 00000000000..33ac9fba6ff
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569
@@ -0,0 +1 @@
+*||*|*|*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57
new file mode 100644
index 00000000000..acf2435c7cb
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57
@@ -0,0 +1 @@
+foo[?`[0]` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570
new file mode 100644
index 00000000000..99e19638ce4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570
@@ -0,0 +1 @@
+*[]||[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571
new file mode 100644
index 00000000000..be0845011c3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571
@@ -0,0 +1 @@
+[*.*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572
new file mode 100644
index 00000000000..a84b51e1cda
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572
@@ -0,0 +1 @@
+foo[]."✓"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573
new file mode 100644
index 00000000000..c2de55815f0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573
@@ -0,0 +1 @@
+"☯"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574
new file mode 100644
index 00000000000..dc2dda0bb68
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574
@@ -0,0 +1 @@
+"♪♫•*¨*•.¸¸❤¸¸.•*¨*•♫♪"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575
new file mode 100644
index 00000000000..a2d3d5f6ae0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575
@@ -0,0 +1 @@
+"☃"
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576
new file mode 100644
index 00000000000..0971c37eaf7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576
@@ -0,0 +1 @@
+foo.*.baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577
new file mode 100644
index 00000000000..0e39dfd695d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577
@@ -0,0 +1 @@
+foo.bar.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578
new file mode 100644
index 00000000000..89c1ce22dc7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578
@@ -0,0 +1 @@
+foo.*.notbaz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579
new file mode 100644
index 00000000000..5199b9f95d4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579
@@ -0,0 +1 @@
+foo.*.notbaz[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58
new file mode 100644
index 00000000000..99fe382c6c6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58
@@ -0,0 +1 @@
+foo[?`{"bar": [0]}` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580
new file mode 100644
index 00000000000..5bb6d4ae783
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580
@@ -0,0 +1 @@
+foo.*.notbaz[-1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581
new file mode 100644
index 00000000000..edac73189d7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581
@@ -0,0 +1 @@
+foo.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582
new file mode 100644
index 00000000000..458d0a6ddd0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582
@@ -0,0 +1 @@
+foo.*.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583
new file mode 100644
index 00000000000..f757fd53459
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583
@@ -0,0 +1 @@
+foo.*.*.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584
new file mode 100644
index 00000000000..670049d96f7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584
@@ -0,0 +1 @@
+foo.*.*.*.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585
new file mode 100644
index 00000000000..3c88caafe88
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585
@@ -0,0 +1 @@
+*.bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586
new file mode 100644
index 00000000000..f59ec20aabf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586
@@ -0,0 +1 @@
+*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587
new file mode 100644
index 00000000000..0852fcc7895
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587
@@ -0,0 +1 @@
+*.sub1
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588
new file mode 100644
index 00000000000..dee5695746e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588
@@ -0,0 +1 @@
+*.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589
new file mode 100644
index 00000000000..66781bba40a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589
@@ -0,0 +1 @@
+*.*.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59
new file mode 100644
index 00000000000..4aad20ae69e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59
@@ -0,0 +1 @@
+foo[?`null` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590
new file mode 100644
index 00000000000..0db15d97e44
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590
@@ -0,0 +1 @@
+*.sub1.foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591
new file mode 100644
index 00000000000..b24be9d7d1c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591
@@ -0,0 +1 @@
+foo[*].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592
new file mode 100644
index 00000000000..e6efe133fcd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592
@@ -0,0 +1 @@
+foo[*].notbar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593
new file mode 100644
index 00000000000..5a5194647ad
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593
@@ -0,0 +1 @@
+[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594
new file mode 100644
index 00000000000..cd9fb6ba778
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594
@@ -0,0 +1 @@
+[*].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595
new file mode 100644
index 00000000000..cbf1a5d596a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595
@@ -0,0 +1 @@
+[*].notbar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596
new file mode 100644
index 00000000000..8bd13b7eb49
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596
@@ -0,0 +1 @@
+foo.bar[*].baz
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597
new file mode 100644
index 00000000000..7239f3e887e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597
@@ -0,0 +1 @@
+foo.bar[*].baz[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598
new file mode 100644
index 00000000000..f5e431d9e3f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598
@@ -0,0 +1 @@
+foo.bar[*].baz[1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599
new file mode 100644
index 00000000000..d0c25953968
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599
@@ -0,0 +1 @@
+foo.bar[*].baz[2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6
new file mode 100644
index 00000000000..b9749b74897
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6
@@ -0,0 +1 @@
+foo.bad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60
new file mode 100644
index 00000000000..dac67509bb4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60
@@ -0,0 +1 @@
+foo[?`[1]` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600
new file mode 100644
index 00000000000..a6388271e41
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600
@@ -0,0 +1 @@
+foo.bar[*].baz[3]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601
new file mode 100644
index 00000000000..2a66ffe93b8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601
@@ -0,0 +1 @@
+foo.bar[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602
new file mode 100644
index 00000000000..b6b3695438a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602
@@ -0,0 +1 @@
+foo.bar[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603
new file mode 100644
index 00000000000..7e57f9e74ce
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603
@@ -0,0 +1 @@
+foo.bar[0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604
new file mode 100644
index 00000000000..c5f8bef0bee
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604
@@ -0,0 +1 @@
+foo.bar[0][0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605
new file mode 100644
index 00000000000..3decf08030f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605
@@ -0,0 +1 @@
+foo.bar[0][0][0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606
new file mode 100644
index 00000000000..655e2959bea
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606
@@ -0,0 +1 @@
+foo[0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607
new file mode 100644
index 00000000000..2aa159718c8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607
@@ -0,0 +1 @@
+foo[*].bar[*].kind
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608
new file mode 100644
index 00000000000..556b380bab1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608
@@ -0,0 +1 @@
+foo[*].bar[0].kind
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609
new file mode 100644
index 00000000000..0de3229b83e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609
@@ -0,0 +1 @@
+foo[*].bar.kind
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61
new file mode 100644
index 00000000000..130ed3b379e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61
@@ -0,0 +1 @@
+foo[?`{"a":2}` == key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610
new file mode 100644
index 00000000000..3b511f13351
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610
@@ -0,0 +1 @@
+foo[*].bar[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611
new file mode 100644
index 00000000000..c8dfa16e6bc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611
@@ -0,0 +1 @@
+foo[*].bar[1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612
new file mode 100644
index 00000000000..69f04ee23ff
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612
@@ -0,0 +1 @@
+foo[*].bar[2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613
new file mode 100644
index 00000000000..3b511f13351
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613
@@ -0,0 +1 @@
+foo[*].bar[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614
new file mode 100644
index 00000000000..03e0c0cb93b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614
@@ -0,0 +1 @@
+foo[*][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615
new file mode 100644
index 00000000000..ac1c8966821
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615
@@ -0,0 +1 @@
+foo[*][1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616
new file mode 100644
index 00000000000..03e0c0cb93b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616
@@ -0,0 +1 @@
+foo[*][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617
new file mode 100644
index 00000000000..ac1c8966821
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617
@@ -0,0 +1 @@
+foo[*][1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618
new file mode 100644
index 00000000000..6494cf1c6a0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618
@@ -0,0 +1 @@
+foo[*][0][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619
new file mode 100644
index 00000000000..1406be5721f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619
@@ -0,0 +1 @@
+foo[*][1][0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62
new file mode 100644
index 00000000000..3d15fcc1697
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62
@@ -0,0 +1 @@
+foo[?key != `true`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620
new file mode 100644
index 00000000000..72b5aa281a9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620
@@ -0,0 +1 @@
+foo[*][0][1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621
new file mode 100644
index 00000000000..02a26491ae4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621
@@ -0,0 +1 @@
+foo[*][1][1]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622
new file mode 100644
index 00000000000..cb08037e209
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622
@@ -0,0 +1 @@
+foo[*][2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623
new file mode 100644
index 00000000000..91d695995a4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623
@@ -0,0 +1 @@
+foo[*][2][2]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624
new file mode 100644
index 00000000000..f40f261ad17
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624
@@ -0,0 +1 @@
+bar[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625
new file mode 100644
index 00000000000..03904b1dece
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625
@@ -0,0 +1 @@
+bar[*].baz[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626
new file mode 100644
index 00000000000..fd7c21c340c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626
@@ -0,0 +1 @@
+string[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627
new file mode 100644
index 00000000000..d7ca4719a99
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627
@@ -0,0 +1 @@
+hash[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628
new file mode 100644
index 00000000000..b3ddffe3cfe
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628
@@ -0,0 +1 @@
+number[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629
new file mode 100644
index 00000000000..c03cd39ebf5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629
@@ -0,0 +1 @@
+nullvalue[*]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63
new file mode 100644
index 00000000000..08731af6908
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63
@@ -0,0 +1 @@
+foo[?key != `false`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630
new file mode 100644
index 00000000000..b3c40cd533f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630
@@ -0,0 +1 @@
+string[*].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631
new file mode 100644
index 00000000000..c5930d543f3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631
@@ -0,0 +1 @@
+hash[*].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632
new file mode 100644
index 00000000000..cc0b1a4896a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632
@@ -0,0 +1 @@
+number[*].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633
new file mode 100644
index 00000000000..d677b965852
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633
@@ -0,0 +1 @@
+nullvalue[*].foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634
new file mode 100644
index 00000000000..c1166640155
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634
@@ -0,0 +1 @@
+nullvalue[*].foo[*].bar
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635
new file mode 100644
index 00000000000..e3399771088
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635
@@ -0,0 +1 @@
+string.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636
new file mode 100644
index 00000000000..76f53453a8a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636
@@ -0,0 +1 @@
+hash.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637
new file mode 100644
index 00000000000..dd485072f26
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637
@@ -0,0 +1 @@
+number.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638
new file mode 100644
index 00000000000..16000c003cd
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638
@@ -0,0 +1 @@
+array.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639
new file mode 100644
index 00000000000..1d0d03ed3b5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639
@@ -0,0 +1 @@
+nullvalue.*
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64
new file mode 100644
index 00000000000..b67aebe98ad
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64
@@ -0,0 +1 @@
+foo[?key != `0`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640
new file mode 100644
index 00000000000..7e8066d39f5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640
@@ -0,0 +1 @@
+*[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641
new file mode 100644
index 00000000000..41ebe5ba9d7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641
@@ -0,0 +1 @@
+`foo`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642
new file mode 100644
index 00000000000..fe0397993c5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642
@@ -0,0 +1 @@
+`foo\"quote`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643
new file mode 100644
index 00000000000..1a27fd80c3c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643
@@ -0,0 +1 @@
+`✓`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644
new file mode 100644
index 00000000000..559a13456be
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644
@@ -0,0 +1 @@
+`foo\"bar`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645
new file mode 100644
index 00000000000..e31621b438e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645
@@ -0,0 +1 @@
+`1\``
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646
new file mode 100644
index 00000000000..6bf7a10362a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646
@@ -0,0 +1 @@
+`\\`.{a:`b`}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647
new file mode 100644
index 00000000000..41ebe5ba9d7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647
@@ -0,0 +1 @@
+`foo`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648
new file mode 100644
index 00000000000..28b9bcbbb52
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648
@@ -0,0 +1 @@
+` foo`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649
new file mode 100644
index 00000000000..41ebe5ba9d7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649
@@ -0,0 +1 @@
+`foo`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65
new file mode 100644
index 00000000000..d3ac793bb6b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65
@@ -0,0 +1 @@
+foo[?key != `1`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650
new file mode 100644
index 00000000000..fe0397993c5
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650
@@ -0,0 +1 @@
+`foo\"quote`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651
new file mode 100644
index 00000000000..1a27fd80c3c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651
@@ -0,0 +1 @@
+`✓`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652
new file mode 100644
index 00000000000..559a13456be
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652
@@ -0,0 +1 @@
+`foo\"bar`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653
new file mode 100644
index 00000000000..e31621b438e
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653
@@ -0,0 +1 @@
+`1\``
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654
new file mode 100644
index 00000000000..6bf7a10362a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654
@@ -0,0 +1 @@
+`\\`.{a:`b`}
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655
new file mode 100644
index 00000000000..41ebe5ba9d7
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655
@@ -0,0 +1 @@
+`foo`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656
new file mode 100644
index 00000000000..28b9bcbbb52
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656
@@ -0,0 +1 @@
+` foo`
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66
new file mode 100644
index 00000000000..065295bc17a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66
@@ -0,0 +1 @@
+foo[?key != `null`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67
new file mode 100644
index 00000000000..43d164927d4
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67
@@ -0,0 +1 @@
+foo[?key != `[1]`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68
new file mode 100644
index 00000000000..6b884fa866f
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68
@@ -0,0 +1 @@
+foo[?key != `{"a":2}`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69
new file mode 100644
index 00000000000..d85c779d0a3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69
@@ -0,0 +1 @@
+foo[?`true` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7
new file mode 100644
index 00000000000..44d6628cdc6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7
@@ -0,0 +1 @@
+bad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70
new file mode 100644
index 00000000000..3e6dcf3045a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70
@@ -0,0 +1 @@
+foo[?`false` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71
new file mode 100644
index 00000000000..bdb820b30b3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71
@@ -0,0 +1 @@
+foo[?`0` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72
new file mode 100644
index 00000000000..3f3048a004c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72
@@ -0,0 +1 @@
+foo[?`1` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73
new file mode 100644
index 00000000000..dacc2572451
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73
@@ -0,0 +1 @@
+foo[?`null` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74
new file mode 100644
index 00000000000..32ebae8800b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74
@@ -0,0 +1 @@
+foo[?`[1]` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75
new file mode 100644
index 00000000000..dcd023e0fbc
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75
@@ -0,0 +1 @@
+foo[?`{"a":2}` != key]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76
new file mode 100644
index 00000000000..e08cc13cbe3
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76
@@ -0,0 +1 @@
+reservations[].instances[?bar==`1`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77
new file mode 100644
index 00000000000..1ec43f45fce
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77
@@ -0,0 +1 @@
+reservations[*].instances[?bar==`1`]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78
new file mode 100644
index 00000000000..30387116349
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78
@@ -0,0 +1 @@
+reservations[].instances[?bar==`1`][]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79
new file mode 100644
index 00000000000..e3875746b35
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79
@@ -0,0 +1 @@
+foo[?bar==`1`].bar[0]
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8
new file mode 100644
index 00000000000..da7bc1ccfd0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8
@@ -0,0 +1 @@
+bad.morebad.morebad
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80
new file mode 100644
index 00000000000..5c3d683565d
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80
@@ -0,0 +1 @@
+foo[?a==`1`].b.c
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81
new file mode 100644
index 00000000000..6232808f0ae
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81
@@ -0,0 +1 @@
+abs(foo)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82
new file mode 100644
index 00000000000..6232808f0ae
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82
@@ -0,0 +1 @@
+abs(foo)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83
new file mode 100644
index 00000000000..29497f4ff54
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83
@@ -0,0 +1 @@
+abs(array[1])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84
new file mode 100644
index 00000000000..29497f4ff54
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84
@@ -0,0 +1 @@
+abs(array[1])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85
new file mode 100644
index 00000000000..346696563f8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85
@@ -0,0 +1 @@
+abs(`-24`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86
new file mode 100644
index 00000000000..346696563f8
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86
@@ -0,0 +1 @@
+abs(`-24`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87
new file mode 100644
index 00000000000..c6268f8473b
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87
@@ -0,0 +1 @@
+avg(numbers)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88
new file mode 100644
index 00000000000..7ce703695ee
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88
@@ -0,0 +1 @@
+ceil(`1.2`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89
new file mode 100644
index 00000000000..0561bc26d9a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89
@@ -0,0 +1 @@
+ceil(decimals[0])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9
new file mode 100644
index 00000000000..19102815663
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90
new file mode 100644
index 00000000000..c78c1fc3002
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90
@@ -0,0 +1 @@
+ceil(decimals[1])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91
new file mode 100644
index 00000000000..ebcb4bbdbb9
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91
@@ -0,0 +1 @@
+ceil(decimals[2])
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92
new file mode 100644
index 00000000000..6edbf1afe4a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92
@@ -0,0 +1 @@
+contains('abc', 'a')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93
new file mode 100644
index 00000000000..d2b2f070dab
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93
@@ -0,0 +1 @@
+contains('abc', 'd')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94
new file mode 100644
index 00000000000..3535da2eca6
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94
@@ -0,0 +1 @@
+contains(strings, 'a')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95
new file mode 100644
index 00000000000..ba839fe60d1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95
@@ -0,0 +1 @@
+contains(decimals, `1.2`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96
new file mode 100644
index 00000000000..f4358186979
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96
@@ -0,0 +1 @@
+contains(decimals, `false`)
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97
new file mode 100644
index 00000000000..adb65fc01f0
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97
@@ -0,0 +1 @@
+ends_with(str, 'r')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98
new file mode 100644
index 00000000000..93d6901bead
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98
@@ -0,0 +1 @@
+ends_with(str, 'tr')
\ No newline at end of file
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/jmespath.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/jmespath.go
new file mode 100644
index 00000000000..c7df08782a1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/jmespath.go
@@ -0,0 +1,13 @@
+package jmespath
+
+import "github.com/jmespath/go-jmespath"
+
+// Fuzz will fuzz test the JMESPath parser.
+func Fuzz(data []byte) int {
+ p := jmespath.NewParser()
+ _, err := p.Parse(string(data))
+ if err != nil {
+ return 1
+ }
+ return 0
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter.go
new file mode 100644
index 00000000000..13c74604c2c
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter.go
@@ -0,0 +1,418 @@
+package jmespath
+
+import (
+ "errors"
+ "reflect"
+ "unicode"
+ "unicode/utf8"
+)
+
+/* This is a tree based interpreter. It walks the AST and directly
+ interprets the AST to search through a JSON document.
+*/
+
+type treeInterpreter struct {
+ fCall *functionCaller
+}
+
+func newInterpreter() *treeInterpreter {
+ interpreter := treeInterpreter{}
+ interpreter.fCall = newFunctionCaller()
+ return &interpreter
+}
+
+type expRef struct {
+ ref ASTNode
+}
+
+// Execute takes an ASTNode and input data and interprets the AST directly.
+// It will produce the result of applying the JMESPath expression associated
+// with the ASTNode to the input data "value".
+func (intr *treeInterpreter) Execute(node ASTNode, value interface{}) (interface{}, error) {
+ switch node.nodeType {
+ case ASTComparator:
+ left, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, err
+ }
+ right, err := intr.Execute(node.children[1], value)
+ if err != nil {
+ return nil, err
+ }
+ switch node.value {
+ case tEQ:
+ return objsEqual(left, right), nil
+ case tNE:
+ return !objsEqual(left, right), nil
+ }
+ leftNum, ok := left.(float64)
+ if !ok {
+ return nil, nil
+ }
+ rightNum, ok := right.(float64)
+ if !ok {
+ return nil, nil
+ }
+ switch node.value {
+ case tGT:
+ return leftNum > rightNum, nil
+ case tGTE:
+ return leftNum >= rightNum, nil
+ case tLT:
+ return leftNum < rightNum, nil
+ case tLTE:
+ return leftNum <= rightNum, nil
+ }
+ case ASTExpRef:
+ return expRef{ref: node.children[0]}, nil
+ case ASTFunctionExpression:
+ resolvedArgs := []interface{}{}
+ for _, arg := range node.children {
+ current, err := intr.Execute(arg, value)
+ if err != nil {
+ return nil, err
+ }
+ resolvedArgs = append(resolvedArgs, current)
+ }
+ return intr.fCall.CallFunction(node.value.(string), resolvedArgs, intr)
+ case ASTField:
+ if m, ok := value.(map[string]interface{}); ok {
+ key := node.value.(string)
+ return m[key], nil
+ }
+ return intr.fieldFromStruct(node.value.(string), value)
+ case ASTFilterProjection:
+ left, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, nil
+ }
+ sliceType, ok := left.([]interface{})
+ if !ok {
+ if isSliceType(left) {
+ return intr.filterProjectionWithReflection(node, left)
+ }
+ return nil, nil
+ }
+ compareNode := node.children[2]
+ collected := []interface{}{}
+ for _, element := range sliceType {
+ result, err := intr.Execute(compareNode, element)
+ if err != nil {
+ return nil, err
+ }
+ if !isFalse(result) {
+ current, err := intr.Execute(node.children[1], element)
+ if err != nil {
+ return nil, err
+ }
+ if current != nil {
+ collected = append(collected, current)
+ }
+ }
+ }
+ return collected, nil
+ case ASTFlatten:
+ left, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, nil
+ }
+ sliceType, ok := left.([]interface{})
+ if !ok {
+ // If we can't type convert to []interface{}, there's
+ // a chance this could still work via reflection if we're
+ // dealing with user provided types.
+ if isSliceType(left) {
+ return intr.flattenWithReflection(left)
+ }
+ return nil, nil
+ }
+ flattened := []interface{}{}
+ for _, element := range sliceType {
+ if elementSlice, ok := element.([]interface{}); ok {
+ flattened = append(flattened, elementSlice...)
+ } else if isSliceType(element) {
+ reflectFlat := []interface{}{}
+ v := reflect.ValueOf(element)
+ for i := 0; i < v.Len(); i++ {
+ reflectFlat = append(reflectFlat, v.Index(i).Interface())
+ }
+ flattened = append(flattened, reflectFlat...)
+ } else {
+ flattened = append(flattened, element)
+ }
+ }
+ return flattened, nil
+ case ASTIdentity, ASTCurrentNode:
+ return value, nil
+ case ASTIndex:
+ if sliceType, ok := value.([]interface{}); ok {
+ index := node.value.(int)
+ if index < 0 {
+ index += len(sliceType)
+ }
+ if index < len(sliceType) && index >= 0 {
+ return sliceType[index], nil
+ }
+ return nil, nil
+ }
+ // Otherwise try via reflection.
+ rv := reflect.ValueOf(value)
+ if rv.Kind() == reflect.Slice {
+ index := node.value.(int)
+ if index < 0 {
+ index += rv.Len()
+ }
+ if index < rv.Len() && index >= 0 {
+ v := rv.Index(index)
+ return v.Interface(), nil
+ }
+ }
+ return nil, nil
+ case ASTKeyValPair:
+ return intr.Execute(node.children[0], value)
+ case ASTLiteral:
+ return node.value, nil
+ case ASTMultiSelectHash:
+ if value == nil {
+ return nil, nil
+ }
+ collected := make(map[string]interface{})
+ for _, child := range node.children {
+ current, err := intr.Execute(child, value)
+ if err != nil {
+ return nil, err
+ }
+ key := child.value.(string)
+ collected[key] = current
+ }
+ return collected, nil
+ case ASTMultiSelectList:
+ if value == nil {
+ return nil, nil
+ }
+ collected := []interface{}{}
+ for _, child := range node.children {
+ current, err := intr.Execute(child, value)
+ if err != nil {
+ return nil, err
+ }
+ collected = append(collected, current)
+ }
+ return collected, nil
+ case ASTOrExpression:
+ matched, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, err
+ }
+ if isFalse(matched) {
+ matched, err = intr.Execute(node.children[1], value)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return matched, nil
+ case ASTAndExpression:
+ matched, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, err
+ }
+ if isFalse(matched) {
+ return matched, nil
+ }
+ return intr.Execute(node.children[1], value)
+ case ASTNotExpression:
+ matched, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, err
+ }
+ if isFalse(matched) {
+ return true, nil
+ }
+ return false, nil
+ case ASTPipe:
+ result := value
+ var err error
+ for _, child := range node.children {
+ result, err = intr.Execute(child, result)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return result, nil
+ case ASTProjection:
+ left, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, err
+ }
+ sliceType, ok := left.([]interface{})
+ if !ok {
+ if isSliceType(left) {
+ return intr.projectWithReflection(node, left)
+ }
+ return nil, nil
+ }
+ collected := []interface{}{}
+ var current interface{}
+ for _, element := range sliceType {
+ current, err = intr.Execute(node.children[1], element)
+ if err != nil {
+ return nil, err
+ }
+ if current != nil {
+ collected = append(collected, current)
+ }
+ }
+ return collected, nil
+ case ASTSubexpression, ASTIndexExpression:
+ left, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, err
+ }
+ return intr.Execute(node.children[1], left)
+ case ASTSlice:
+ sliceType, ok := value.([]interface{})
+ if !ok {
+ if isSliceType(value) {
+ return intr.sliceWithReflection(node, value)
+ }
+ return nil, nil
+ }
+ parts := node.value.([]*int)
+ sliceParams := make([]sliceParam, 3)
+ for i, part := range parts {
+ if part != nil {
+ sliceParams[i].Specified = true
+ sliceParams[i].N = *part
+ }
+ }
+ return slice(sliceType, sliceParams)
+ case ASTValueProjection:
+ left, err := intr.Execute(node.children[0], value)
+ if err != nil {
+ return nil, nil
+ }
+ mapType, ok := left.(map[string]interface{})
+ if !ok {
+ return nil, nil
+ }
+ values := make([]interface{}, len(mapType))
+ for _, value := range mapType {
+ values = append(values, value)
+ }
+ collected := []interface{}{}
+ for _, element := range values {
+ current, err := intr.Execute(node.children[1], element)
+ if err != nil {
+ return nil, err
+ }
+ if current != nil {
+ collected = append(collected, current)
+ }
+ }
+ return collected, nil
+ }
+ return nil, errors.New("Unknown AST node: " + node.nodeType.String())
+}
+
+func (intr *treeInterpreter) fieldFromStruct(key string, value interface{}) (interface{}, error) {
+ rv := reflect.ValueOf(value)
+ first, n := utf8.DecodeRuneInString(key)
+ fieldName := string(unicode.ToUpper(first)) + key[n:]
+ if rv.Kind() == reflect.Struct {
+ v := rv.FieldByName(fieldName)
+ if !v.IsValid() {
+ return nil, nil
+ }
+ return v.Interface(), nil
+ } else if rv.Kind() == reflect.Ptr {
+ // Handle multiple levels of indirection?
+ if rv.IsNil() {
+ return nil, nil
+ }
+ rv = rv.Elem()
+ v := rv.FieldByName(fieldName)
+ if !v.IsValid() {
+ return nil, nil
+ }
+ return v.Interface(), nil
+ }
+ return nil, nil
+}
+
+func (intr *treeInterpreter) flattenWithReflection(value interface{}) (interface{}, error) {
+ v := reflect.ValueOf(value)
+ flattened := []interface{}{}
+ for i := 0; i < v.Len(); i++ {
+ element := v.Index(i).Interface()
+ if reflect.TypeOf(element).Kind() == reflect.Slice {
+ // Then insert the contents of the element
+ // slice into the flattened slice,
+ // i.e flattened = append(flattened, mySlice...)
+ elementV := reflect.ValueOf(element)
+ for j := 0; j < elementV.Len(); j++ {
+ flattened = append(
+ flattened, elementV.Index(j).Interface())
+ }
+ } else {
+ flattened = append(flattened, element)
+ }
+ }
+ return flattened, nil
+}
+
+func (intr *treeInterpreter) sliceWithReflection(node ASTNode, value interface{}) (interface{}, error) {
+ v := reflect.ValueOf(value)
+ parts := node.value.([]*int)
+ sliceParams := make([]sliceParam, 3)
+ for i, part := range parts {
+ if part != nil {
+ sliceParams[i].Specified = true
+ sliceParams[i].N = *part
+ }
+ }
+ final := []interface{}{}
+ for i := 0; i < v.Len(); i++ {
+ element := v.Index(i).Interface()
+ final = append(final, element)
+ }
+ return slice(final, sliceParams)
+}
+
+func (intr *treeInterpreter) filterProjectionWithReflection(node ASTNode, value interface{}) (interface{}, error) {
+ compareNode := node.children[2]
+ collected := []interface{}{}
+ v := reflect.ValueOf(value)
+ for i := 0; i < v.Len(); i++ {
+ element := v.Index(i).Interface()
+ result, err := intr.Execute(compareNode, element)
+ if err != nil {
+ return nil, err
+ }
+ if !isFalse(result) {
+ current, err := intr.Execute(node.children[1], element)
+ if err != nil {
+ return nil, err
+ }
+ if current != nil {
+ collected = append(collected, current)
+ }
+ }
+ }
+ return collected, nil
+}
+
+func (intr *treeInterpreter) projectWithReflection(node ASTNode, value interface{}) (interface{}, error) {
+ collected := []interface{}{}
+ v := reflect.ValueOf(value)
+ for i := 0; i < v.Len(); i++ {
+ element := v.Index(i).Interface()
+ result, err := intr.Execute(node.children[1], element)
+ if err != nil {
+ return nil, err
+ }
+ if result != nil {
+ collected = append(collected, result)
+ }
+ }
+ return collected, nil
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter_test.go
new file mode 100644
index 00000000000..5b529c4f313
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter_test.go
@@ -0,0 +1,213 @@
+package jmespath
+
+import (
+ "encoding/json"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+type scalars struct {
+ Foo string
+ Bar string
+}
+
+type sliceType struct {
+ A string
+ B []scalars
+ C []*scalars
+}
+
+type benchmarkStruct struct {
+ Fooasdfasdfasdfasdf string
+}
+
+type benchmarkNested struct {
+ Fooasdfasdfasdfasdf nestedA
+}
+
+type nestedA struct {
+ Fooasdfasdfasdfasdf nestedB
+}
+
+type nestedB struct {
+ Fooasdfasdfasdfasdf nestedC
+}
+
+type nestedC struct {
+ Fooasdfasdfasdfasdf string
+}
+
+type nestedSlice struct {
+ A []sliceType
+}
+
+func TestCanSupportEmptyInterface(t *testing.T) {
+ assert := assert.New(t)
+ data := make(map[string]interface{})
+ data["foo"] = "bar"
+ result, err := Search("foo", data)
+ assert.Nil(err)
+ assert.Equal("bar", result)
+}
+
+func TestCanSupportUserDefinedStructsValue(t *testing.T) {
+ assert := assert.New(t)
+ s := scalars{Foo: "one", Bar: "bar"}
+ result, err := Search("Foo", s)
+ assert.Nil(err)
+ assert.Equal("one", result)
+}
+
+func TestCanSupportUserDefinedStructsRef(t *testing.T) {
+ assert := assert.New(t)
+ s := scalars{Foo: "one", Bar: "bar"}
+ result, err := Search("Foo", &s)
+ assert.Nil(err)
+ assert.Equal("one", result)
+}
+
+func TestCanSupportStructWithSliceAll(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+ result, err := Search("B[].Foo", data)
+ assert.Nil(err)
+ assert.Equal([]interface{}{"f1", "correct"}, result)
+}
+
+func TestCanSupportStructWithSlicingExpression(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+ result, err := Search("B[:].Foo", data)
+ assert.Nil(err)
+ assert.Equal([]interface{}{"f1", "correct"}, result)
+}
+
+func TestCanSupportStructWithFilterProjection(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+ result, err := Search("B[? `true` ].Foo", data)
+ assert.Nil(err)
+ assert.Equal([]interface{}{"f1", "correct"}, result)
+}
+
+func TestCanSupportStructWithSlice(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+ result, err := Search("B[-1].Foo", data)
+ assert.Nil(err)
+ assert.Equal("correct", result)
+}
+
+func TestCanSupportStructWithOrExpressions(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", C: nil}
+ result, err := Search("C || A", data)
+ assert.Nil(err)
+ assert.Equal("foo", result)
+}
+
+func TestCanSupportStructWithSlicePointer(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", C: []*scalars{&scalars{"f1", "b1"}, &scalars{"correct", "b2"}}}
+ result, err := Search("C[-1].Foo", data)
+ assert.Nil(err)
+ assert.Equal("correct", result)
+}
+
+func TestWillAutomaticallyCapitalizeFieldNames(t *testing.T) {
+ assert := assert.New(t)
+ s := scalars{Foo: "one", Bar: "bar"}
+ // Note that there's a lower cased "foo" instead of "Foo",
+ // but it should still correspond to the Foo field in the
+ // scalars struct
+ result, err := Search("foo", &s)
+ assert.Nil(err)
+ assert.Equal("one", result)
+}
+
+func TestCanSupportStructWithSliceLowerCased(t *testing.T) {
+ assert := assert.New(t)
+ data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+ result, err := Search("b[-1].foo", data)
+ assert.Nil(err)
+ assert.Equal("correct", result)
+}
+
+func TestCanSupportStructWithNestedPointers(t *testing.T) {
+ assert := assert.New(t)
+ data := struct{ A *struct{ B int } }{}
+ result, err := Search("A.B", data)
+ assert.Nil(err)
+ assert.Nil(result)
+}
+
+func TestCanSupportFlattenNestedSlice(t *testing.T) {
+ assert := assert.New(t)
+ data := nestedSlice{A: []sliceType{
+ {B: []scalars{{Foo: "f1a"}, {Foo: "f1b"}}},
+ {B: []scalars{{Foo: "f2a"}, {Foo: "f2b"}}},
+ }}
+ result, err := Search("A[].B[].Foo", data)
+ assert.Nil(err)
+ assert.Equal([]interface{}{"f1a", "f1b", "f2a", "f2b"}, result)
+}
+
+func TestCanSupportFlattenNestedEmptySlice(t *testing.T) {
+ assert := assert.New(t)
+ data := nestedSlice{A: []sliceType{
+ {}, {B: []scalars{{Foo: "a"}}},
+ }}
+ result, err := Search("A[].B[].Foo", data)
+ assert.Nil(err)
+ assert.Equal([]interface{}{"a"}, result)
+}
+
+func TestCanSupportProjectionsWithStructs(t *testing.T) {
+ assert := assert.New(t)
+ data := nestedSlice{A: []sliceType{
+ {A: "first"}, {A: "second"}, {A: "third"},
+ }}
+ result, err := Search("A[*].A", data)
+ assert.Nil(err)
+ assert.Equal([]interface{}{"first", "second", "third"}, result)
+}
+
+func BenchmarkInterpretSingleFieldStruct(b *testing.B) {
+ intr := newInterpreter()
+ parser := NewParser()
+ ast, _ := parser.Parse("fooasdfasdfasdfasdf")
+ data := benchmarkStruct{"foobarbazqux"}
+ for i := 0; i < b.N; i++ {
+ intr.Execute(ast, &data)
+ }
+}
+
+func BenchmarkInterpretNestedStruct(b *testing.B) {
+ intr := newInterpreter()
+ parser := NewParser()
+ ast, _ := parser.Parse("fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf")
+ data := benchmarkNested{
+ nestedA{
+ nestedB{
+ nestedC{"foobarbazqux"},
+ },
+ },
+ }
+ for i := 0; i < b.N; i++ {
+ intr.Execute(ast, &data)
+ }
+}
+
+func BenchmarkInterpretNestedMaps(b *testing.B) {
+ jsonData := []byte(`{"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": "foobarbazqux"}}}}`)
+ var data interface{}
+ json.Unmarshal(jsonData, &data)
+
+ intr := newInterpreter()
+ parser := NewParser()
+ ast, _ := parser.Parse("fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf")
+ for i := 0; i < b.N; i++ {
+ intr.Execute(ast, data)
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer.go
new file mode 100644
index 00000000000..817900c8f52
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer.go
@@ -0,0 +1,420 @@
+package jmespath
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "strconv"
+ "strings"
+ "unicode/utf8"
+)
+
+type token struct {
+ tokenType tokType
+ value string
+ position int
+ length int
+}
+
+type tokType int
+
+const eof = -1
+
+// Lexer contains information about the expression being tokenized.
+type Lexer struct {
+ expression string // The expression provided by the user.
+ currentPos int // The current position in the string.
+ lastWidth int // The width of the current rune. This
+ buf bytes.Buffer // Internal buffer used for building up values.
+}
+
+// SyntaxError is the main error used whenever a lexing or parsing error occurs.
+type SyntaxError struct {
+ msg string // Error message displayed to user
+ Expression string // Expression that generated a SyntaxError
+ Offset int // The location in the string where the error occurred
+}
+
+func (e SyntaxError) Error() string {
+ // In the future, it would be good to underline the specific
+ // location where the error occurred.
+ return "SyntaxError: " + e.msg
+}
+
+// HighlightLocation will show where the syntax error occurred.
+// It will place a "^" character on a line below the expression
+// at the point where the syntax error occurred.
+func (e SyntaxError) HighlightLocation() string {
+ return e.Expression + "\n" + strings.Repeat(" ", e.Offset) + "^"
+}
+
+//go:generate stringer -type=tokType
+const (
+ tUnknown tokType = iota
+ tStar
+ tDot
+ tFilter
+ tFlatten
+ tLparen
+ tRparen
+ tLbracket
+ tRbracket
+ tLbrace
+ tRbrace
+ tOr
+ tPipe
+ tNumber
+ tUnquotedIdentifier
+ tQuotedIdentifier
+ tComma
+ tColon
+ tLT
+ tLTE
+ tGT
+ tGTE
+ tEQ
+ tNE
+ tJSONLiteral
+ tStringLiteral
+ tCurrent
+ tExpref
+ tAnd
+ tNot
+ tEOF
+)
+
+var basicTokens = map[rune]tokType{
+ '.': tDot,
+ '*': tStar,
+ ',': tComma,
+ ':': tColon,
+ '{': tLbrace,
+ '}': tRbrace,
+ ']': tRbracket, // tLbracket not included because it could be "[]"
+ '(': tLparen,
+ ')': tRparen,
+ '@': tCurrent,
+}
+
+// Bit mask for [a-zA-Z_] shifted down 64 bits to fit in a single uint64.
+// When using this bitmask just be sure to shift the rune down 64 bits
+// before checking against identifierStartBits.
+const identifierStartBits uint64 = 576460745995190270
+
+// Bit mask for [a-zA-Z0-9], 128 bits -> 2 uint64s.
+var identifierTrailingBits = [2]uint64{287948901175001088, 576460745995190270}
+
+var whiteSpace = map[rune]bool{
+ ' ': true, '\t': true, '\n': true, '\r': true,
+}
+
+func (t token) String() string {
+ return fmt.Sprintf("Token{%+v, %s, %d, %d}",
+ t.tokenType, t.value, t.position, t.length)
+}
+
+// NewLexer creates a new JMESPath lexer.
+func NewLexer() *Lexer {
+ lexer := Lexer{}
+ return &lexer
+}
+
+func (lexer *Lexer) next() rune {
+ if lexer.currentPos >= len(lexer.expression) {
+ lexer.lastWidth = 0
+ return eof
+ }
+ r, w := utf8.DecodeRuneInString(lexer.expression[lexer.currentPos:])
+ lexer.lastWidth = w
+ lexer.currentPos += w
+ return r
+}
+
+func (lexer *Lexer) back() {
+ lexer.currentPos -= lexer.lastWidth
+}
+
+func (lexer *Lexer) peek() rune {
+ t := lexer.next()
+ lexer.back()
+ return t
+}
+
+// tokenize takes an expression and returns corresponding tokens.
+func (lexer *Lexer) tokenize(expression string) ([]token, error) {
+ var tokens []token
+ lexer.expression = expression
+ lexer.currentPos = 0
+ lexer.lastWidth = 0
+loop:
+ for {
+ r := lexer.next()
+ if identifierStartBits&(1<<(uint64(r)-64)) > 0 {
+ t := lexer.consumeUnquotedIdentifier()
+ tokens = append(tokens, t)
+ } else if val, ok := basicTokens[r]; ok {
+ // Basic single char token.
+ t := token{
+ tokenType: val,
+ value: string(r),
+ position: lexer.currentPos - lexer.lastWidth,
+ length: 1,
+ }
+ tokens = append(tokens, t)
+ } else if r == '-' || (r >= '0' && r <= '9') {
+ t := lexer.consumeNumber()
+ tokens = append(tokens, t)
+ } else if r == '[' {
+ t := lexer.consumeLBracket()
+ tokens = append(tokens, t)
+ } else if r == '"' {
+ t, err := lexer.consumeQuotedIdentifier()
+ if err != nil {
+ return tokens, err
+ }
+ tokens = append(tokens, t)
+ } else if r == '\'' {
+ t, err := lexer.consumeRawStringLiteral()
+ if err != nil {
+ return tokens, err
+ }
+ tokens = append(tokens, t)
+ } else if r == '`' {
+ t, err := lexer.consumeLiteral()
+ if err != nil {
+ return tokens, err
+ }
+ tokens = append(tokens, t)
+ } else if r == '|' {
+ t := lexer.matchOrElse(r, '|', tOr, tPipe)
+ tokens = append(tokens, t)
+ } else if r == '<' {
+ t := lexer.matchOrElse(r, '=', tLTE, tLT)
+ tokens = append(tokens, t)
+ } else if r == '>' {
+ t := lexer.matchOrElse(r, '=', tGTE, tGT)
+ tokens = append(tokens, t)
+ } else if r == '!' {
+ t := lexer.matchOrElse(r, '=', tNE, tNot)
+ tokens = append(tokens, t)
+ } else if r == '=' {
+ t := lexer.matchOrElse(r, '=', tEQ, tUnknown)
+ tokens = append(tokens, t)
+ } else if r == '&' {
+ t := lexer.matchOrElse(r, '&', tAnd, tExpref)
+ tokens = append(tokens, t)
+ } else if r == eof {
+ break loop
+ } else if _, ok := whiteSpace[r]; ok {
+ // Ignore whitespace
+ } else {
+ return tokens, lexer.syntaxError(fmt.Sprintf("Unknown char: %s", strconv.QuoteRuneToASCII(r)))
+ }
+ }
+ tokens = append(tokens, token{tEOF, "", len(lexer.expression), 0})
+ return tokens, nil
+}
+
+// Consume characters until the ending rune "r" is reached.
+// If the end of the expression is reached before seeing the
+// terminating rune "r", then an error is returned.
+// If no error occurs then the matching substring is returned.
+// The returned string will not include the ending rune.
+func (lexer *Lexer) consumeUntil(end rune) (string, error) {
+ start := lexer.currentPos
+ current := lexer.next()
+ for current != end && current != eof {
+ if current == '\\' && lexer.peek() != eof {
+ lexer.next()
+ }
+ current = lexer.next()
+ }
+ if lexer.lastWidth == 0 {
+ // Then we hit an EOF so we never reached the closing
+ // delimiter.
+ return "", SyntaxError{
+ msg: "Unclosed delimiter: " + string(end),
+ Expression: lexer.expression,
+ Offset: len(lexer.expression),
+ }
+ }
+ return lexer.expression[start : lexer.currentPos-lexer.lastWidth], nil
+}
+
+func (lexer *Lexer) consumeLiteral() (token, error) {
+ start := lexer.currentPos
+ value, err := lexer.consumeUntil('`')
+ if err != nil {
+ return token{}, err
+ }
+ value = strings.Replace(value, "\\`", "`", -1)
+ return token{
+ tokenType: tJSONLiteral,
+ value: value,
+ position: start,
+ length: len(value),
+ }, nil
+}
+
+func (lexer *Lexer) consumeRawStringLiteral() (token, error) {
+ start := lexer.currentPos
+ currentIndex := start
+ current := lexer.next()
+ for current != '\'' && lexer.peek() != eof {
+ if current == '\\' && lexer.peek() == '\'' {
+ chunk := lexer.expression[currentIndex : lexer.currentPos-1]
+ lexer.buf.WriteString(chunk)
+ lexer.buf.WriteString("'")
+ lexer.next()
+ currentIndex = lexer.currentPos
+ }
+ current = lexer.next()
+ }
+ if lexer.lastWidth == 0 {
+ // Then we hit an EOF so we never reached the closing
+ // delimiter.
+ return token{}, SyntaxError{
+ msg: "Unclosed delimiter: '",
+ Expression: lexer.expression,
+ Offset: len(lexer.expression),
+ }
+ }
+ if currentIndex < lexer.currentPos {
+ lexer.buf.WriteString(lexer.expression[currentIndex : lexer.currentPos-1])
+ }
+ value := lexer.buf.String()
+ // Reset the buffer so it can reused again.
+ lexer.buf.Reset()
+ return token{
+ tokenType: tStringLiteral,
+ value: value,
+ position: start,
+ length: len(value),
+ }, nil
+}
+
+func (lexer *Lexer) syntaxError(msg string) SyntaxError {
+ return SyntaxError{
+ msg: msg,
+ Expression: lexer.expression,
+ Offset: lexer.currentPos - 1,
+ }
+}
+
+// Checks for a two char token, otherwise matches a single character
+// token. This is used whenever a two char token overlaps a single
+// char token, e.g. "||" -> tPipe, "|" -> tOr.
+func (lexer *Lexer) matchOrElse(first rune, second rune, matchedType tokType, singleCharType tokType) token {
+ start := lexer.currentPos - lexer.lastWidth
+ nextRune := lexer.next()
+ var t token
+ if nextRune == second {
+ t = token{
+ tokenType: matchedType,
+ value: string(first) + string(second),
+ position: start,
+ length: 2,
+ }
+ } else {
+ lexer.back()
+ t = token{
+ tokenType: singleCharType,
+ value: string(first),
+ position: start,
+ length: 1,
+ }
+ }
+ return t
+}
+
+func (lexer *Lexer) consumeLBracket() token {
+ // There's three options here:
+ // 1. A filter expression "[?"
+ // 2. A flatten operator "[]"
+ // 3. A bare rbracket "["
+ start := lexer.currentPos - lexer.lastWidth
+ nextRune := lexer.next()
+ var t token
+ if nextRune == '?' {
+ t = token{
+ tokenType: tFilter,
+ value: "[?",
+ position: start,
+ length: 2,
+ }
+ } else if nextRune == ']' {
+ t = token{
+ tokenType: tFlatten,
+ value: "[]",
+ position: start,
+ length: 2,
+ }
+ } else {
+ t = token{
+ tokenType: tLbracket,
+ value: "[",
+ position: start,
+ length: 1,
+ }
+ lexer.back()
+ }
+ return t
+}
+
+func (lexer *Lexer) consumeQuotedIdentifier() (token, error) {
+ start := lexer.currentPos
+ value, err := lexer.consumeUntil('"')
+ if err != nil {
+ return token{}, err
+ }
+ var decoded string
+ asJSON := []byte("\"" + value + "\"")
+ if err := json.Unmarshal([]byte(asJSON), &decoded); err != nil {
+ return token{}, err
+ }
+ return token{
+ tokenType: tQuotedIdentifier,
+ value: decoded,
+ position: start - 1,
+ length: len(decoded),
+ }, nil
+}
+
+func (lexer *Lexer) consumeUnquotedIdentifier() token {
+ // Consume runes until we reach the end of an unquoted
+ // identifier.
+ start := lexer.currentPos - lexer.lastWidth
+ for {
+ r := lexer.next()
+ if r < 0 || r > 128 || identifierTrailingBits[uint64(r)/64]&(1<<(uint64(r)%64)) == 0 {
+ lexer.back()
+ break
+ }
+ }
+ value := lexer.expression[start:lexer.currentPos]
+ return token{
+ tokenType: tUnquotedIdentifier,
+ value: value,
+ position: start,
+ length: lexer.currentPos - start,
+ }
+}
+
+func (lexer *Lexer) consumeNumber() token {
+ // Consume runes until we reach something that's not a number.
+ start := lexer.currentPos - lexer.lastWidth
+ for {
+ r := lexer.next()
+ if r < '0' || r > '9' {
+ lexer.back()
+ break
+ }
+ }
+ value := lexer.expression[start:lexer.currentPos]
+ return token{
+ tokenType: tNumber,
+ value: value,
+ position: start,
+ length: lexer.currentPos - start,
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer_test.go
new file mode 100644
index 00000000000..7a9a9ee24bf
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer_test.go
@@ -0,0 +1,161 @@
+package jmespath
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+var lexingTests = []struct {
+ expression string
+ expected []token
+}{
+ {"*", []token{token{tStar, "*", 0, 1}}},
+ {".", []token{token{tDot, ".", 0, 1}}},
+ {"[?", []token{token{tFilter, "[?", 0, 2}}},
+ {"[]", []token{token{tFlatten, "[]", 0, 2}}},
+ {"(", []token{token{tLparen, "(", 0, 1}}},
+ {")", []token{token{tRparen, ")", 0, 1}}},
+ {"[", []token{token{tLbracket, "[", 0, 1}}},
+ {"]", []token{token{tRbracket, "]", 0, 1}}},
+ {"{", []token{token{tLbrace, "{", 0, 1}}},
+ {"}", []token{token{tRbrace, "}", 0, 1}}},
+ {"||", []token{token{tOr, "||", 0, 2}}},
+ {"|", []token{token{tPipe, "|", 0, 1}}},
+ {"29", []token{token{tNumber, "29", 0, 2}}},
+ {"2", []token{token{tNumber, "2", 0, 1}}},
+ {"0", []token{token{tNumber, "0", 0, 1}}},
+ {"-20", []token{token{tNumber, "-20", 0, 3}}},
+ {"foo", []token{token{tUnquotedIdentifier, "foo", 0, 3}}},
+ {`"bar"`, []token{token{tQuotedIdentifier, "bar", 0, 3}}},
+ // Escaping the delimiter
+ {`"bar\"baz"`, []token{token{tQuotedIdentifier, `bar"baz`, 0, 7}}},
+ {",", []token{token{tComma, ",", 0, 1}}},
+ {":", []token{token{tColon, ":", 0, 1}}},
+ {"<", []token{token{tLT, "<", 0, 1}}},
+ {"<=", []token{token{tLTE, "<=", 0, 2}}},
+ {">", []token{token{tGT, ">", 0, 1}}},
+ {">=", []token{token{tGTE, ">=", 0, 2}}},
+ {"==", []token{token{tEQ, "==", 0, 2}}},
+ {"!=", []token{token{tNE, "!=", 0, 2}}},
+ {"`[0, 1, 2]`", []token{token{tJSONLiteral, "[0, 1, 2]", 1, 9}}},
+ {"'foo'", []token{token{tStringLiteral, "foo", 1, 3}}},
+ {"'a'", []token{token{tStringLiteral, "a", 1, 1}}},
+ {`'foo\'bar'`, []token{token{tStringLiteral, "foo'bar", 1, 7}}},
+ {"@", []token{token{tCurrent, "@", 0, 1}}},
+ {"&", []token{token{tExpref, "&", 0, 1}}},
+ // Quoted identifier unicode escape sequences
+ {`"\u2713"`, []token{token{tQuotedIdentifier, "✓", 0, 3}}},
+ {`"\\"`, []token{token{tQuotedIdentifier, `\`, 0, 1}}},
+ {"`\"foo\"`", []token{token{tJSONLiteral, "\"foo\"", 1, 5}}},
+ // Combinations of tokens.
+ {"foo.bar", []token{
+ token{tUnquotedIdentifier, "foo", 0, 3},
+ token{tDot, ".", 3, 1},
+ token{tUnquotedIdentifier, "bar", 4, 3},
+ }},
+ {"foo[0]", []token{
+ token{tUnquotedIdentifier, "foo", 0, 3},
+ token{tLbracket, "[", 3, 1},
+ token{tNumber, "0", 4, 1},
+ token{tRbracket, "]", 5, 1},
+ }},
+ {"foo[?a 0 {
+ output += fmt.Sprintf("%schildren: {\n", strings.Repeat(" ", nextIndent))
+ childIndent := nextIndent + 2
+ for _, elem := range node.children {
+ output += elem.PrettyPrint(childIndent)
+ }
+ }
+ output += fmt.Sprintf("%s}\n", spaces)
+ return output
+}
+
+var bindingPowers = map[tokType]int{
+ tEOF: 0,
+ tUnquotedIdentifier: 0,
+ tQuotedIdentifier: 0,
+ tRbracket: 0,
+ tRparen: 0,
+ tComma: 0,
+ tRbrace: 0,
+ tNumber: 0,
+ tCurrent: 0,
+ tExpref: 0,
+ tColon: 0,
+ tPipe: 1,
+ tOr: 2,
+ tAnd: 3,
+ tEQ: 5,
+ tLT: 5,
+ tLTE: 5,
+ tGT: 5,
+ tGTE: 5,
+ tNE: 5,
+ tFlatten: 9,
+ tStar: 20,
+ tFilter: 21,
+ tDot: 40,
+ tNot: 45,
+ tLbrace: 50,
+ tLbracket: 55,
+ tLparen: 60,
+}
+
+// Parser holds state about the current expression being parsed.
+type Parser struct {
+ expression string
+ tokens []token
+ index int
+}
+
+// NewParser creates a new JMESPath parser.
+func NewParser() *Parser {
+ p := Parser{}
+ return &p
+}
+
+// Parse will compile a JMESPath expression.
+func (p *Parser) Parse(expression string) (ASTNode, error) {
+ lexer := NewLexer()
+ p.expression = expression
+ p.index = 0
+ tokens, err := lexer.tokenize(expression)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ p.tokens = tokens
+ parsed, err := p.parseExpression(0)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ if p.current() != tEOF {
+ return ASTNode{}, p.syntaxError(fmt.Sprintf(
+ "Unexpected token at the end of the expresssion: %s", p.current()))
+ }
+ return parsed, nil
+}
+
+func (p *Parser) parseExpression(bindingPower int) (ASTNode, error) {
+ var err error
+ leftToken := p.lookaheadToken(0)
+ p.advance()
+ leftNode, err := p.nud(leftToken)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ currentToken := p.current()
+ for bindingPower < bindingPowers[currentToken] {
+ p.advance()
+ leftNode, err = p.led(currentToken, leftNode)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ currentToken = p.current()
+ }
+ return leftNode, nil
+}
+
+func (p *Parser) parseIndexExpression() (ASTNode, error) {
+ if p.lookahead(0) == tColon || p.lookahead(1) == tColon {
+ return p.parseSliceExpression()
+ }
+ indexStr := p.lookaheadToken(0).value
+ parsedInt, err := strconv.Atoi(indexStr)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ indexNode := ASTNode{nodeType: ASTIndex, value: parsedInt}
+ p.advance()
+ if err := p.match(tRbracket); err != nil {
+ return ASTNode{}, err
+ }
+ return indexNode, nil
+}
+
+func (p *Parser) parseSliceExpression() (ASTNode, error) {
+ parts := []*int{nil, nil, nil}
+ index := 0
+ current := p.current()
+ for current != tRbracket && index < 3 {
+ if current == tColon {
+ index++
+ p.advance()
+ } else if current == tNumber {
+ parsedInt, err := strconv.Atoi(p.lookaheadToken(0).value)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ parts[index] = &parsedInt
+ p.advance()
+ } else {
+ return ASTNode{}, p.syntaxError(
+ "Expected tColon or tNumber" + ", received: " + p.current().String())
+ }
+ current = p.current()
+ }
+ if err := p.match(tRbracket); err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{
+ nodeType: ASTSlice,
+ value: parts,
+ }, nil
+}
+
+func (p *Parser) match(tokenType tokType) error {
+ if p.current() == tokenType {
+ p.advance()
+ return nil
+ }
+ return p.syntaxError("Expected " + tokenType.String() + ", received: " + p.current().String())
+}
+
+func (p *Parser) led(tokenType tokType, node ASTNode) (ASTNode, error) {
+ switch tokenType {
+ case tDot:
+ if p.current() != tStar {
+ right, err := p.parseDotRHS(bindingPowers[tDot])
+ return ASTNode{
+ nodeType: ASTSubexpression,
+ children: []ASTNode{node, right},
+ }, err
+ }
+ p.advance()
+ right, err := p.parseProjectionRHS(bindingPowers[tDot])
+ return ASTNode{
+ nodeType: ASTValueProjection,
+ children: []ASTNode{node, right},
+ }, err
+ case tPipe:
+ right, err := p.parseExpression(bindingPowers[tPipe])
+ return ASTNode{nodeType: ASTPipe, children: []ASTNode{node, right}}, err
+ case tOr:
+ right, err := p.parseExpression(bindingPowers[tOr])
+ return ASTNode{nodeType: ASTOrExpression, children: []ASTNode{node, right}}, err
+ case tAnd:
+ right, err := p.parseExpression(bindingPowers[tAnd])
+ return ASTNode{nodeType: ASTAndExpression, children: []ASTNode{node, right}}, err
+ case tLparen:
+ name := node.value
+ var args []ASTNode
+ for p.current() != tRparen {
+ expression, err := p.parseExpression(0)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ if p.current() == tComma {
+ if err := p.match(tComma); err != nil {
+ return ASTNode{}, err
+ }
+ }
+ args = append(args, expression)
+ }
+ if err := p.match(tRparen); err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{
+ nodeType: ASTFunctionExpression,
+ value: name,
+ children: args,
+ }, nil
+ case tFilter:
+ return p.parseFilter(node)
+ case tFlatten:
+ left := ASTNode{nodeType: ASTFlatten, children: []ASTNode{node}}
+ right, err := p.parseProjectionRHS(bindingPowers[tFlatten])
+ return ASTNode{
+ nodeType: ASTProjection,
+ children: []ASTNode{left, right},
+ }, err
+ case tEQ, tNE, tGT, tGTE, tLT, tLTE:
+ right, err := p.parseExpression(bindingPowers[tokenType])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{
+ nodeType: ASTComparator,
+ value: tokenType,
+ children: []ASTNode{node, right},
+ }, nil
+ case tLbracket:
+ tokenType := p.current()
+ var right ASTNode
+ var err error
+ if tokenType == tNumber || tokenType == tColon {
+ right, err = p.parseIndexExpression()
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return p.projectIfSlice(node, right)
+ }
+ // Otherwise this is a projection.
+ if err := p.match(tStar); err != nil {
+ return ASTNode{}, err
+ }
+ if err := p.match(tRbracket); err != nil {
+ return ASTNode{}, err
+ }
+ right, err = p.parseProjectionRHS(bindingPowers[tStar])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{
+ nodeType: ASTProjection,
+ children: []ASTNode{node, right},
+ }, nil
+ }
+ return ASTNode{}, p.syntaxError("Unexpected token: " + tokenType.String())
+}
+
+func (p *Parser) nud(token token) (ASTNode, error) {
+ switch token.tokenType {
+ case tJSONLiteral:
+ var parsed interface{}
+ err := json.Unmarshal([]byte(token.value), &parsed)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{nodeType: ASTLiteral, value: parsed}, nil
+ case tStringLiteral:
+ return ASTNode{nodeType: ASTLiteral, value: token.value}, nil
+ case tUnquotedIdentifier:
+ return ASTNode{
+ nodeType: ASTField,
+ value: token.value,
+ }, nil
+ case tQuotedIdentifier:
+ node := ASTNode{nodeType: ASTField, value: token.value}
+ if p.current() == tLparen {
+ return ASTNode{}, p.syntaxErrorToken("Can't have quoted identifier as function name.", token)
+ }
+ return node, nil
+ case tStar:
+ left := ASTNode{nodeType: ASTIdentity}
+ var right ASTNode
+ var err error
+ if p.current() == tRbracket {
+ right = ASTNode{nodeType: ASTIdentity}
+ } else {
+ right, err = p.parseProjectionRHS(bindingPowers[tStar])
+ }
+ return ASTNode{nodeType: ASTValueProjection, children: []ASTNode{left, right}}, err
+ case tFilter:
+ return p.parseFilter(ASTNode{nodeType: ASTIdentity})
+ case tLbrace:
+ return p.parseMultiSelectHash()
+ case tFlatten:
+ left := ASTNode{
+ nodeType: ASTFlatten,
+ children: []ASTNode{ASTNode{nodeType: ASTIdentity}},
+ }
+ right, err := p.parseProjectionRHS(bindingPowers[tFlatten])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{nodeType: ASTProjection, children: []ASTNode{left, right}}, nil
+ case tLbracket:
+ tokenType := p.current()
+ //var right ASTNode
+ if tokenType == tNumber || tokenType == tColon {
+ right, err := p.parseIndexExpression()
+ if err != nil {
+ return ASTNode{}, nil
+ }
+ return p.projectIfSlice(ASTNode{nodeType: ASTIdentity}, right)
+ } else if tokenType == tStar && p.lookahead(1) == tRbracket {
+ p.advance()
+ p.advance()
+ right, err := p.parseProjectionRHS(bindingPowers[tStar])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{
+ nodeType: ASTProjection,
+ children: []ASTNode{ASTNode{nodeType: ASTIdentity}, right},
+ }, nil
+ } else {
+ return p.parseMultiSelectList()
+ }
+ case tCurrent:
+ return ASTNode{nodeType: ASTCurrentNode}, nil
+ case tExpref:
+ expression, err := p.parseExpression(bindingPowers[tExpref])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{nodeType: ASTExpRef, children: []ASTNode{expression}}, nil
+ case tNot:
+ expression, err := p.parseExpression(bindingPowers[tNot])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{nodeType: ASTNotExpression, children: []ASTNode{expression}}, nil
+ case tLparen:
+ expression, err := p.parseExpression(0)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ if err := p.match(tRparen); err != nil {
+ return ASTNode{}, err
+ }
+ return expression, nil
+ case tEOF:
+ return ASTNode{}, p.syntaxErrorToken("Incomplete expression", token)
+ }
+
+ return ASTNode{}, p.syntaxErrorToken("Invalid token: "+token.tokenType.String(), token)
+}
+
+func (p *Parser) parseMultiSelectList() (ASTNode, error) {
+ var expressions []ASTNode
+ for {
+ expression, err := p.parseExpression(0)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ expressions = append(expressions, expression)
+ if p.current() == tRbracket {
+ break
+ }
+ err = p.match(tComma)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ }
+ err := p.match(tRbracket)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return ASTNode{
+ nodeType: ASTMultiSelectList,
+ children: expressions,
+ }, nil
+}
+
+func (p *Parser) parseMultiSelectHash() (ASTNode, error) {
+ var children []ASTNode
+ for {
+ keyToken := p.lookaheadToken(0)
+ if err := p.match(tUnquotedIdentifier); err != nil {
+ if err := p.match(tQuotedIdentifier); err != nil {
+ return ASTNode{}, p.syntaxError("Expected tQuotedIdentifier or tUnquotedIdentifier")
+ }
+ }
+ keyName := keyToken.value
+ err := p.match(tColon)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ value, err := p.parseExpression(0)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ node := ASTNode{
+ nodeType: ASTKeyValPair,
+ value: keyName,
+ children: []ASTNode{value},
+ }
+ children = append(children, node)
+ if p.current() == tComma {
+ err := p.match(tComma)
+ if err != nil {
+ return ASTNode{}, nil
+ }
+ } else if p.current() == tRbrace {
+ err := p.match(tRbrace)
+ if err != nil {
+ return ASTNode{}, nil
+ }
+ break
+ }
+ }
+ return ASTNode{
+ nodeType: ASTMultiSelectHash,
+ children: children,
+ }, nil
+}
+
+func (p *Parser) projectIfSlice(left ASTNode, right ASTNode) (ASTNode, error) {
+ indexExpr := ASTNode{
+ nodeType: ASTIndexExpression,
+ children: []ASTNode{left, right},
+ }
+ if right.nodeType == ASTSlice {
+ right, err := p.parseProjectionRHS(bindingPowers[tStar])
+ return ASTNode{
+ nodeType: ASTProjection,
+ children: []ASTNode{indexExpr, right},
+ }, err
+ }
+ return indexExpr, nil
+}
+func (p *Parser) parseFilter(node ASTNode) (ASTNode, error) {
+ var right, condition ASTNode
+ var err error
+ condition, err = p.parseExpression(0)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ if err := p.match(tRbracket); err != nil {
+ return ASTNode{}, err
+ }
+ if p.current() == tFlatten {
+ right = ASTNode{nodeType: ASTIdentity}
+ } else {
+ right, err = p.parseProjectionRHS(bindingPowers[tFilter])
+ if err != nil {
+ return ASTNode{}, err
+ }
+ }
+
+ return ASTNode{
+ nodeType: ASTFilterProjection,
+ children: []ASTNode{node, right, condition},
+ }, nil
+}
+
+func (p *Parser) parseDotRHS(bindingPower int) (ASTNode, error) {
+ lookahead := p.current()
+ if tokensOneOf([]tokType{tQuotedIdentifier, tUnquotedIdentifier, tStar}, lookahead) {
+ return p.parseExpression(bindingPower)
+ } else if lookahead == tLbracket {
+ if err := p.match(tLbracket); err != nil {
+ return ASTNode{}, err
+ }
+ return p.parseMultiSelectList()
+ } else if lookahead == tLbrace {
+ if err := p.match(tLbrace); err != nil {
+ return ASTNode{}, err
+ }
+ return p.parseMultiSelectHash()
+ }
+ return ASTNode{}, p.syntaxError("Expected identifier, lbracket, or lbrace")
+}
+
+func (p *Parser) parseProjectionRHS(bindingPower int) (ASTNode, error) {
+ current := p.current()
+ if bindingPowers[current] < 10 {
+ return ASTNode{nodeType: ASTIdentity}, nil
+ } else if current == tLbracket {
+ return p.parseExpression(bindingPower)
+ } else if current == tFilter {
+ return p.parseExpression(bindingPower)
+ } else if current == tDot {
+ err := p.match(tDot)
+ if err != nil {
+ return ASTNode{}, err
+ }
+ return p.parseDotRHS(bindingPower)
+ } else {
+ return ASTNode{}, p.syntaxError("Error")
+ }
+}
+
+func (p *Parser) lookahead(number int) tokType {
+ return p.lookaheadToken(number).tokenType
+}
+
+func (p *Parser) current() tokType {
+ return p.lookahead(0)
+}
+
+func (p *Parser) lookaheadToken(number int) token {
+ return p.tokens[p.index+number]
+}
+
+func (p *Parser) advance() {
+ p.index++
+}
+
+func tokensOneOf(elements []tokType, token tokType) bool {
+ for _, elem := range elements {
+ if elem == token {
+ return true
+ }
+ }
+ return false
+}
+
+func (p *Parser) syntaxError(msg string) SyntaxError {
+ return SyntaxError{
+ msg: msg,
+ Expression: p.expression,
+ Offset: p.lookaheadToken(0).position,
+ }
+}
+
+// Create a SyntaxError based on the provided token.
+// This differs from syntaxError() which creates a SyntaxError
+// based on the current lookahead token.
+func (p *Parser) syntaxErrorToken(msg string, t token) SyntaxError {
+ return SyntaxError{
+ msg: msg,
+ Expression: p.expression,
+ Offset: t.position,
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser_test.go
new file mode 100644
index 00000000000..997a0f4d7c1
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser_test.go
@@ -0,0 +1,136 @@
+package jmespath
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+var parsingErrorTests = []struct {
+ expression string
+ msg string
+}{
+ {"foo.", "Incopmlete expression"},
+ {"[foo", "Incopmlete expression"},
+ {"]", "Invalid"},
+ {")", "Invalid"},
+ {"}", "Invalid"},
+ {"foo..bar", "Invalid"},
+ {`foo."bar`, "Forwards lexer errors"},
+ {`{foo: bar`, "Incomplete expression"},
+ {`{foo bar}`, "Invalid"},
+ {`[foo bar]`, "Invalid"},
+ {`foo@`, "Invalid"},
+ {`&&&&&&&&&&&&t(`, "Invalid"},
+ {`[*][`, "Invalid"},
+}
+
+func TestParsingErrors(t *testing.T) {
+ assert := assert.New(t)
+ parser := NewParser()
+ for _, tt := range parsingErrorTests {
+ _, err := parser.Parse(tt.expression)
+ assert.NotNil(err, fmt.Sprintf("Expected parsing error: %s, for expression: %s", tt.msg, tt.expression))
+ }
+}
+
+var prettyPrinted = `ASTProjection {
+ children: {
+ ASTField {
+ value: "foo"
+ }
+ ASTSubexpression {
+ children: {
+ ASTSubexpression {
+ children: {
+ ASTField {
+ value: "bar"
+ }
+ ASTField {
+ value: "baz"
+ }
+ }
+ ASTField {
+ value: "qux"
+ }
+ }
+}
+`
+
+var prettyPrintedCompNode = `ASTFilterProjection {
+ children: {
+ ASTField {
+ value: "a"
+ }
+ ASTIdentity {
+ }
+ ASTComparator {
+ value: tLTE
+ children: {
+ ASTField {
+ value: "b"
+ }
+ ASTField {
+ value: "c"
+ }
+ }
+}
+`
+
+func TestPrettyPrintedAST(t *testing.T) {
+ assert := assert.New(t)
+ parser := NewParser()
+ parsed, _ := parser.Parse("foo[*].bar.baz.qux")
+ assert.Equal(parsed.PrettyPrint(0), prettyPrinted)
+}
+
+func TestPrettyPrintedCompNode(t *testing.T) {
+ assert := assert.New(t)
+ parser := NewParser()
+ parsed, _ := parser.Parse("a[?b<=c]")
+ assert.Equal(parsed.PrettyPrint(0), prettyPrintedCompNode)
+}
+
+func BenchmarkParseIdentifier(b *testing.B) {
+ runParseBenchmark(b, exprIdentifier)
+}
+
+func BenchmarkParseSubexpression(b *testing.B) {
+ runParseBenchmark(b, exprSubexpr)
+}
+
+func BenchmarkParseDeeplyNested50(b *testing.B) {
+ runParseBenchmark(b, deeplyNested50)
+}
+
+func BenchmarkParseDeepNested50Pipe(b *testing.B) {
+ runParseBenchmark(b, deeplyNested50Pipe)
+}
+
+func BenchmarkParseDeepNested50Index(b *testing.B) {
+ runParseBenchmark(b, deeplyNested50Index)
+}
+
+func BenchmarkParseQuotedIdentifier(b *testing.B) {
+ runParseBenchmark(b, exprQuotedIdentifier)
+}
+
+func BenchmarkParseQuotedIdentifierEscapes(b *testing.B) {
+ runParseBenchmark(b, quotedIdentifierEscapes)
+}
+
+func BenchmarkParseRawStringLiteral(b *testing.B) {
+ runParseBenchmark(b, rawStringLiteral)
+}
+
+func BenchmarkParseDeepProjection104(b *testing.B) {
+ runParseBenchmark(b, deepProjection104)
+}
+
+func runParseBenchmark(b *testing.B, expression string) {
+ parser := NewParser()
+ for i := 0; i < b.N; i++ {
+ parser.Parse(expression)
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/toktype_string.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/toktype_string.go
new file mode 100644
index 00000000000..dae79cbdf33
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/toktype_string.go
@@ -0,0 +1,16 @@
+// generated by stringer -type=tokType; DO NOT EDIT
+
+package jmespath
+
+import "fmt"
+
+const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF"
+
+var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214}
+
+func (i tokType) String() string {
+ if i < 0 || i >= tokType(len(_tokType_index)-1) {
+ return fmt.Sprintf("tokType(%d)", i)
+ }
+ return _tokType_name[_tokType_index[i]:_tokType_index[i+1]]
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util.go
new file mode 100644
index 00000000000..ddc1b7d7d46
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util.go
@@ -0,0 +1,185 @@
+package jmespath
+
+import (
+ "errors"
+ "reflect"
+)
+
+// IsFalse determines if an object is false based on the JMESPath spec.
+// JMESPath defines false values to be any of:
+// - An empty string array, or hash.
+// - The boolean value false.
+// - nil
+func isFalse(value interface{}) bool {
+ switch v := value.(type) {
+ case bool:
+ return !v
+ case []interface{}:
+ return len(v) == 0
+ case map[string]interface{}:
+ return len(v) == 0
+ case string:
+ return len(v) == 0
+ case nil:
+ return true
+ }
+ // Try the reflection cases before returning false.
+ rv := reflect.ValueOf(value)
+ switch rv.Kind() {
+ case reflect.Struct:
+ // A struct type will never be false, even if
+ // all of its values are the zero type.
+ return false
+ case reflect.Slice, reflect.Map:
+ return rv.Len() == 0
+ case reflect.Ptr:
+ if rv.IsNil() {
+ return true
+ }
+ // If it's a pointer type, we'll try to deref the pointer
+ // and evaluate the pointer value for isFalse.
+ element := rv.Elem()
+ return isFalse(element.Interface())
+ }
+ return false
+}
+
+// ObjsEqual is a generic object equality check.
+// It will take two arbitrary objects and recursively determine
+// if they are equal.
+func objsEqual(left interface{}, right interface{}) bool {
+ return reflect.DeepEqual(left, right)
+}
+
+// SliceParam refers to a single part of a slice.
+// A slice consists of a start, a stop, and a step, similar to
+// python slices.
+type sliceParam struct {
+ N int
+ Specified bool
+}
+
+// Slice supports [start:stop:step] style slicing that's supported in JMESPath.
+func slice(slice []interface{}, parts []sliceParam) ([]interface{}, error) {
+ computed, err := computeSliceParams(len(slice), parts)
+ if err != nil {
+ return nil, err
+ }
+ start, stop, step := computed[0], computed[1], computed[2]
+ result := []interface{}{}
+ if step > 0 {
+ for i := start; i < stop; i += step {
+ result = append(result, slice[i])
+ }
+ } else {
+ for i := start; i > stop; i += step {
+ result = append(result, slice[i])
+ }
+ }
+ return result, nil
+}
+
+func computeSliceParams(length int, parts []sliceParam) ([]int, error) {
+ var start, stop, step int
+ if !parts[2].Specified {
+ step = 1
+ } else if parts[2].N == 0 {
+ return nil, errors.New("Invalid slice, step cannot be 0")
+ } else {
+ step = parts[2].N
+ }
+ var stepValueNegative bool
+ if step < 0 {
+ stepValueNegative = true
+ } else {
+ stepValueNegative = false
+ }
+
+ if !parts[0].Specified {
+ if stepValueNegative {
+ start = length - 1
+ } else {
+ start = 0
+ }
+ } else {
+ start = capSlice(length, parts[0].N, step)
+ }
+
+ if !parts[1].Specified {
+ if stepValueNegative {
+ stop = -1
+ } else {
+ stop = length
+ }
+ } else {
+ stop = capSlice(length, parts[1].N, step)
+ }
+ return []int{start, stop, step}, nil
+}
+
+func capSlice(length int, actual int, step int) int {
+ if actual < 0 {
+ actual += length
+ if actual < 0 {
+ if step < 0 {
+ actual = -1
+ } else {
+ actual = 0
+ }
+ }
+ } else if actual >= length {
+ if step < 0 {
+ actual = length - 1
+ } else {
+ actual = length
+ }
+ }
+ return actual
+}
+
+// ToArrayNum converts an empty interface type to a slice of float64.
+// If any element in the array cannot be converted, then nil is returned
+// along with a second value of false.
+func toArrayNum(data interface{}) ([]float64, bool) {
+ // Is there a better way to do this with reflect?
+ if d, ok := data.([]interface{}); ok {
+ result := make([]float64, len(d))
+ for i, el := range d {
+ item, ok := el.(float64)
+ if !ok {
+ return nil, false
+ }
+ result[i] = item
+ }
+ return result, true
+ }
+ return nil, false
+}
+
+// ToArrayStr converts an empty interface type to a slice of strings.
+// If any element in the array cannot be converted, then nil is returned
+// along with a second value of false. If the input data could be entirely
+// converted, then the converted data, along with a second value of true,
+// will be returned.
+func toArrayStr(data interface{}) ([]string, bool) {
+ // Is there a better way to do this with reflect?
+ if d, ok := data.([]interface{}); ok {
+ result := make([]string, len(d))
+ for i, el := range d {
+ item, ok := el.(string)
+ if !ok {
+ return nil, false
+ }
+ result[i] = item
+ }
+ return result, true
+ }
+ return nil, false
+}
+
+func isSliceType(v interface{}) bool {
+ if v == nil {
+ return false
+ }
+ return reflect.TypeOf(v).Kind() == reflect.Slice
+}
diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util_test.go
new file mode 100644
index 00000000000..1e2cd935206
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util_test.go
@@ -0,0 +1,73 @@
+package jmespath
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestSlicePositiveStep(t *testing.T) {
+ assert := assert.New(t)
+ input := make([]interface{}, 5)
+ input[0] = 0
+ input[1] = 1
+ input[2] = 2
+ input[3] = 3
+ input[4] = 4
+ result, err := slice(input, []sliceParam{sliceParam{0, true}, sliceParam{3, true}, sliceParam{1, true}})
+ assert.Nil(err)
+ assert.Equal(input[:3], result)
+}
+
+func TestIsFalseJSONTypes(t *testing.T) {
+ assert := assert.New(t)
+ assert.True(isFalse(false))
+ assert.True(isFalse(""))
+ var empty []interface{}
+ assert.True(isFalse(empty))
+ m := make(map[string]interface{})
+ assert.True(isFalse(m))
+ assert.True(isFalse(nil))
+
+}
+
+func TestIsFalseWithUserDefinedStructs(t *testing.T) {
+ assert := assert.New(t)
+ type nilStructType struct {
+ SliceOfPointers []*string
+ }
+ nilStruct := nilStructType{SliceOfPointers: nil}
+ assert.True(isFalse(nilStruct.SliceOfPointers))
+
+ // A user defined struct will never be false though,
+ // even if it's fields are the zero type.
+ assert.False(isFalse(nilStruct))
+}
+
+func TestIsFalseWithNilInterface(t *testing.T) {
+ assert := assert.New(t)
+ var a *int = nil
+ var nilInterface interface{}
+ nilInterface = a
+ assert.True(isFalse(nilInterface))
+}
+
+func TestIsFalseWithMapOfUserStructs(t *testing.T) {
+ assert := assert.New(t)
+ type foo struct {
+ Bar string
+ Baz string
+ }
+ m := make(map[int]foo)
+ assert.True(isFalse(m))
+}
+
+func TestObjsEqual(t *testing.T) {
+ assert := assert.New(t)
+ assert.True(objsEqual("foo", "foo"))
+ assert.True(objsEqual(20, 20))
+ assert.True(objsEqual([]int{1, 2, 3}, []int{1, 2, 3}))
+ assert.True(objsEqual(nil, nil))
+ assert.True(!objsEqual(nil, "foo"))
+ assert.True(objsEqual([]int{}, []int{}))
+ assert.True(!objsEqual([]int{}, nil))
+}
diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/LICENSE b/Godeps/_workspace/src/github.com/vaughan0/go-ini/LICENSE
deleted file mode 100644
index 968b45384d0..00000000000
--- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/LICENSE
+++ /dev/null
@@ -1,14 +0,0 @@
-Copyright (c) 2013 Vaughan Newton
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
-persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/README.md b/Godeps/_workspace/src/github.com/vaughan0/go-ini/README.md
deleted file mode 100644
index d5cd4e74b00..00000000000
--- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/README.md
+++ /dev/null
@@ -1,70 +0,0 @@
-go-ini
-======
-
-INI parsing library for Go (golang).
-
-View the API documentation [here](http://godoc.org/github.com/vaughan0/go-ini).
-
-Usage
------
-
-Parse an INI file:
-
-```go
-import "github.com/vaughan0/go-ini"
-
-file, err := ini.LoadFile("myfile.ini")
-```
-
-Get data from the parsed file:
-
-```go
-name, ok := file.Get("person", "name")
-if !ok {
- panic("'name' variable missing from 'person' section")
-}
-```
-
-Iterate through values in a section:
-
-```go
-for key, value := range file["mysection"] {
- fmt.Printf("%s => %s\n", key, value)
-}
-```
-
-Iterate through sections in a file:
-
-```go
-for name, section := range file {
- fmt.Printf("Section name: %s\n", name)
-}
-```
-
-File Format
------------
-
-INI files are parsed by go-ini line-by-line. Each line may be one of the following:
-
- * A section definition: [section-name]
- * A property: key = value
- * A comment: #blahblah _or_ ;blahblah
- * Blank. The line will be ignored.
-
-Properties defined before any section headers are placed in the default section, which has
-the empty string as it's key.
-
-Example:
-
-```ini
-# I am a comment
-; So am I!
-
-[apples]
-colour = red or green
-shape = applish
-
-[oranges]
-shape = square
-colour = blue
-```
diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini.go b/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini.go
deleted file mode 100644
index 81aeb32f8b2..00000000000
--- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Package ini provides functions for parsing INI configuration files.
-package ini
-
-import (
- "bufio"
- "fmt"
- "io"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- sectionRegex = regexp.MustCompile(`^\[(.*)\]$`)
- assignRegex = regexp.MustCompile(`^([^=]+)=(.*)$`)
-)
-
-// ErrSyntax is returned when there is a syntax error in an INI file.
-type ErrSyntax struct {
- Line int
- Source string // The contents of the erroneous line, without leading or trailing whitespace
-}
-
-func (e ErrSyntax) Error() string {
- return fmt.Sprintf("invalid INI syntax on line %d: %s", e.Line, e.Source)
-}
-
-// A File represents a parsed INI file.
-type File map[string]Section
-
-// A Section represents a single section of an INI file.
-type Section map[string]string
-
-// Returns a named Section. A Section will be created if one does not already exist for the given name.
-func (f File) Section(name string) Section {
- section := f[name]
- if section == nil {
- section = make(Section)
- f[name] = section
- }
- return section
-}
-
-// Looks up a value for a key in a section and returns that value, along with a boolean result similar to a map lookup.
-func (f File) Get(section, key string) (value string, ok bool) {
- if s := f[section]; s != nil {
- value, ok = s[key]
- }
- return
-}
-
-// Loads INI data from a reader and stores the data in the File.
-func (f File) Load(in io.Reader) (err error) {
- bufin, ok := in.(*bufio.Reader)
- if !ok {
- bufin = bufio.NewReader(in)
- }
- return parseFile(bufin, f)
-}
-
-// Loads INI data from a named file and stores the data in the File.
-func (f File) LoadFile(file string) (err error) {
- in, err := os.Open(file)
- if err != nil {
- return
- }
- defer in.Close()
- return f.Load(in)
-}
-
-func parseFile(in *bufio.Reader, file File) (err error) {
- section := ""
- lineNum := 0
- for done := false; !done; {
- var line string
- if line, err = in.ReadString('\n'); err != nil {
- if err == io.EOF {
- done = true
- } else {
- return
- }
- }
- lineNum++
- line = strings.TrimSpace(line)
- if len(line) == 0 {
- // Skip blank lines
- continue
- }
- if line[0] == ';' || line[0] == '#' {
- // Skip comments
- continue
- }
-
- if groups := assignRegex.FindStringSubmatch(line); groups != nil {
- key, val := groups[1], groups[2]
- key, val = strings.TrimSpace(key), strings.TrimSpace(val)
- file.Section(section)[key] = val
- } else if groups := sectionRegex.FindStringSubmatch(line); groups != nil {
- name := strings.TrimSpace(groups[1])
- section = name
- // Create the section if it does not exist
- file.Section(section)
- } else {
- return ErrSyntax{lineNum, line}
- }
-
- }
- return nil
-}
-
-// Loads and returns a File from a reader.
-func Load(in io.Reader) (File, error) {
- file := make(File)
- err := file.Load(in)
- return file, err
-}
-
-// Loads and returns an INI File from a file on disk.
-func LoadFile(filename string) (File, error) {
- file := make(File)
- err := file.LoadFile(filename)
- return file, err
-}
diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_linux_test.go b/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_linux_test.go
deleted file mode 100644
index 38a6f0004cf..00000000000
--- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_linux_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package ini
-
-import (
- "reflect"
- "syscall"
- "testing"
-)
-
-func TestLoadFile(t *testing.T) {
- originalOpenFiles := numFilesOpen(t)
-
- file, err := LoadFile("test.ini")
- if err != nil {
- t.Fatal(err)
- }
-
- if originalOpenFiles != numFilesOpen(t) {
- t.Error("test.ini not closed")
- }
-
- if !reflect.DeepEqual(file, File{"default": {"stuff": "things"}}) {
- t.Error("file not read correctly")
- }
-}
-
-func numFilesOpen(t *testing.T) (num uint64) {
- var rlimit syscall.Rlimit
- err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlimit)
- if err != nil {
- t.Fatal(err)
- }
- maxFds := int(rlimit.Cur)
-
- var stat syscall.Stat_t
- for i := 0; i < maxFds; i++ {
- if syscall.Fstat(i, &stat) == nil {
- num++
- } else {
- return
- }
- }
- return
-}
diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_test.go b/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_test.go
deleted file mode 100644
index 06a4d05eaf0..00000000000
--- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_test.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package ini
-
-import (
- "reflect"
- "strings"
- "testing"
-)
-
-func TestLoad(t *testing.T) {
- src := `
- # Comments are ignored
-
- herp = derp
-
- [foo]
- hello=world
- whitespace should = not matter
- ; sneaky semicolon-style comment
- multiple = equals = signs
-
- [bar]
- this = that`
-
- file, err := Load(strings.NewReader(src))
- if err != nil {
- t.Fatal(err)
- }
- check := func(section, key, expect string) {
- if value, _ := file.Get(section, key); value != expect {
- t.Errorf("Get(%q, %q): expected %q, got %q", section, key, expect, value)
- }
- }
-
- check("", "herp", "derp")
- check("foo", "hello", "world")
- check("foo", "whitespace should", "not matter")
- check("foo", "multiple", "equals = signs")
- check("bar", "this", "that")
-}
-
-func TestSyntaxError(t *testing.T) {
- src := `
- # Line 2
- [foo]
- bar = baz
- # Here's an error on line 6:
- wut?
- herp = derp`
- _, err := Load(strings.NewReader(src))
- t.Logf("%T: %v", err, err)
- if err == nil {
- t.Fatal("expected an error, got nil")
- }
- syntaxErr, ok := err.(ErrSyntax)
- if !ok {
- t.Fatal("expected an error of type ErrSyntax")
- }
- if syntaxErr.Line != 6 {
- t.Fatal("incorrect line number")
- }
- if syntaxErr.Source != "wut?" {
- t.Fatal("incorrect source")
- }
-}
-
-func TestDefinedSectionBehaviour(t *testing.T) {
- check := func(src string, expect File) {
- file, err := Load(strings.NewReader(src))
- if err != nil {
- t.Fatal(err)
- }
- if !reflect.DeepEqual(file, expect) {
- t.Errorf("expected %v, got %v", expect, file)
- }
- }
- // No sections for an empty file
- check("", File{})
- // Default section only if there are actually values for it
- check("foo=bar", File{"": {"foo": "bar"}})
- // User-defined sections should always be present, even if empty
- check("[a]\n[b]\nfoo=bar", File{
- "a": {},
- "b": {"foo": "bar"},
- })
- check("foo=bar\n[a]\nthis=that", File{
- "": {"foo": "bar"},
- "a": {"this": "that"},
- })
-}
diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/test.ini b/Godeps/_workspace/src/github.com/vaughan0/go-ini/test.ini
deleted file mode 100644
index d13c999e254..00000000000
--- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/test.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[default]
-stuff = things