diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 5d0358c2cdf..e8762c69b95 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -49,53 +49,58 @@ }, { "ImportPath": "github.com/aws/aws-sdk-go/aws", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/private/endpoints", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/waiter", + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/autoscaling", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/ec2", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/elb", - "Comment": "v0.9.16-3-g4944a94", - "Rev": "4944a94a3b092d1dad8a964415700a70f55e580a" + "Comment": "v1.0.2", + "Rev": "9d7bc2d6ca2ada0468f705f0e9725ca97f8550c8" }, { "ImportPath": "github.com/beorn7/perks/quantile", @@ -411,6 +416,11 @@ "ImportPath": "github.com/ghodss/yaml", "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" }, + { + "ImportPath": "github.com/go-ini/ini", + "Comment": "v0-54-g2e44421", + "Rev": "2e44421e256d82ebbf3d4d4fcabe8930b905eff3" + }, { "ImportPath": "github.com/godbus/dbus", "Comment": "v3", @@ -553,6 +563,11 @@ "Comment": "v0.8.8", "Rev": "afde71eb1740fd763ab9450e1f700ba0e53c36d0" }, + { + "ImportPath": "github.com/jmespath/go-jmespath", + "Comment": "0.2.2", + "Rev": "3433f3ea46d9f8019119e7dd41274e112a2359a9" + }, { "ImportPath": "github.com/jonboulle/clockwork", "Rev": "3f831b65b61282ba6bece21b91beea2edc4c887a" @@ -733,10 +748,6 @@ "ImportPath": "github.com/ugorji/go/codec", "Rev": "f1f1a805ed361a0e078bb537e4ea78cd37dcf065" }, - { - "ImportPath": "github.com/vaughan0/go-ini", - "Rev": "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1" - }, { "ImportPath": "github.com/vishvananda/netlink", "Rev": "1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270" 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/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/path_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 905d82385ec..4d2a01e8c41 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,18 +5,20 @@ import ( "regexp" "strconv" "strings" + + "github.com/jmespath/go-jmespath" ) var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) // rValuesAtPath returns a slice of values found in value v. The values // in v are explored recursively so all nested values are collected. -func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) []reflect.Value { +func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value { pathparts := strings.Split(path, "||") if len(pathparts) > 1 { for _, pathpart := range pathparts { - vals := rValuesAtPath(v, pathpart, create, caseSensitive) - if vals != nil && len(vals) > 0 { + vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm) + if len(vals) > 0 { return vals } } @@ -74,7 +76,16 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) return false }) - if create && value.Kind() == reflect.Ptr && value.IsNil() { + if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 { + if !value.IsNil() { + value.Set(reflect.Zero(value.Type())) + } + return []reflect.Value{value} + } + + if createPath && value.Kind() == reflect.Ptr && value.IsNil() { + // TODO if the value is the terminus it should not be created + // if the value to be set to its position is nil. value.Set(reflect.New(value.Type().Elem())) value = value.Elem() } else { @@ -82,7 +93,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) } if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !create && value.IsNil() { + if !createPath && value.IsNil() { value = reflect.ValueOf(nil) } } @@ -114,7 +125,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) // pull out index i := int(*index) if i >= value.Len() { // check out of bounds - if create { + if createPath { // TODO resize slice } else { continue @@ -125,7 +136,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) value = reflect.Indirect(value.Index(i)) if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !create && value.IsNil() { + if !createPath && value.IsNil() { value = reflect.ValueOf(nil) } } @@ -142,46 +153,70 @@ 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 { + if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil { for _, rval := range rvals { - rval.Set(reflect.ValueOf(v)) + if rval.Kind() == reflect.Ptr && rval.IsNil() { + continue + } + setValue(rval, 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)) - } +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/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..e639ce040d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go @@ -0,0 +1,120 @@ +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, + } + + switch retryer, ok := cfg.Retryer.(request.Retryer); { + case ok: + svc.Retryer = retryer + case cfg.Retryer != nil && cfg.Logger != nil: + s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer) + cfg.Logger.Log(s) + fallthrough + default: + 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..75fcc8284b9 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,20 @@ 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 + +// RequestRetryer is an alias for a type that implements the request.Retryer interface. +type RequestRetryer interface{} // 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) @@ -57,6 +62,21 @@ type Config struct { // configuration. MaxRetries *int + // Retryer guides how HTTP requests should be retried in case of recoverable failures. + // + // When nil or the value does not implement the request.Retryer interface, + // the request.DefaultRetryer will be used. + // + // When both Retryer and MaxRetries are non-nil, the former is used and + // the latter ignored. + // + // To set the Retryer field in a type-safe manner and with chaining, use + // the request.WithRetryer helper function: + // + // cfg := request.WithRetryer(aws.NewConfig(), myRetryer) + // + Retryer RequestRetryer + // Disables semantic parameter validation, which validates input for missing // required fields and/or other semantic request input errors. DisableParamValidation *bool @@ -171,15 +191,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 @@ -213,6 +235,10 @@ func (c Config) Merge(other *Config) *Config { dst.MaxRetries = other.MaxRetries } + if other.Retryer != nil { + dst.Retryer = other.Retryer + } + if other.DisableParamValidation != nil { dst.DisableParamValidation = other.DisableParamValidation } @@ -228,12 +254,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/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/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/credentials/chain_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go index 7f509ca83ca..115b40739a8 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go @@ -36,7 +36,9 @@ var ( // creds := NewChainCredentials( // []Provider{ // &EnvProvider{}, -// &EC2RoleProvider{}, +// &EC2RoleProvider{ +// Client: ec2metadata.New(sess), +// }, // }) // // // Usage of ChainCredentials with aws.Config 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..04c8921a0eb 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" ) @@ -22,12 +23,10 @@ import ( // p := &ec2rolecreds.EC2RoleProvider{ // // Pass in a custom timeout to be used when requesting // // IAM EC2 Role credentials. -// Client: &http.Client{ -// Timeout: 10 * time.Second, -// }, -// // Use default EC2 Role metadata endpoint, Alternate endpoints can be -// // specified setting Endpoint to something else. -// Endpoint: "", +// Client: ec2metadata.New(sess, aws.Config{ +// HTTPClient: &http.Client{Timeout: 10 * time.Second}, +// }), +// // // Do not use early expiry of credentials. If a non zero value is // // specified the credentials will be expired early // ExpiryWindow: 0, @@ -35,8 +34,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 +49,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 +107,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 +125,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 +148,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/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/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/defaults/defaults.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go index 2f161b57f1d..50f831c8fc5 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,10 @@ +// Package defaults is a collection of helpers to retrieve the SDK's default +// configuration and handlers. +// +// Generally this package shouldn't be used directly, but session.Session +// instead. This package is useful when you need to reset the defaults +// of a session or service client to the SDK defaults before setting +// additional parameters. package defaults import ( @@ -6,34 +13,83 @@ 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. +// 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 without credentials. +// To retrieve a config with credentials also included use +// `defaults.Get().Config` instead. // -// 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) +// Generally you shouldn't need to use this method directly, but +// is available if you need to reset the configuration of an +// existing service client or session. +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. +// +// Generally you shouldn't need to use this method directly, but +// is available if you need to reset the request handlers of an +// existing service client or session. +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. +// +// Generally you shouldn't need to use this method directly, but +// is available if you need to reset the credentials of an +// existing service client or session's Config. +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/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/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..2939ec473f2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -0,0 +1,104 @@ +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{}{} + tokenAdded := false + for _, outToken := range r.Operation.OutputTokens { + v, _ := awsutil.ValuesAtPath(r.Data, outToken) + if len(v) > 0 { + tokens = append(tokens, v[0]) + tokenAdded = true + } else { + tokens = append(tokens, nil) + } + } + if !tokenAdded { + return nil + } + + 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() { + if err := page.Send(); err != nil { + return err + } + if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage { + return page.Error + } + } + + return nil +} 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..ab6fff5ac84 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 @@ -3,6 +3,7 @@ package request import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -12,13 +13,21 @@ import ( type Retryer interface { RetryRules(*Request) time.Duration ShouldRetry(*Request) bool - MaxRetries() uint + MaxRetries() int +} + +// WithRetryer sets a config Retryer value to the given Config returning it +// for chaining. +func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { + cfg.Retryer = retryer + return cfg } // 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..6a0f371a29a --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session.go @@ -0,0 +1,111 @@ +// Package session provides a way to create service clients with shared configuration +// and handlers. +// +// Generally this package should be used instead of the `defaults` package. +// +// A session should be used to share configurations and request handlers between multiple +// service clients. When service clients need specific configuration aws.Config can be +// used to provide additional configuration directly to the service client. +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/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..668e406ef38 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 = "1.0.2" 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/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/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/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/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/waiter/waiter.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go new file mode 100644 index 00000000000..e5fb13666ab --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go @@ -0,0 +1,136 @@ +package waiter + +import ( + "fmt" + "reflect" + "time" + + "github.com/aws/aws-sdk-go/aws" + "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")) + + err := req.Send() + for _, a := range w.Acceptors { + if err != nil && a.Matcher != "error" { + // Only matcher error is valid if there is a request error + continue + } + + result := false + var vals []interface{} + switch a.Matcher { + case "pathAll", "path": + // Require all matches to be equal for result to match + vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) + result = true + for _, val := range vals { + if !awsutil.DeepEqual(val, a.Expected) { + result = false + break + } + } + case "pathAny": + // Only a single match needs to equal for the result to match + vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument) + for _, val := range vals { + if awsutil.DeepEqual(val, a.Expected) { + result = true + break + } + } + case "status": + s := a.Expected.(int) + result = s == req.HTTPResponse.StatusCode + case "error": + if aerr, ok := err.(awserr.Error); ok { + result = aerr.Code() == a.Expected.(string) + } + case "pathList": + // ignored matcher + default: + logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s", + w.Config.Operation, a.Matcher) + } + + if !result { + // If there was no matching result found there is nothing more to do + // for this response, retry the request. + continue + } + + switch a.State { + case "success": + // waiter completed + return nil + case "failure": + // Waiter failure state triggered + return awserr.New("ResourceNotReady", + fmt.Sprintf("failed waiting for successful resource state"), err) + case "retry": + // clear the error and retry the operation + err = nil + default: + logf(client, "WARNING: Waiter for %s encountered unexpected state: %s", + w.Config.Operation, a.State) + } + } + if err != nil { + return err + } + + time.Sleep(time.Second * time.Duration(w.Delay)) + } + + return awserr.New("ResourceNotReady", + fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil) +} + +func logf(client reflect.Value, msg string, args ...interface{}) { + cfgVal := client.FieldByName("Config") + if !cfgVal.IsValid() { + return + } + if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil { + cfg.Logger.Log(fmt.Sprintf(msg, args...)) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go index ab339f88bab..451708f8582 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -519,6 +519,7 @@ func (c *AutoScaling) DescribeAutoScalingGroups(input *DescribeAutoScalingGroups func (c *AutoScaling) DescribeAutoScalingGroupsPages(input *DescribeAutoScalingGroupsInput, fn func(p *DescribeAutoScalingGroupsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeAutoScalingGroupsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeAutoScalingGroupsOutput), lastPage) }) @@ -560,6 +561,7 @@ func (c *AutoScaling) DescribeAutoScalingInstances(input *DescribeAutoScalingIns func (c *AutoScaling) DescribeAutoScalingInstancesPages(input *DescribeAutoScalingInstancesInput, fn func(p *DescribeAutoScalingInstancesOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeAutoScalingInstancesRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeAutoScalingInstancesOutput), lastPage) }) @@ -628,6 +630,7 @@ func (c *AutoScaling) DescribeLaunchConfigurations(input *DescribeLaunchConfigur func (c *AutoScaling) DescribeLaunchConfigurationsPages(input *DescribeLaunchConfigurationsInput, fn func(p *DescribeLaunchConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeLaunchConfigurationsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeLaunchConfigurationsOutput), lastPage) }) @@ -780,6 +783,7 @@ func (c *AutoScaling) DescribeNotificationConfigurations(input *DescribeNotifica func (c *AutoScaling) DescribeNotificationConfigurationsPages(input *DescribeNotificationConfigurationsInput, fn func(p *DescribeNotificationConfigurationsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeNotificationConfigurationsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeNotificationConfigurationsOutput), lastPage) }) @@ -820,6 +824,7 @@ func (c *AutoScaling) DescribePolicies(input *DescribePoliciesInput) (*DescribeP func (c *AutoScaling) DescribePoliciesPages(input *DescribePoliciesInput, fn func(p *DescribePoliciesOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribePoliciesRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribePoliciesOutput), lastPage) }) @@ -863,6 +868,7 @@ func (c *AutoScaling) DescribeScalingActivities(input *DescribeScalingActivities func (c *AutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(p *DescribeScalingActivitiesOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeScalingActivitiesRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeScalingActivitiesOutput), lastPage) }) @@ -931,6 +937,7 @@ func (c *AutoScaling) DescribeScheduledActions(input *DescribeScheduledActionsIn func (c *AutoScaling) DescribeScheduledActionsPages(input *DescribeScheduledActionsInput, fn func(p *DescribeScheduledActionsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeScheduledActionsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeScheduledActionsOutput), lastPage) }) @@ -980,6 +987,7 @@ func (c *AutoScaling) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutpu func (c *AutoScaling) 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) }) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go index 2de4f9e7e7f..557894b86ce 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go @@ -218,3 +218,5 @@ type AutoScalingAPI interface { UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error) } + +var _ AutoScalingAPI = (*autoscaling.AutoScaling)(nil) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go index 32f85f67fac..8107b3e6516 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go @@ -4,10 +4,9 @@ package autoscaling 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" ) @@ -15,40 +14,64 @@ import ( // Auto Scaling is designed to automatically launch or terminate EC2 instances // based on user-defined policies, schedules, and health checks. Use this service // in conjunction with the Amazon CloudWatch and Elastic Load Balancing services. +//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 AutoScaling 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 AutoScaling client. -func New(config *aws.Config) *AutoScaling { - service := &service.Service{ - ServiceInfo: serviceinfo.ServiceInfo{ - Config: defaults.DefaultConfig.Merge(config), - ServiceName: "autoscaling", - APIVersion: "2011-01-01", - }, +// A ServiceName is the name of the service the client will make API calls to. +const ServiceName = "autoscaling" + +// New creates a new instance of the AutoScaling 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 AutoScaling client from just a session. +// svc := autoscaling.New(mySession) +// +// // Create a AutoScaling client with additional configuration +// svc := autoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *AutoScaling { + 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) *AutoScaling { + svc := &AutoScaling{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2011-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) - // Run custom service initialization if present - if initService != nil { - initService(service) + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) } - return &AutoScaling{service} + return svc } // newRequest creates a new request for a AutoScaling 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..084d4d57353 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 @@ -71,6 +71,35 @@ func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutp return out, err } +const opAllocateHosts = "AllocateHosts" + +// AllocateHostsRequest generates a request for the AllocateHosts operation. +func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Request, output *AllocateHostsOutput) { + op := &request.Operation{ + Name: opAllocateHosts, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AllocateHostsInput{} + } + + req = c.newRequest(op, input, output) + output = &AllocateHostsOutput{} + req.Data = output + return +} + +// Allocates a Dedicated host to your account. At minimum you need to specify +// the instance size type, Availability Zone, and quantity of hosts you want +// to allocate. +func (c *EC2) AllocateHosts(input *AllocateHostsInput) (*AllocateHostsOutput, error) { + req, out := c.AllocateHostsRequest(input) + err := req.Send() + return out, err +} + const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" // AssignPrivateIpAddressesRequest generates a request for the AssignPrivateIpAddresses operation. @@ -664,7 +693,7 @@ func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstanc return } -// Cancels the specified Reserved Instance listing in the Reserved Instance +// Cancels the specified Reserved instance listing in the Reserved Instance // Marketplace. // // For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) @@ -871,7 +900,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 @@ -924,10 +953,10 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ // individual DHCP options you can specify. For more information about the options, // see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt). // -// domain-name-servers - The IP addresses of up to four domain name servers, +// domain-name-servers - The IP addresses of up to four domain name servers, // or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. // If specifying more than one domain name server, specify the IP addresses -// in a single parameter, separated by commas. domain-name - If you're using +// in a single parameter, separated by commas. domain-name - If you're using // AmazonProvidedDNS in us-east-1, specify ec2.internal. If you're using AmazonProvidedDNS // in another region, specify region.compute.internal (for example, ap-northeast-1.compute.internal). // Otherwise, specify a domain name (for example, MyCompany.com). Important: @@ -935,9 +964,9 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ // However, Windows and other Linux operating systems treat the value as a single // domain, which results in unexpected behavior. If your DHCP options set is // associated with a VPC that has instances with multiple operating systems, -// specify only one domain name. ntp-servers - The IP addresses of up to four -// Network Time Protocol (NTP) servers. netbios-name-servers - The IP addresses -// of up to four NetBIOS name servers. netbios-node-type - The NetBIOS node +// specify only one domain name. ntp-servers - The IP addresses of up to four +// Network Time Protocol (NTP) servers. netbios-name-servers - The IP addresses +// of up to four NetBIOS name servers. netbios-node-type - The NetBIOS node // type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast // are not currently supported). For more information about these node types, // see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt). Your VPC automatically @@ -1283,22 +1312,22 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc return } -// Creates a listing for Amazon EC2 Reserved Instances to be sold in the Reserved -// Instance Marketplace. You can submit one Reserved Instance listing at a time. -// To get a list of your Reserved Instances, you can use the DescribeReservedInstances +// Creates a listing for Amazon EC2 Reserved instances to be sold in the Reserved +// Instance Marketplace. You can submit one Reserved instance listing at a time. +// To get a list of your Reserved instances, you can use the DescribeReservedInstances // operation. // // The Reserved Instance Marketplace matches sellers who want to resell Reserved -// Instance capacity that they no longer need with buyers who want to purchase -// additional capacity. Reserved Instances bought and sold through the Reserved -// Instance Marketplace work like any other Reserved Instances. +// instance capacity that they no longer need with buyers who want to purchase +// additional capacity. Reserved instances bought and sold through the Reserved +// Instance Marketplace work like any other Reserved instances. // -// To sell your Reserved Instances, you must first register as a seller in +// To sell your Reserved instances, you must first register as a seller in // the Reserved Instance Marketplace. After completing the registration process, // you can create a Reserved Instance Marketplace listing of some or all of // your Reserved Instances, and specify the upfront price to receive for them. -// Your Reserved Instance listings then become available for purchase. To view -// the details of your Reserved Instance listing, you can use the DescribeReservedInstancesListings +// Your Reserved instance listings then become available for purchase. To view +// the details of your Reserved instance listing, you can use the DescribeReservedInstancesListings // operation. // // For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) @@ -1598,6 +1627,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) @@ -2899,6 +2931,78 @@ func (c *EC2) DescribeFlowLogs(input *DescribeFlowLogsInput) (*DescribeFlowLogsO return out, err } +const opDescribeHosts = "DescribeHosts" + +// DescribeHostsRequest generates a request for the DescribeHosts operation. +func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Request, output *DescribeHostsOutput) { + op := &request.Operation{ + Name: opDescribeHosts, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeHostsInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeHostsOutput{} + req.Data = output + return +} + +// Describes one or more of your Dedicated hosts. +// +// The results describe only the Dedicated hosts in the region you're currently +// using. All listed instances consume capacity on your Dedicated host. Dedicated +// hosts that have recently been released will be listed with the status "released". +func (c *EC2) DescribeHosts(input *DescribeHostsInput) (*DescribeHostsOutput, error) { + req, out := c.DescribeHostsRequest(input) + err := req.Send() + return out, err +} + +const opDescribeIdFormat = "DescribeIdFormat" + +// DescribeIdFormatRequest generates a request for the DescribeIdFormat operation. +func (c *EC2) DescribeIdFormatRequest(input *DescribeIdFormatInput) (req *request.Request, output *DescribeIdFormatOutput) { + op := &request.Operation{ + Name: opDescribeIdFormat, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeIdFormatInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeIdFormatOutput{} + req.Data = output + return +} + +// Important: This command is reserved for future use, and is currently not +// available for you to use. +// +// Describes the ID format settings for your resources, for example, to view +// which resource types are enabled for longer IDs. This request only returns +// information about resource types whose ID formats can be modified; it does +// not return information about other resource types. +// +// The following resource types support longer IDs: instance | reservation. +// +// These settings apply to the IAM user who makes the request; they do not +// apply to the entire AWS account. By default, an IAM user defaults to the +// same settings as the root user, unless they explicitly override the settings +// by running the ModifyIdFormat command. These settings are applied on a per-region +// basis. +func (c *EC2) DescribeIdFormat(input *DescribeIdFormatInput) (*DescribeIdFormatOutput, error) { + req, out := c.DescribeIdFormatRequest(input) + err := req.Send() + return out, err +} + const opDescribeImageAttribute = "DescribeImageAttribute" // DescribeImageAttributeRequest generates a request for the DescribeImageAttribute operation. @@ -3082,7 +3186,7 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) // and Troubleshooting Instances with Failed Status Checks (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) // in the Amazon Elastic Compute Cloud User Guide. // -// Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, +// Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, // or terminate) for your instances related to hardware issues, software updates, // or system maintenance. For more information, see Scheduled Events for Your // Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) @@ -3100,6 +3204,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 +3254,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) }) @@ -3435,9 +3541,9 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI return } -// Describes one or more of the Reserved Instances that you purchased. +// Describes one or more of the Reserved instances that you purchased. // -// For more information about Reserved Instances, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) +// For more information about Reserved instances, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { req, out := c.DescribeReservedInstancesRequest(input) @@ -3465,22 +3571,22 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn return } -// Describes your account's Reserved Instance listings in the Reserved Instance +// Describes your account's Reserved instance listings in the Reserved Instance // Marketplace. // // The Reserved Instance Marketplace matches sellers who want to resell Reserved -// Instance capacity that they no longer need with buyers who want to purchase -// additional capacity. Reserved Instances bought and sold through the Reserved +// instance capacity that they no longer need with buyers who want to purchase +// additional capacity. Reserved instances bought and sold through the Reserved // Instance Marketplace work like any other Reserved Instances. // -// As a seller, you choose to list some or all of your Reserved Instances, -// and you specify the upfront price to receive for them. Your Reserved Instances +// As a seller, you choose to list some or all of your Reserved instances, +// and you specify the upfront price to receive for them. Your Reserved instances // are then listed in the Reserved Instance Marketplace and are available for // purchase. // -// As a buyer, you specify the configuration of the Reserved Instance to purchase, +// As a buyer, you specify the configuration of the Reserved instance to purchase, // and the Marketplace matches what you're searching for with what's available. -// The Marketplace first sells the lowest priced Reserved Instances to you, +// The Marketplace first sells the lowest priced Reserved instances to you, // and continues to sell available Reserved Instance listings to you until your // demand is met. You are charged based on the total price of all of the listings // that you purchase. @@ -3519,7 +3625,7 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser return } -// Describes the modifications made to your Reserved Instances. If no parameter +// Describes the modifications made to your Reserved instances. If no parameter // is specified, information about all your Reserved Instances modification // requests is returned. If a modification ID is specified, only information // about the specific modification is returned. @@ -3534,6 +3640,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) }) @@ -3565,8 +3672,8 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI return } -// Describes Reserved Instance offerings that are available for purchase. With -// Reserved Instances, you purchase the right to launch instances for a period +// Describes Reserved instance offerings that are available for purchase. With +// Reserved instances, you purchase the right to launch instances for a period // of time. During that time period, you do not receive insufficient capacity // errors, and you pay a lower usage rate than the rate charged for On-Demand // instances for the actual time used. @@ -3581,6 +3688,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 +3805,7 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, - LimitToken: "", + LimitToken: "MaxResults", TruncationToken: "", }, } @@ -3719,13 +3827,13 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ // // The create volume permissions fall into the following categories: // -// public: The owner of the snapshot granted create volume permissions for +// public: The owner of the snapshot granted create volume permissions for // the snapshot to the all group. All AWS accounts have create volume permissions -// for these snapshots. explicit: The owner of the snapshot granted create -// volume permissions to a specific AWS account. implicit: An AWS account has -// implicit create volume permissions for all snapshots it owns. The list of -// snapshots returned can be modified by specifying snapshot IDs, snapshot owners, -// or AWS accounts with create volume permissions. If no options are specified, +// for these snapshots. explicit: The owner of the snapshot granted create volume +// permissions to a specific AWS account. implicit: An AWS account has implicit +// create volume permissions for all snapshots it owns. The list of snapshots +// returned can be modified by specifying snapshot IDs, snapshot owners, or +// AWS accounts with create volume permissions. If no options are specified, // Amazon EC2 returns all snapshots for which you have create volume permissions. // // If you specify one or more snapshot IDs, only snapshots that have the specified @@ -3760,6 +3868,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 +4070,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 +4114,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 +4142,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 +4250,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 +4301,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) }) @@ -5015,6 +5141,76 @@ func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error return out, err } +const opModifyHosts = "ModifyHosts" + +// ModifyHostsRequest generates a request for the ModifyHosts operation. +func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) (req *request.Request, output *ModifyHostsOutput) { + op := &request.Operation{ + Name: opModifyHosts, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyHostsInput{} + } + + req = c.newRequest(op, input, output) + output = &ModifyHostsOutput{} + req.Data = output + return +} + +// Modify the auto-placement setting of a Dedicated host. When auto-placement +// is enabled, AWS will place instances that you launch with a tenancy of host, +// but without targeting a specific host ID, onto any available Dedicated host +// in your account which has auto-placement enabled. When auto-placement is +// disabled, you need to provide a host ID if you want the instance to launch +// onto a specific host. If no host ID is provided, the instance will be launched +// onto a suitable host which has auto-placement enabled. +func (c *EC2) ModifyHosts(input *ModifyHostsInput) (*ModifyHostsOutput, error) { + req, out := c.ModifyHostsRequest(input) + err := req.Send() + return out, err +} + +const opModifyIdFormat = "ModifyIdFormat" + +// ModifyIdFormatRequest generates a request for the ModifyIdFormat operation. +func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Request, output *ModifyIdFormatOutput) { + op := &request.Operation{ + Name: opModifyIdFormat, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyIdFormatInput{} + } + + req = c.newRequest(op, input, output) + output = &ModifyIdFormatOutput{} + req.Data = output + return +} + +// Important: This command is reserved for future use, and is currently not +// available for you to use. +// +// Modifies the ID format for the specified resource. You can specify that +// resources should receive longer IDs (17-character IDs) when they are created. +// The following resource types support longer IDs: instance | reservation. +// +// This setting applies to the IAM user who makes the request; it does not +// apply to the entire AWS account. By default, an IAM user defaults to the +// same settings as the root user, unless they explicitly override the settings +// by running this request. These settings are applied on a per-region basis. +func (c *EC2) ModifyIdFormat(input *ModifyIdFormatInput) (*ModifyIdFormatOutput, error) { + req, out := c.ModifyIdFormatRequest(input) + err := req.Send() + return out, err +} + const opModifyImageAttribute = "ModifyImageAttribute" // ModifyImageAttributeRequest generates a request for the ModifyImageAttribute operation. @@ -5078,6 +5274,51 @@ func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*Mod return out, err } +const opModifyInstancePlacement = "ModifyInstancePlacement" + +// ModifyInstancePlacementRequest generates a request for the ModifyInstancePlacement operation. +func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput) (req *request.Request, output *ModifyInstancePlacementOutput) { + op := &request.Operation{ + Name: opModifyInstancePlacement, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyInstancePlacementInput{} + } + + req = c.newRequest(op, input, output) + output = &ModifyInstancePlacementOutput{} + req.Data = output + return +} + +// Set the instance affinity value for a specific stopped instance and modify +// the instance tenancy setting. +// +// Instance affinity is disabled by default. When instance affinity is host +// and it is not associated with a specific Dedicated host, the next time it +// is launched it will automatically be associated with the host it lands on. +// This relationship will persist if the instance is stopped/started, or rebooted. +// +// You can modify the host ID associated with a stopped instance. If a stopped +// instance has a new host ID association, the instance will target that host +// when restarted. +// +// You can modify the tenancy of a stopped instance with a tenancy of host +// or dedicated. +// +// Affinity, hostID, and tenancy are not required parameters, but at least +// one of them must be specified in the request. Affinity and tenancy can be +// modified in the same request, but tenancy can only be modified on instances +// that are stopped. +func (c *EC2) ModifyInstancePlacement(input *ModifyInstancePlacementInput) (*ModifyInstancePlacementOutput, error) { + req, out := c.ModifyInstancePlacementRequest(input) + err := req.Send() + return out, err +} + const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" // ModifyNetworkInterfaceAttributeRequest generates a request for the ModifyNetworkInterfaceAttribute operation. @@ -5423,14 +5664,14 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn return } -// Purchases a Reserved Instance for use with your account. With Amazon EC2 -// Reserved Instances, you obtain a capacity reservation for a certain instance +// Purchases a Reserved instance for use with your account. With Amazon EC2 +// Reserved instances, you obtain a capacity reservation for a certain instance // configuration over a specified period of time and pay a lower hourly rate -// compared to on-Demand Instance pricing. +// compared to On-Demand Instance pricing. // -// Use DescribeReservedInstancesOfferings to get a list of Reserved Instance +// Use DescribeReservedInstancesOfferings to get a list of Reserved instance // offerings that match your specifications. After you've purchased a Reserved -// Instance, you can check for your new Reserved Instance with DescribeReservedInstances. +// instance, you can check for your new Reserved instance with DescribeReservedInstances. // // For more information, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) // and Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) @@ -5609,6 +5850,44 @@ func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, return out, err } +const opReleaseHosts = "ReleaseHosts" + +// ReleaseHostsRequest generates a request for the ReleaseHosts operation. +func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) (req *request.Request, output *ReleaseHostsOutput) { + op := &request.Operation{ + Name: opReleaseHosts, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ReleaseHostsInput{} + } + + req = c.newRequest(op, input, output) + output = &ReleaseHostsOutput{} + req.Data = output + return +} + +// When you no longer want to use a Dedicated host it can be released. On-Demand +// billing is stopped and the host goes into "released" state. The host ID of +// Dedicated hosts that have been released can no longer be specified in another +// request, e.g., ModifyHosts. You must stop or terminate all instances on a +// host before it can be released. +// +// When Dedicated hosts are released, it make take some time for them to stop +// counting toward your limit and you may receive capacity errors when trying +// to allocate new Dedicated hosts. Try waiting a few minutes, and then try +// again. +// +// Released hosts will still appear in a DescribeHosts response. +func (c *EC2) ReleaseHosts(input *ReleaseHostsInput) (*ReleaseHostsOutput, error) { + req, out := c.ReleaseHostsRequest(input) + err := req.Send() + return out, err +} + const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" // ReplaceNetworkAclAssociationRequest generates a request for the ReplaceNetworkAclAssociation operation. @@ -6204,7 +6483,7 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // from stopped to started, Amazon EC2 charges a full instance hour, even if // transitions happen multiple times within a single hour. // -// You can't start or stop Spot Instances. +// You can't start or stop Spot instances. // // Instances that use Amazon EBS volumes as their root devices can be quickly // stopped and started. When an instance is stopped, the compute resources are @@ -6567,6 +6846,70 @@ func (s AllocateAddressOutput) GoString() string { return s.String() } +type AllocateHostsInput struct { + // This is enabled by default. This property allows instances to be automatically + // placed onto available Dedicated hosts, when you are launching instances without + // specifying a host ID. + // + // Default: Enabled + AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` + + // The Availability Zone for the Dedicated hosts. + AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` + + // Unique, case-sensitive identifier you provide to ensure idempotency of the + // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Specify the instance type that you want your Dedicated hosts to be configured + // for. When you specify the instance type, that is the only instance type that + // you can launch onto that host. + InstanceType *string `locationName:"instanceType" type:"string" required:"true"` + + // The number of Dedicated hosts you want to allocate to your account with these + // parameters. + Quantity *int64 `locationName:"quantity" type:"integer" required:"true"` + + metadataAllocateHostsInput `json:"-" xml:"-"` +} + +type metadataAllocateHostsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AllocateHostsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllocateHostsInput) GoString() string { + return s.String() +} + +type AllocateHostsOutput struct { + // The ID of the allocated Dedicated host. This is used when you want to launch + // an instance onto a specific host. + HostIds []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` + + metadataAllocateHostsOutput `json:"-" xml:"-"` +} + +type metadataAllocateHostsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AllocateHostsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllocateHostsOutput) GoString() string { + return s.String() +} + type AssignPrivateIpAddressesInput struct { // Indicates whether to allow an IP address that is already assigned to another // network interface or instance to be reassigned to the specified network interface. @@ -6626,11 +6969,12 @@ type AssociateAddressInput struct { // [EC2-VPC] The allocation ID. This is required for EC2-VPC. AllocationId *string `type:"string"` - // [EC2-VPC] Allows an Elastic IP address that is already associated with an - // instance or network interface to be re-associated with the specified instance - // or network interface. Otherwise, the operation fails. - // - // Default: false + // [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic + // IP address that is already associated with an instance or network interface + // to be reassociated with the specified instance or network interface. Otherwise, + // the operation fails. In a VPC in an EC2-VPC-only account, reassociation is + // automatic, therefore you can specify false to ensure the operation fails + // if the Elastic IP address is already associated with another resource. AllowReassociation *bool `locationName:"allowReassociation" type:"boolean"` // Checks whether you have the required permissions for the action, without @@ -7294,6 +7638,30 @@ func (s AvailabilityZoneMessage) GoString() string { return s.String() } +type AvailableCapacity struct { + // The total number of instances that the Dedicated host supports. + AvailableInstanceCapacity []*InstanceCapacity `locationName:"availableInstanceCapacity" locationNameList:"item" type:"list"` + + // The number of vCPUs available on the Dedicated host. + AvailableVCpus *int64 `locationName:"availableVCpus" type:"integer"` + + metadataAvailableCapacity `json:"-" xml:"-"` +} + +type metadataAvailableCapacity struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AvailableCapacity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailableCapacity) GoString() string { + return s.String() +} + type BlobAttributeValue struct { Value []byte `locationName:"value" type:"blob"` @@ -7676,7 +8044,7 @@ func (s CancelImportTaskOutput) GoString() string { } type CancelReservedInstancesListingInput struct { - // The ID of the Reserved Instance listing. + // The ID of the Reserved instance listing. ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` metadataCancelReservedInstancesListingInput `json:"-" xml:"-"` @@ -7697,7 +8065,7 @@ func (s CancelReservedInstancesListingInput) GoString() string { } type CancelReservedInstancesListingOutput struct { - // The Reserved Instance listing. + // The Reserved instance listing. ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` metadataCancelReservedInstancesListingOutput `json:"-" xml:"-"` @@ -8889,17 +9257,17 @@ type CreateReservedInstancesListingInput struct { // Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - // The number of instances that are a part of a Reserved Instance account to + // The number of instances that are a part of a Reserved instance account to // be listed in the Reserved Instance Marketplace. This number should be less - // than or equal to the instance count associated with the Reserved Instance + // than or equal to the instance count associated with the Reserved instance // ID specified in this call. InstanceCount *int64 `locationName:"instanceCount" type:"integer" required:"true"` - // A list specifying the price of the Reserved Instance for each month remaining - // in the Reserved Instance term. + // A list specifying the price of the Reserved instance for each month remaining + // in the Reserved instance term. PriceSchedules []*PriceScheduleSpecification `locationName:"priceSchedules" locationNameList:"item" type:"list" required:"true"` - // The ID of the active Reserved Instance. + // The ID of the active Reserved instance. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` metadataCreateReservedInstancesListingInput `json:"-" xml:"-"` @@ -8920,7 +9288,7 @@ func (s CreateReservedInstancesListingInput) GoString() string { } type CreateReservedInstancesListingOutput struct { - // Information about the Reserved Instances listing. + // Information about the Reserved instance listing. ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` metadataCreateReservedInstancesListingOutput `json:"-" xml:"-"` @@ -9061,7 +9429,7 @@ type CreateSecurityGroupInput struct { // // Constraints for EC2-Classic: ASCII characters // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* + // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* Description *string `locationName:"GroupDescription" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without @@ -9076,7 +9444,7 @@ type CreateSecurityGroupInput struct { // // Constraints for EC2-Classic: ASCII characters // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* + // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* GroupName *string `type:"string" required:"true"` // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. @@ -9206,7 +9574,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. @@ -9520,6 +9889,9 @@ type CreateVpcInput struct { // tenancy instances regardless of the tenancy assigned to the instance at launch. // Dedicated tenancy instances run on single-tenant hardware. // + // Important: The host value cannot be used with this parameter. Use the default + // or dedicated values only. + // // Default: default InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` @@ -11568,6 +11940,122 @@ func (s DescribeFlowLogsOutput) GoString() string { return s.String() } +type DescribeHostsInput struct { + // One or more filters. + // + // instance-type - The instance type size that the Dedicated host is configured + // to support. + // + // auto-placement - Whether auto-placement is enabled or disabled (on | off). + // + // host-reservation-id - The ID of the reservation associated with this host. + // + // client-token - The idempotency token you provided when you launched the + // instance + // + // state- The allocation state of the Dedicated host (available | under-assessment + // | permanent-failure | released | released-permanent-failure). + // + // availability-zone - The Availability Zone of the host. + Filter []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` + + // The IDs of the Dedicated hosts. The IDs are used for targeted instance launches. + HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list"` + + // The maximum number of results to return for the request in a single page. + // The remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500; if maxResults is given + // a larger value than 500, you will receive an error. You cannot specify this + // parameter and the host IDs parameter in the same request. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` + + metadataDescribeHostsInput `json:"-" xml:"-"` +} + +type metadataDescribeHostsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeHostsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHostsInput) GoString() string { + return s.String() +} + +type DescribeHostsOutput struct { + // Information about the Dedicated hosts. + Hosts []*Host `locationName:"hostSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + metadataDescribeHostsOutput `json:"-" xml:"-"` +} + +type metadataDescribeHostsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeHostsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHostsOutput) GoString() string { + return s.String() +} + +type DescribeIdFormatInput struct { + // The type of resource. + Resource *string `type:"string"` + + metadataDescribeIdFormatInput `json:"-" xml:"-"` +} + +type metadataDescribeIdFormatInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeIdFormatInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIdFormatInput) GoString() string { + return s.String() +} + +type DescribeIdFormatOutput struct { + // Information about the ID format for the resource. + Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` + + metadataDescribeIdFormatOutput `json:"-" xml:"-"` +} + +type metadataDescribeIdFormatOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeIdFormatOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIdFormatOutput) GoString() string { + return s.String() +} + type DescribeImageAttributeInput struct { // The AMI attribute. // @@ -12228,7 +12716,7 @@ type DescribeInstancesInput struct { // checking is disabled. The value must be false for the instance to perform // network address translation (NAT) in your VPC. // - // spot-instance-request-id - The ID of the Spot Instance request. + // spot-instance-request-id - The ID of the Spot instance request. // // state-reason-code - The reason code for the state change. // @@ -12262,7 +12750,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. // @@ -12376,7 +12864,7 @@ type DescribeInstancesOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // One or more reservations. + // Zero or more reservations. Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"` metadataDescribeInstancesOutput `json:"-" xml:"-"` @@ -13101,21 +13589,21 @@ type DescribeReservedInstancesInput struct { // One or more filters. // - // availability-zone - The Availability Zone where the Reserved Instance + // availability-zone - The Availability Zone where the Reserved instance // can be used. // - // duration - The duration of the Reserved Instance (one year or three years), + // duration - The duration of the Reserved instance (one year or three years), // in seconds (31536000 | 94608000). // - // end - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z). + // end - The time when the Reserved instance expires (for example, 2015-08-07T11:54:42.000Z). // - // fixed-price - The purchase price of the Reserved Instance (for example, + // fixed-price - The purchase price of the Reserved instance (for example, // 9800.0). // - // instance-type - The instance type on which the Reserved Instance can be + // instance-type - The instance type on which the Reserved instance can be // used. // - // product-description - The Reserved Instance product platform description. + // product-description - The Reserved instance product platform description. // Instances that include (Amazon VPC) in the product platform description will // only be displayed to EC2-Classic account holders and are for use with Amazon // VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE Linux (Amazon @@ -13125,12 +13613,12 @@ type DescribeReservedInstancesInput struct { // with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise | Windows // with SQL Server Enterprise (Amazon VPC)). // - // reserved-instances-id - The ID of the Reserved Instance. + // reserved-instances-id - The ID of the Reserved instance. // - // start - The time at which the Reserved Instance purchase request was placed + // start - The time at which the Reserved instance purchase request was placed // (for example, 2014-08-07T11:54:42.000Z). // - // state - The state of the Reserved Instance (payment-pending | active | + // state - The state of the Reserved instance (payment-pending | active | // payment-failed | retired). // // tag:key=value - The key/value combination of a tag assigned to the resource. @@ -13145,18 +13633,18 @@ type DescribeReservedInstancesInput struct { // tag-value - The value of a tag assigned to the resource. This filter is // independent of the tag-key filter. // - // usage-price - The usage price of the Reserved Instance, per hour (for + // usage-price - The usage price of the Reserved instance, per hour (for // example, 0.84). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The Reserved Instance offering type. If you are using tools that predate + // The Reserved instance offering type. If you are using tools that predate // the 2011-11-01 API version, you only have access to the Medium Utilization - // Reserved Instance offering type. + // Reserved instance offering type. OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - // One or more Reserved Instance IDs. + // One or more Reserved instance IDs. // - // Default: Describes all your Reserved Instances, or only those otherwise + // Default: Describes all your Reserved instances, or only those otherwise // specified. ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` @@ -13180,20 +13668,20 @@ func (s DescribeReservedInstancesInput) GoString() string { type DescribeReservedInstancesListingsInput struct { // One or more filters. // - // reserved-instances-id - The ID of the Reserved Instances. + // reserved-instances-id - The ID of the Reserved instances. // - // reserved-instances-listing-id - The ID of the Reserved Instances listing. + // reserved-instances-listing-id - The ID of the Reserved instances listing. // - // status - The status of the Reserved Instance listing (pending | active + // status - The status of the Reserved instance listing (pending | active // | cancelled | closed). // // status-message - The reason for the status. Filters []*Filter `locationName:"filters" locationNameList:"Filter" type:"list"` - // One or more Reserved Instance IDs. + // One or more Reserved instance IDs. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - // One or more Reserved Instance Listing IDs. + // One or more Reserved instance Listing IDs. ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` metadataDescribeReservedInstancesListingsInput `json:"-" xml:"-"` @@ -13214,7 +13702,7 @@ func (s DescribeReservedInstancesListingsInput) GoString() string { } type DescribeReservedInstancesListingsOutput struct { - // Information about the Reserved Instance listing. + // Information about the Reserved instance listing. ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` metadataDescribeReservedInstancesListingsOutput `json:"-" xml:"-"` @@ -13243,27 +13731,27 @@ type DescribeReservedInstancesModificationsInput struct { // // effective-date - The time when the modification becomes effective. // - // modification-result.reserved-instances-id - The ID for the Reserved Instances + // modification-result.reserved-instances-id - The ID for the Reserved instances // created as part of the modification request. This ID is only available when // the status of the modification is fulfilled. // // modification-result.target-configuration.availability-zone - The Availability - // Zone for the new Reserved Instances. + // Zone for the new Reserved instances. // // modification-result.target-configuration.instance-count - The number - // of new Reserved Instances. + // of new Reserved instances. // // modification-result.target-configuration.instance-type - The instance - // type of the new Reserved Instances. + // type of the new Reserved instances. // // modification-result.target-configuration.platform - The network platform - // of the new Reserved Instances (EC2-Classic | EC2-VPC). + // of the new Reserved instances (EC2-Classic | EC2-VPC). // - // reserved-instances-id - The ID of the Reserved Instances modified. + // reserved-instances-id - The ID of the Reserved instances modified. // // reserved-instances-modification-id - The ID of the modification request. // - // status - The status of the Reserved Instances modification request (processing + // status - The status of the Reserved instances modification request (processing // | fulfilled | failed). // // status-message - The reason for the status. @@ -13299,7 +13787,7 @@ type DescribeReservedInstancesModificationsOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // The Reserved Instance modification information. + // The Reserved instance modification information. ReservedInstancesModifications []*ReservedInstancesModification `locationName:"reservedInstancesModificationsSet" locationNameList:"item" type:"list"` metadataDescribeReservedInstancesModificationsOutput `json:"-" xml:"-"` @@ -13320,7 +13808,7 @@ func (s DescribeReservedInstancesModificationsOutput) GoString() string { } type DescribeReservedInstancesOfferingsInput struct { - // The Availability Zone in which the Reserved Instance can be used. + // The Availability Zone in which the Reserved instance can be used. AvailabilityZone *string `type:"string"` // Checks whether you have the required permissions for the action, without @@ -13331,23 +13819,23 @@ type DescribeReservedInstancesOfferingsInput struct { // One or more filters. // - // availability-zone - The Availability Zone where the Reserved Instance + // availability-zone - The Availability Zone where the Reserved instance // can be used. // - // duration - The duration of the Reserved Instance (for example, one year + // duration - The duration of the Reserved instance (for example, one year // or three years), in seconds (31536000 | 94608000). // - // fixed-price - The purchase price of the Reserved Instance (for example, + // fixed-price - The purchase price of the Reserved instance (for example, // 9800.0). // - // instance-type - The instance type on which the Reserved Instance can be + // instance-type - The instance type on which the Reserved instance can be // used. // // marketplace - Set to true to show only Reserved Instance Marketplace offerings. // When this filter is not used, which is the default behavior, all offerings // from AWS and Reserved Instance Marketplace are listed. // - // product-description - The Reserved Instance product platform description. + // product-description - The Reserved instance product platform description. // Instances that include (Amazon VPC) in the product platform description will // only be displayed to EC2-Classic account holders and are for use with Amazon // VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE Linux (Amazon @@ -13357,23 +13845,23 @@ type DescribeReservedInstancesOfferingsInput struct { // with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise | Windows // with SQL Server Enterprise (Amazon VPC)) // - // reserved-instances-offering-id - The Reserved Instances offering ID. + // reserved-instances-offering-id - The Reserved instances offering ID. // - // usage-price - The usage price of the Reserved Instance, per hour (for + // usage-price - The usage price of the Reserved instance, per hour (for // example, 0.84). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // Include Marketplace offerings in the response. + // Include Reserved Instance Marketplace offerings in the response. IncludeMarketplace *bool `type:"boolean"` - // The tenancy of the Reserved Instance offering. A Reserved Instance with dedicated - // tenancy runs on single-tenant hardware and can only be launched within a - // VPC. + // The tenancy of the Reserved instance offering. A Reserved instance with dedicated + // tenancy is applied to instances that run on single-tenant hardware and can + // only be launched within a VPC. // // Default: default InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - // The instance type on which the Reserved Instance can be used. For more information, + // The instance type on which the Reserved instance can be used. For more information, // see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // in the Amazon Elastic Compute Cloud User Guide. InstanceType *string `type:"string" enum:"InstanceType"` @@ -13403,16 +13891,16 @@ type DescribeReservedInstancesOfferingsInput struct { // The token to retrieve the next page of results. NextToken *string `locationName:"nextToken" type:"string"` - // The Reserved Instance offering type. If you are using tools that predate + // The Reserved instance offering type. If you are using tools that predate // the 2011-11-01 API version, you only have access to the Medium Utilization - // Reserved Instance offering type. + // Reserved instance offering type. OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - // The Reserved Instance product platform description. Instances that include + // The Reserved instance product platform description. Instances that include // (Amazon VPC) in the description are for use with Amazon VPC. ProductDescription *string `type:"string" enum:"RIProductDescription"` - // One or more Reserved Instances offering IDs. + // One or more Reserved instances offering IDs. ReservedInstancesOfferingIds []*string `locationName:"ReservedInstancesOfferingId" type:"list"` metadataDescribeReservedInstancesOfferingsInput `json:"-" xml:"-"` @@ -13437,7 +13925,7 @@ type DescribeReservedInstancesOfferingsOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // A list of Reserved Instances offerings. + // A list of Reserved instances offerings. ReservedInstancesOfferings []*ReservedInstancesOffering `locationName:"reservedInstancesOfferingsSet" locationNameList:"item" type:"list"` metadataDescribeReservedInstancesOfferingsOutput `json:"-" xml:"-"` @@ -13458,7 +13946,7 @@ func (s DescribeReservedInstancesOfferingsOutput) GoString() string { } type DescribeReservedInstancesOutput struct { - // A list of Reserved Instances. + // A list of Reserved instances. ReservedInstances []*ReservedInstances `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` metadataDescribeReservedInstancesOutput `json:"-" xml:"-"` @@ -13496,7 +13984,7 @@ type DescribeRouteTablesInput struct { // association.subnet-id - The ID of the subnet involved in the association. // // association.main - Indicates whether the route table is the main route - // table for the VPC. + // table for the VPC (true | false). // // route-table-id - The ID of the route table. // @@ -14153,7 +14641,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 +14779,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) @@ -16675,6 +17163,108 @@ func (s HistoryRecord) GoString() string { return s.String() } +type Host struct { + // Whether auto-placement is on or off. + AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` + + // The Availability Zone of the Dedicated host. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The number of new instances that can be launched onto the Dedicated host. + AvailableCapacity *AvailableCapacity `locationName:"availableCapacity" type:"structure"` + + // Unique, case-sensitive identifier you provide to ensure idempotency of the + // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClientToken *string `locationName:"clientToken" type:"string"` + + // The ID of the Dedicated host. + HostId *string `locationName:"hostId" type:"string"` + + // The hardware specifications of the Dedicated host. + HostProperties *HostProperties `locationName:"hostProperties" type:"structure"` + + // The reservation ID of the Dedicated host. This returns a "null" response + // if the Dedicated host doesn't have an associated reservation. + HostReservationId *string `locationName:"hostReservationId" type:"string"` + + // The IDs and instance type that are currently running on the Dedicated host. + Instances []*HostInstance `locationName:"instances" locationNameList:"item" type:"list"` + + // The Dedicated host's state. Can be "available", "under assessment, or "released". + State *string `locationName:"state" type:"string" enum:"AllocationState"` + + metadataHost `json:"-" xml:"-"` +} + +type metadataHost struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s Host) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Host) GoString() string { + return s.String() +} + +type HostInstance struct { + // the IDs of instances that are running on the Dedicated host. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The instance type size (e.g., m3.medium) of the running instance. + InstanceType *string `locationName:"instanceType" type:"string"` + + metadataHostInstance `json:"-" xml:"-"` +} + +type metadataHostInstance struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s HostInstance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostInstance) GoString() string { + return s.String() +} + +type HostProperties struct { + // The number of cores on the Dedicated host. + Cores *int64 `locationName:"cores" type:"integer"` + + // The instance type size that the Dedicated host supports (e.g., m3.medium). + InstanceType *string `locationName:"instanceType" type:"string"` + + // The number of sockets on the Dedicated host. + Sockets *int64 `locationName:"sockets" type:"integer"` + + // The number of vCPUs on the Dedicated host. + TotalVCpus *int64 `locationName:"totalVCpus" type:"integer"` + + metadataHostProperties `json:"-" xml:"-"` +} + +type metadataHostProperties struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s HostProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostProperties) GoString() string { + return s.String() +} + // Describes an IAM instance profile. type IamInstanceProfile struct { // The Amazon Resource Name (ARN) of the instance profile. @@ -16750,6 +17340,35 @@ func (s IcmpTypeCode) GoString() string { return s.String() } +// Describes the ID format for a resource. +type IdFormat struct { + // The date in UTC at which you are permanently switched over to using longer + // IDs. + Deadline *time.Time `locationName:"deadline" type:"timestamp" timestampFormat:"iso8601"` + + // The type of resource. + Resource *string `locationName:"resource" type:"string"` + + // Indicates whether longer IDs (17-character IDs) are enabled for the resource. + UseLongIds *bool `locationName:"useLongIds" type:"boolean"` + + metadataIdFormat `json:"-" xml:"-"` +} + +type metadataIdFormat struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s IdFormat) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdFormat) GoString() string { + return s.String() +} + // Describes an image. type Image struct { // The architecture of the image. @@ -17491,7 +18110,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 +18123,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. @@ -17513,13 +18132,13 @@ type Instance struct { // The ID of the instance. InstanceId *string `locationName:"instanceId" type:"string"` - // Indicates whether this is a Spot Instance. + // Indicates whether this is a Spot instance. InstanceLifecycle *string `locationName:"instanceLifecycle" type:"string" enum:"InstanceLifecycleType"` // 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 +18154,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 +18162,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 +18201,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 +18216,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 +18225,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:"-"` @@ -17682,12 +18303,39 @@ func (s InstanceBlockDeviceMappingSpecification) GoString() string { return s.String() } -// Describes a Reserved Instance listing state. +type InstanceCapacity struct { + // The number of instances that can still be launched onto the Dedicated host. + AvailableCapacity *int64 `locationName:"availableCapacity" type:"integer"` + + // The instance type size supported by the Dedicated host. + InstanceType *string `locationName:"instanceType" type:"string"` + + // The total number of instances that can be launched onto the Dedicated host. + TotalCapacity *int64 `locationName:"totalCapacity" type:"integer"` + + metadataInstanceCapacity `json:"-" xml:"-"` +} + +type metadataInstanceCapacity struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s InstanceCapacity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceCapacity) GoString() string { + return s.String() +} + +// Describes a Reserved instance listing state. type InstanceCount struct { - // The number of listed Reserved Instances in the state specified by the state. + // The number of listed Reserved instances in the state specified by the state. InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - // The states of the listed Reserved Instances. + // The states of the listed Reserved instances. State *string `locationName:"state" type:"string" enum:"ListingState"` metadataInstanceCount `json:"-" xml:"-"` @@ -18449,6 +19097,97 @@ func (s LaunchSpecification) GoString() string { return s.String() } +type ModifyHostsInput struct { + // Specify whether to enable or disable auto-placement. + AutoPlacement *string `locationName:"autoPlacement" type:"string" required:"true" enum:"AutoPlacement"` + + // The host IDs of the Dedicated hosts you want to modify. + HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` + + metadataModifyHostsInput `json:"-" xml:"-"` +} + +type metadataModifyHostsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyHostsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyHostsInput) GoString() string { + return s.String() +} + +type ModifyHostsOutput struct { + // The IDs of the Dedicated hosts that were successfully modified. + Successful []*string `locationName:"successful" locationNameList:"item" type:"list"` + + // The IDs of the Dedicated hosts that could not be modified. Check whether + // the setting you requested can be used. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + + metadataModifyHostsOutput `json:"-" xml:"-"` +} + +type metadataModifyHostsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyHostsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyHostsOutput) GoString() string { + return s.String() +} + +type ModifyIdFormatInput struct { + // The type of resource. + Resource *string `type:"string" required:"true"` + + // Indicate whether the resource should use longer IDs (17-character IDs). + UseLongIds *bool `type:"boolean" required:"true"` + + metadataModifyIdFormatInput `json:"-" xml:"-"` +} + +type metadataModifyIdFormatInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyIdFormatInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyIdFormatInput) GoString() string { + return s.String() +} + +type ModifyIdFormatOutput struct { + metadataModifyIdFormatOutput `json:"-" xml:"-"` +} + +type metadataModifyIdFormatOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyIdFormatOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyIdFormatOutput) GoString() string { + return s.String() +} + type ModifyImageAttributeInput struct { // The name of the attribute to modify. Attribute *string `type:"string"` @@ -18637,6 +19376,57 @@ func (s ModifyInstanceAttributeOutput) GoString() string { return s.String() } +type ModifyInstancePlacementInput struct { + // The new affinity setting for the instance. + Affinity *string `locationName:"affinity" type:"string" enum:"Affinity"` + + // The ID of the Dedicated host that the instance will have affinity with. + HostId *string `locationName:"hostId" type:"string"` + + // The ID of the instance that you are modifying. + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + + // The tenancy of the instance that you are modifying. + Tenancy *string `locationName:"tenancy" type:"string" enum:"HostTenancy"` + + metadataModifyInstancePlacementInput `json:"-" xml:"-"` +} + +type metadataModifyInstancePlacementInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyInstancePlacementInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstancePlacementInput) GoString() string { + return s.String() +} + +type ModifyInstancePlacementOutput struct { + // Is true if the request succeeds, and an error otherwise. + Return *bool `locationName:"return" type:"boolean"` + + metadataModifyInstancePlacementOutput `json:"-" xml:"-"` +} + +type metadataModifyInstancePlacementOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyInstancePlacementOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstancePlacementOutput) GoString() string { + return s.String() +} + type ModifyNetworkInterfaceAttributeInput struct { // Information about the interface attachment. If modifying the 'delete on termination' // attribute, you must specify the ID of the interface attachment. @@ -18707,10 +19497,10 @@ type ModifyReservedInstancesInput struct { // modification request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string"` - // The IDs of the Reserved Instances to modify. + // The IDs of the Reserved instances to modify. ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` - // The configuration settings for the Reserved Instances to modify. + // The configuration settings for the Reserved instances to modify. TargetConfigurations []*ReservedInstancesConfiguration `locationName:"ReservedInstancesConfigurationSetItemType" locationNameList:"item" type:"list" required:"true"` metadataModifyReservedInstancesInput `json:"-" xml:"-"` @@ -18960,7 +19750,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 +19760,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. @@ -19555,14 +20350,23 @@ func (s NewDhcpConfiguration) GoString() string { // Describes the placement for the instance. type Placement struct { + // The affinity setting for the instance on the Dedicated host. This parameter + // is not supported for the ImportInstance command. + Affinity *string `locationName:"affinity" type:"string"` + // The Availability Zone of the instance. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` // The name of the placement group the instance is in (for cluster compute instances). GroupName *string `locationName:"groupName" type:"string"` + // The ID of the Dedicted host on which the instance resides. This parameter + // is not support for the ImportInstance command. + HostId *string `locationName:"hostId" type:"string"` + // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. + // with a tenancy of dedicated runs on single-tenant hardware. The host tenancy + // is not supported for the ImportInstance command. Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` metadataPlacement `json:"-" xml:"-"` @@ -19685,7 +20489,7 @@ func (s PrefixListId) GoString() string { return s.String() } -// Describes the price for a Reserved Instance. +// Describes the price for a Reserved instance. type PriceSchedule struct { // The current price schedule, as determined by the term remaining for the Reserved // Instance in the listing. @@ -19699,7 +20503,7 @@ type PriceSchedule struct { // be active for months 2 and 1. Active *bool `locationName:"active" type:"boolean"` - // The currency for transacting the Reserved Instance resale. At this time, + // The currency for transacting the Reserved instance resale. At this time, // the only supported currency is USD. CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` @@ -19727,9 +20531,9 @@ func (s PriceSchedule) GoString() string { return s.String() } -// Describes the price for a Reserved Instance. +// Describes the price for a Reserved instance. type PriceScheduleSpecification struct { - // The currency for transacting the Reserved Instance resale. At this time, + // The currency for transacting the Reserved instance resale. At this time, // the only supported currency is USD. CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` @@ -19757,7 +20561,7 @@ func (s PriceScheduleSpecification) GoString() string { return s.String() } -// Describes a Reserved Instance offering. +// Describes a Reserved instance offering. type PricingDetail struct { // The number of instances available for the price. Count *int64 `locationName:"count" type:"integer"` @@ -19862,15 +20666,15 @@ type PurchaseReservedInstancesOfferingInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The number of Reserved Instances to purchase. + // The number of Reserved instances to purchase. InstanceCount *int64 `type:"integer" required:"true"` // Specified for Reserved Instance Marketplace offerings to limit the total - // order and ensure that the Reserved Instances are not purchased at unexpected + // order and ensure that the Reserved instances are not purchased at unexpected // prices. LimitPrice *ReservedInstanceLimitPrice `locationName:"limitPrice" type:"structure"` - // The ID of the Reserved Instance offering to purchase. + // The ID of the Reserved instance offering to purchase. ReservedInstancesOfferingId *string `type:"string" required:"true"` metadataPurchaseReservedInstancesOfferingInput `json:"-" xml:"-"` @@ -19891,7 +20695,7 @@ func (s PurchaseReservedInstancesOfferingInput) GoString() string { } type PurchaseReservedInstancesOfferingOutput struct { - // The IDs of the purchased Reserved Instances. + // The IDs of the purchased Reserved instances. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` metadataPurchaseReservedInstancesOfferingOutput `json:"-" xml:"-"` @@ -20192,6 +20996,52 @@ func (s ReleaseAddressOutput) GoString() string { return s.String() } +type ReleaseHostsInput struct { + // The IDs of the Dedicated hosts you want to release. + HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` + + metadataReleaseHostsInput `json:"-" xml:"-"` +} + +type metadataReleaseHostsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ReleaseHostsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReleaseHostsInput) GoString() string { + return s.String() +} + +type ReleaseHostsOutput struct { + // The IDs of the Dedicated hosts that were successfully released. + Successful []*string `locationName:"successful" locationNameList:"item" type:"list"` + + // The IDs of the Dedicated hosts that could not be released, including an error + // message. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + + metadataReleaseHostsOutput `json:"-" xml:"-"` +} + +type metadataReleaseHostsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ReleaseHostsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReleaseHostsOutput) GoString() string { + return s.String() +} + type ReplaceNetworkAclAssociationInput struct { // The ID of the current association between the original network ACL and the // subnet. @@ -20589,7 +21439,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 @@ -20788,7 +21638,7 @@ func (s Reservation) GoString() string { return s.String() } -// Describes the limit price of a Reserved Instance offering. +// Describes the limit price of a Reserved instance offering. type ReservedInstanceLimitPrice struct { // Used for Reserved Instance Marketplace offerings. Specifies the limit price // on the total order (instanceCount * price). @@ -20815,55 +21665,55 @@ func (s ReservedInstanceLimitPrice) GoString() string { return s.String() } -// Describes a Reserved Instance. +// Describes a Reserved instance. type ReservedInstances struct { - // The Availability Zone in which the Reserved Instance can be used. + // The Availability Zone in which the Reserved instance can be used. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - // The currency of the Reserved Instance. It's specified using ISO 4217 standard + // The currency of the Reserved instance. It's specified using ISO 4217 standard // currency codes. At this time, the only supported currency is USD. CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - // The duration of the Reserved Instance, in seconds. + // The duration of the Reserved instance, in seconds. Duration *int64 `locationName:"duration" type:"long"` - // The time when the Reserved Instance expires. + // The time when the Reserved instance expires. End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"` - // The purchase price of the Reserved Instance. + // The purchase price of the Reserved instance. FixedPrice *float64 `locationName:"fixedPrice" type:"float"` - // The number of Reserved Instances purchased. + // The number of Reserved instances purchased. InstanceCount *int64 `locationName:"instanceCount" type:"integer"` // The tenancy of the reserved instance. InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - // The instance type on which the Reserved Instance can be used. + // The instance type on which the Reserved instance can be used. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - // The Reserved Instance offering type. + // The Reserved instance offering type. OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - // The Reserved Instance product platform description. + // The Reserved instance product platform description. ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` // The recurring charge tag assigned to the resource. RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` - // The ID of the Reserved Instance. + // The ID of the Reserved instance. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - // The date and time the Reserved Instance started. + // The date and time the Reserved instance started. Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` - // The state of the Reserved Instance purchase. + // The state of the Reserved instance purchase. State *string `locationName:"state" type:"string" enum:"ReservedInstanceState"` // Any tags assigned to the resource. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The usage price of the Reserved Instance, per hour. + // The usage price of the Reserved instance, per hour. UsagePrice *float64 `locationName:"usagePrice" type:"float"` metadataReservedInstances `json:"-" xml:"-"` @@ -20883,18 +21733,18 @@ func (s ReservedInstances) GoString() string { return s.String() } -// Describes the configuration settings for the modified Reserved Instances. +// Describes the configuration settings for the modified Reserved instances. type ReservedInstancesConfiguration struct { - // The Availability Zone for the modified Reserved Instances. + // The Availability Zone for the modified Reserved instances. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - // The number of modified Reserved Instances. + // The number of modified Reserved instances. InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - // The instance type for the modified Reserved Instances. + // The instance type for the modified Reserved instances. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - // The network platform of the modified Reserved Instances, which is either + // The network platform of the modified Reserved instances, which is either // EC2-Classic or EC2-VPC. Platform *string `locationName:"platform" type:"string"` @@ -20915,9 +21765,9 @@ func (s ReservedInstancesConfiguration) GoString() string { return s.String() } -// Describes the ID of a Reserved Instance. +// Describes the ID of a Reserved instance. type ReservedInstancesId struct { - // The ID of the Reserved Instance. + // The ID of the Reserved instance. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` metadataReservedInstancesId `json:"-" xml:"-"` @@ -20937,7 +21787,7 @@ func (s ReservedInstancesId) GoString() string { return s.String() } -// Describes a Reserved Instance listing. +// Describes a Reserved instance listing. type ReservedInstancesListing struct { // A unique, case-sensitive key supplied by the client to ensure that the request // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). @@ -20949,19 +21799,19 @@ type ReservedInstancesListing struct { // The number of instances in this state. InstanceCounts []*InstanceCount `locationName:"instanceCounts" locationNameList:"item" type:"list"` - // The price of the Reserved Instance listing. + // The price of the Reserved instance listing. PriceSchedules []*PriceSchedule `locationName:"priceSchedules" locationNameList:"item" type:"list"` - // The ID of the Reserved Instance. + // The ID of the Reserved instance. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - // The ID of the Reserved Instance listing. + // The ID of the Reserved instance listing. ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` - // The status of the Reserved Instance listing. + // The status of the Reserved instance listing. Status *string `locationName:"status" type:"string" enum:"ListingStatus"` - // The reason for the current status of the Reserved Instance listing. The response + // The reason for the current status of the Reserved instance listing. The response // can be blank. StatusMessage *string `locationName:"statusMessage" type:"string"` @@ -20988,7 +21838,7 @@ func (s ReservedInstancesListing) GoString() string { return s.String() } -// Describes a Reserved Instance modification. +// Describes a Reserved instance modification. type ReservedInstancesModification struct { // A unique, case-sensitive key supplied by the client to ensure that the request // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). @@ -21001,16 +21851,16 @@ type ReservedInstancesModification struct { EffectiveDate *time.Time `locationName:"effectiveDate" type:"timestamp" timestampFormat:"iso8601"` // Contains target configurations along with their corresponding new Reserved - // Instance IDs. + // instance IDs. ModificationResults []*ReservedInstancesModificationResult `locationName:"modificationResultSet" locationNameList:"item" type:"list"` - // The IDs of one or more Reserved Instances. + // The IDs of one or more Reserved instances. ReservedInstancesIds []*ReservedInstancesId `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` - // A unique ID for the Reserved Instance modification. + // A unique ID for the Reserved instance modification. ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` - // The status of the Reserved Instances modification request. + // The status of the Reserved instances modification request. Status *string `locationName:"status" type:"string"` // The reason for the status. @@ -21037,11 +21887,11 @@ func (s ReservedInstancesModification) GoString() string { } type ReservedInstancesModificationResult struct { - // The ID for the Reserved Instances that were created as part of the modification + // The ID for the Reserved instances that were created as part of the modification // request. This field is only available when the modification is fulfilled. ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - // The target Reserved Instances configurations supplied as part of the modification + // The target Reserved instances configurations supplied as part of the modification // request. TargetConfiguration *ReservedInstancesConfiguration `locationName:"targetConfiguration" type:"structure"` @@ -21062,26 +21912,26 @@ func (s ReservedInstancesModificationResult) GoString() string { return s.String() } -// Describes a Reserved Instance offering. +// Describes a Reserved instance offering. type ReservedInstancesOffering struct { - // The Availability Zone in which the Reserved Instance can be used. + // The Availability Zone in which the Reserved instance can be used. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - // The currency of the Reserved Instance offering you are purchasing. It's specified + // The currency of the Reserved instance offering you are purchasing. It's specified // using ISO 4217 standard currency codes. At this time, the only supported // currency is USD. CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - // The duration of the Reserved Instance, in seconds. + // The duration of the Reserved instance, in seconds. Duration *int64 `locationName:"duration" type:"long"` - // The purchase price of the Reserved Instance. + // The purchase price of the Reserved instance. FixedPrice *float64 `locationName:"fixedPrice" type:"float"` // The tenancy of the reserved instance. InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - // The instance type on which the Reserved Instance can be used. + // The instance type on which the Reserved instance can be used. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // Indicates whether the offering is available through the Reserved Instance @@ -21089,22 +21939,22 @@ type ReservedInstancesOffering struct { // this is true. Marketplace *bool `locationName:"marketplace" type:"boolean"` - // The Reserved Instance offering type. + // The Reserved instance offering type. OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - // The pricing details of the Reserved Instance offering. + // The pricing details of the Reserved instance offering. PricingDetails []*PricingDetail `locationName:"pricingDetailsSet" locationNameList:"item" type:"list"` - // The Reserved Instance product platform description. + // The Reserved instance product platform description. ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` // The recurring charge tag assigned to the resource. RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` - // The ID of the Reserved Instance offering. + // The ID of the Reserved instance offering. ReservedInstancesOfferingId *string `locationName:"reservedInstancesOfferingId" type:"string"` - // The usage price of the Reserved Instance, per hour. + // The usage price of the Reserved instance, per hour. UsagePrice *float64 `locationName:"usagePrice" type:"float"` metadataReservedInstancesOffering `json:"-" xml:"-"` @@ -21550,9 +22400,9 @@ type Route struct { // Describes how the route was created. // - // CreateRouteTable indicates that route was automatically created when the - // route table was created. CreateRoute indicates that the route was manually - // added to the route table. EnableVgwRoutePropagation indicates that the route + // CreateRouteTable indicates that route was automatically created when the + // route table was created. CreateRoute indicates that the route was manually + // added to the route table. EnableVgwRoutePropagation indicates that the route // was propagated by route propagation. Origin *string `locationName:"origin" type:"string" enum:"RouteOrigin"` @@ -22348,8 +23198,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 +23207,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 +23310,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. @@ -22605,7 +23456,7 @@ type StateReason struct { // The message for the state change. // - // Server.SpotInstanceTermination: A Spot Instance was terminated due to an + // Server.SpotInstanceTermination: A Spot instance was terminated due to an // increase in the market price. // // Server.InternalError: An internal error occurred during instance launch, @@ -23830,6 +24681,26 @@ const ( AccountAttributeNameDefaultVpc = "default-vpc" ) +const ( + // @enum Affinity + AffinityDefault = "default" + // @enum Affinity + AffinityHost = "host" +) + +const ( + // @enum AllocationState + AllocationStateAvailable = "available" + // @enum AllocationState + AllocationStateUnderAssessment = "under-assessment" + // @enum AllocationState + AllocationStatePermanentFailure = "permanent-failure" + // @enum AllocationState + AllocationStateReleased = "released" + // @enum AllocationState + AllocationStateReleasedPermanentFailure = "released-permanent-failure" +) + const ( // @enum AllocationStrategy AllocationStrategyLowestPrice = "lowestPrice" @@ -23855,6 +24726,13 @@ const ( AttachmentStatusDetached = "detached" ) +const ( + // @enum AutoPlacement + AutoPlacementOn = "on" + // @enum AutoPlacement + AutoPlacementOff = "off" +) + const ( // @enum AvailabilityZoneState AvailabilityZoneStateAvailable = "available" @@ -24038,6 +24916,13 @@ const ( GatewayTypeIpsec1 = "ipsec.1" ) +const ( + // @enum HostTenancy + HostTenancyDedicated = "dedicated" + // @enum HostTenancy + HostTenancyHost = "host" +) + const ( // @enum HypervisorType HypervisorTypeOvm = "ovm" @@ -24594,6 +25479,8 @@ const ( TenancyDefault = "default" // @enum Tenancy TenancyDedicated = "dedicated" + // @enum Tenancy + TenancyHost = "host" ) const ( 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/ec2iface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go index 88a209d1608..1625ad591fa 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 @@ -18,6 +18,10 @@ type EC2API interface { AllocateAddress(*ec2.AllocateAddressInput) (*ec2.AllocateAddressOutput, error) + AllocateHostsRequest(*ec2.AllocateHostsInput) (*request.Request, *ec2.AllocateHostsOutput) + + AllocateHosts(*ec2.AllocateHostsInput) (*ec2.AllocateHostsOutput, error) + AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput) AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) @@ -346,6 +350,14 @@ type EC2API interface { DescribeFlowLogs(*ec2.DescribeFlowLogsInput) (*ec2.DescribeFlowLogsOutput, error) + DescribeHostsRequest(*ec2.DescribeHostsInput) (*request.Request, *ec2.DescribeHostsOutput) + + DescribeHosts(*ec2.DescribeHostsInput) (*ec2.DescribeHostsOutput, error) + + DescribeIdFormatRequest(*ec2.DescribeIdFormatInput) (*request.Request, *ec2.DescribeIdFormatOutput) + + DescribeIdFormat(*ec2.DescribeIdFormatInput) (*ec2.DescribeIdFormatOutput, error) + DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput) DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error) @@ -486,6 +498,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) @@ -610,6 +624,14 @@ type EC2API interface { ImportVolume(*ec2.ImportVolumeInput) (*ec2.ImportVolumeOutput, error) + ModifyHostsRequest(*ec2.ModifyHostsInput) (*request.Request, *ec2.ModifyHostsOutput) + + ModifyHosts(*ec2.ModifyHostsInput) (*ec2.ModifyHostsOutput, error) + + ModifyIdFormatRequest(*ec2.ModifyIdFormatInput) (*request.Request, *ec2.ModifyIdFormatOutput) + + ModifyIdFormat(*ec2.ModifyIdFormatInput) (*ec2.ModifyIdFormatOutput, error) + ModifyImageAttributeRequest(*ec2.ModifyImageAttributeInput) (*request.Request, *ec2.ModifyImageAttributeOutput) ModifyImageAttribute(*ec2.ModifyImageAttributeInput) (*ec2.ModifyImageAttributeOutput, error) @@ -618,6 +640,10 @@ type EC2API interface { ModifyInstanceAttribute(*ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error) + ModifyInstancePlacementRequest(*ec2.ModifyInstancePlacementInput) (*request.Request, *ec2.ModifyInstancePlacementOutput) + + ModifyInstancePlacement(*ec2.ModifyInstancePlacementInput) (*ec2.ModifyInstancePlacementOutput, error) + ModifyNetworkInterfaceAttributeRequest(*ec2.ModifyNetworkInterfaceAttributeInput) (*request.Request, *ec2.ModifyNetworkInterfaceAttributeOutput) ModifyNetworkInterfaceAttribute(*ec2.ModifyNetworkInterfaceAttributeInput) (*ec2.ModifyNetworkInterfaceAttributeOutput, error) @@ -678,6 +704,10 @@ type EC2API interface { ReleaseAddress(*ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) + ReleaseHostsRequest(*ec2.ReleaseHostsInput) (*request.Request, *ec2.ReleaseHostsOutput) + + ReleaseHosts(*ec2.ReleaseHostsInput) (*ec2.ReleaseHostsOutput, error) + ReplaceNetworkAclAssociationRequest(*ec2.ReplaceNetworkAclAssociationInput) (*request.Request, *ec2.ReplaceNetworkAclAssociationOutput) ReplaceNetworkAclAssociation(*ec2.ReplaceNetworkAclAssociationInput) (*ec2.ReplaceNetworkAclAssociationOutput, error) @@ -758,3 +788,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/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/aws/aws-sdk-go/service/elb/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go index 14126085b6a..76803cfc0b9 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go @@ -472,10 +472,12 @@ func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) return } -// Describes the state of the specified instances registered with the specified +// Describes the state of the specified instances with respect to the specified // load balancer. If no instances are specified, the call describes the state -// of all instances registered with the load balancer, not including any terminated -// instances. +// of all instances that are currently registered with the load balancer. If +// instances are specified, their state is returned even if they are no longer +// registered with the load balancer. The state of terminated instances is not +// returned. func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*DescribeInstanceHealthOutput, error) { req, out := c.DescribeInstanceHealthRequest(input) err := req.Send() @@ -609,6 +611,7 @@ func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*Describ func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(p *DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeLoadBalancersRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeLoadBalancersOutput), lastPage) }) @@ -814,8 +817,9 @@ func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesW // with the load balancer in the VPC. // // Note that RegisterInstanceWithLoadBalancer completes when the request has -// been registered. Instance registration happens shortly afterwards. To check -// the state of the registered instances, use DescribeLoadBalancers or DescribeInstanceHealth. +// been registered. Instance registration takes a little time to complete. To +// check the state of the registered instances, use DescribeLoadBalancers or +// DescribeInstanceHealth. // // After the instance is registered, it starts receiving traffic and requests // from the load balancer. Any instance that is not in one of the Availability @@ -1310,8 +1314,9 @@ type CreateAppCookieStickinessPolicyInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` - // The name of the policy being created. This name must be unique within the - // set of policies for this load balancer. + // The name of the policy being created. Policy names must consist of alphanumeric + // characters and dashes (-). This name must be unique within the set of policies + // for this load balancer. PolicyName *string `type:"string" required:"true"` metadataCreateAppCookieStickinessPolicyInput `json:"-" xml:"-"` @@ -1358,8 +1363,9 @@ type CreateLBCookieStickinessPolicyInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` - // The name of the policy being created. This name must be unique within the - // set of policies for this load balancer. + // The name of the policy being created. Policy names must consist of alphanumeric + // characters and dashes (-). This name must be unique within the set of policies + // for this load balancer. PolicyName *string `type:"string" required:"true"` metadataCreateLBCookieStickinessPolicyInput `json:"-" xml:"-"` @@ -1415,9 +1421,9 @@ type CreateLoadBalancerInput struct { // The name of the load balancer. // - // This name must be unique within your AWS account, must have a maximum of - // 32 characters, must contain only alphanumeric characters or hyphens, and - // cannot begin or end with a hyphen. + // This name must be unique within your set of load balancers for the region, + // must have a maximum of 32 characters, must contain only alphanumeric characters + // or hyphens, and cannot begin or end with a hyphen. LoadBalancerName *string `type:"string" required:"true"` // The type of a load balancer. Valid only for load balancers in a VPC. @@ -2364,8 +2370,9 @@ type Listener struct { // is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP. InstanceProtocol *string `type:"string"` - // The port on which the load balancer is listening. The supported ports are: - // 25, 80, 443, 465, 587, and 1024-65535. + // The port on which the load balancer is listening. On EC2-VPC, you can specify + // any port from the range 1-65535. On EC2-Classic, you can specify any port + // from the following list: 25, 80, 443, 465, 587, 1024-65535. LoadBalancerPort *int64 `type:"integer" required:"true"` // The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go index a1b4214745e..5674133f71e 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go @@ -124,3 +124,5 @@ type ELBAPI interface { SetLoadBalancerPoliciesOfListener(*elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error) } + +var _ ELBAPI = (*elb.ELB)(nil) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go index e9908006e00..428fea0aca4 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go @@ -4,10 +4,9 @@ package elb 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" ) @@ -25,40 +24,64 @@ import ( // All Elastic Load Balancing operations are idempotent, which means that they // complete at most one time. If you repeat an operation, it succeeds with a // 200 OK response code. +//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 ELB 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 ELB client. -func New(config *aws.Config) *ELB { - service := &service.Service{ - ServiceInfo: serviceinfo.ServiceInfo{ - Config: defaults.DefaultConfig.Merge(config), - ServiceName: "elasticloadbalancing", - APIVersion: "2012-06-01", - }, +// A ServiceName is the name of the service the client will make API calls to. +const ServiceName = "elasticloadbalancing" + +// New creates a new instance of the ELB 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 ELB client from just a session. +// svc := elb.New(mySession) +// +// // Create a ELB client with additional configuration +// svc := elb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELB { + 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) *ELB { + svc := &ELB{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2012-06-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 &ELB{service} + return svc } // newRequest creates a new request for a ELB operation and runs any diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/waiters.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/waiters.go new file mode 100644 index 00000000000..5d5755d049a --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/waiters.go @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package elb + +import ( + "github.com/aws/aws-sdk-go/private/waiter" +) + +func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstanceHealth", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAny", + Argument: "InstanceStates[].State", + Expected: "InService", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstanceHealth", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "InstanceStates[].State", + Expected: "InService", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini/LICENSE b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini/LICENSE new file mode 100644 index 00000000000..37ec93a14fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/vendor/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/aws/aws-sdk-go/vendor/github.com/jmespath/go-jmespath/LICENSE b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/vendor/github.com/jmespath/go-jmespath/LICENSE new file mode 100644 index 00000000000..b03310a91fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/vendor/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/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..0652fb7339c --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/README.md @@ -0,0 +1,578 @@ +ini [![Build Status](https://drone.io/github.com/go-ini/ini/status.png)](https://drone.io/github.com/go-ini/ini/latest) [![](http://gocover.io/_badge/github.com/go-ini/ini)](http://gocover.io/github.com/go-ini/ini) +=== + +![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200) + +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 check if a key exists: + +```go +yes := cfg.Section("").HasKey("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 +}) +``` + +If you do not want any auto-transformation (such as recursive read) for the values, you can get raw value directly (this way you get much better performance): + +```go +val := cfg.Section("").Key("key name").Value() +``` + +To check if raw value exists: + +```go +yes := cfg.Section("").HasValue("test value") +``` + +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..27fdb32fee0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md @@ -0,0 +1,565 @@ +本包提供了 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 +yes := cfg.Section("").HasKey("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 +val := cfg.Section("").Key("key name").Value() +``` + +判断某个原值是否存在: + +```go +yes := cfg.Section("").HasValue("test value") +``` + +获取其它类型的值: + +```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..8b09ad3644f --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/ini.go @@ -0,0 +1,1247 @@ +// 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.7.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 +} + +// HasKey returns true if section contains a key with given name. +func (s *Section) Haskey(name string) bool { + key, _ := s.GetKey(name) + return key != nil +} + +// HasKey returns true if section contains given raw value. +func (s *Section) HasValue(value string) bool { + if s.f.BlockMode { + s.f.lock.RLock() + defer s.f.lock.RUnlock() + } + + for _, k := range s.keys { + if value == k.value { + return true + } + } + return false +} + +// 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/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/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 + +[![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](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/cmd/jpgo/main.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/cmd/jpgo/main.go new file mode 100644 index 00000000000..1c53cfc86e7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/cmd/jpgo/main.go @@ -0,0 +1,96 @@ +/*Basic command line interface for debug and testing purposes. + +Examples: + +Only print the AST for the expression: + + jp.go -ast "foo.bar.baz" + +Evaluate the JMESPath expression against JSON data from a file: + + jp.go -input /tmp/data.json "foo.bar.baz" + +This program can also be used as an executable to the jp-compliance +runner (github.com/jmespath/jmespath.test). + +*/ +package main + +import ( + "flag" + "fmt" + "io/ioutil" + "os" +) + +import ( + "encoding/json" + + "github.com/jmespath/go-jmespath" +) + +func errMsg(msg string, a ...interface{}) int { + fmt.Fprintf(os.Stderr, msg, a...) + fmt.Fprintln(os.Stderr) + return 1 +} + +func run() int { + + astOnly := flag.Bool("ast", false, "Print the AST for the input expression and exit.") + inputFile := flag.String("input", "", "Filename containing JSON data to search. If not provided, data is read from stdin.") + + flag.Parse() + args := flag.Args() + if len(args) != 1 { + fmt.Fprintf(os.Stderr, "Usage:\n\n") + flag.PrintDefaults() + return errMsg("\nError: expected a single argument (the JMESPath expression).") + } + + expression := args[0] + parser := jmespath.NewParser() + parsed, err := parser.Parse(expression) + if err != nil { + if syntaxError, ok := err.(jmespath.SyntaxError); ok { + return errMsg("%s\n%s\n", syntaxError, syntaxError.HighlightLocation()) + } + return errMsg("%s", err) + } + if *astOnly { + fmt.Println("") + fmt.Printf("%s\n", parsed) + return 0 + } + + var inputData []byte + if *inputFile != "" { + inputData, err = ioutil.ReadFile(*inputFile) + if err != nil { + return errMsg("Error loading file %s: %s", *inputFile, err) + } + } else { + // If an input data file is not provided then we read the + // data from stdin. + inputData, err = ioutil.ReadAll(os.Stdin) + if err != nil { + return errMsg("Error reading from stdin: %s", err) + } + } + var data interface{} + json.Unmarshal(inputData, &data) + result, err := jmespath.Search(expression, data) + if err != nil { + return errMsg("Error executing expression: %s", err) + } + toJSON, err := json.MarshalIndent(result, "", " ") + if err != nil { + return errMsg("Error serializing result to JSON: %s", err) + } + fmt.Println(string(toJSON)) + return 0 +} + +func main() { + os.Exit(run()) +} 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/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/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/parser.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser.go new file mode 100644 index 00000000000..c8f4bcebd87 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser.go @@ -0,0 +1,603 @@ +package jmespath + +import ( + "encoding/json" + "fmt" + "strconv" + "strings" +) + +type astNodeType int + +//go:generate stringer -type astNodeType +const ( + ASTEmpty astNodeType = iota + ASTComparator + ASTCurrentNode + ASTExpRef + ASTFunctionExpression + ASTField + ASTFilterProjection + ASTFlatten + ASTIdentity + ASTIndex + ASTIndexExpression + ASTKeyValPair + ASTLiteral + ASTMultiSelectHash + ASTMultiSelectList + ASTOrExpression + ASTAndExpression + ASTNotExpression + ASTPipe + ASTProjection + ASTSubexpression + ASTSlice + ASTValueProjection +) + +// ASTNode represents the abstract syntax tree of a JMESPath expression. +type ASTNode struct { + nodeType astNodeType + value interface{} + children []ASTNode +} + +func (node ASTNode) String() string { + return node.PrettyPrint(0) +} + +// PrettyPrint will pretty print the parsed AST. +// The AST is an implementation detail and this pretty print +// function is provided as a convenience method to help with +// debugging. You should not rely on its output as the internal +// structure of the AST may change at any time. +func (node ASTNode) PrettyPrint(indent int) string { + spaces := strings.Repeat(" ", indent) + output := fmt.Sprintf("%s%s {\n", spaces, node.nodeType) + nextIndent := indent + 2 + if node.value != nil { + if converted, ok := node.value.(fmt.Stringer); ok { + // Account for things like comparator nodes + // that are enums with a String() method. + output += fmt.Sprintf("%svalue: %s\n", strings.Repeat(" ", nextIndent), converted.String()) + } else { + output += fmt.Sprintf("%svalue: %#v\n", strings.Repeat(" ", nextIndent), node.value) + } + } + lastIndex := len(node.children) + if lastIndex > 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/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/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/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