Merge pull request #726 from smira/dep-update

Update to recent version of `dep`, fix lock files
This commit is contained in:
Andrey Smirnov
2018-04-05 17:27:03 +03:00
committed by GitHub
652 changed files with 287 additions and 138 deletions
Generated
+79 -9
View File
@@ -1,4 +1,5 @@
memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/AlekSi/pointer"
@@ -14,13 +15,45 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
[[projects]]
name = "github.com/awalterschulze/gographviz"
packages = [".","ast","parser","scanner","token"]
packages = [
".",
"ast",
"parser",
"scanner",
"token"
]
revision = "761fd5fbb34e4c2c138c280395b65b48e4ff5a53"
version = "v1.0"
[[projects]]
name = "github.com/aws/aws-sdk-go"
packages = ["aws","aws/awserr","aws/awsutil","aws/client","aws/client/metadata","aws/corehandlers","aws/credentials","aws/credentials/ec2rolecreds","aws/credentials/endpointcreds","aws/credentials/stscreds","aws/defaults","aws/ec2metadata","aws/endpoints","aws/request","aws/session","aws/signer/v4","internal/shareddefaults","private/protocol","private/protocol/query","private/protocol/query/queryutil","private/protocol/rest","private/protocol/restxml","private/protocol/xml/xmlutil","service/s3","service/sts"]
packages = [
"aws",
"aws/awserr",
"aws/awsutil",
"aws/client",
"aws/client/metadata",
"aws/corehandlers",
"aws/credentials",
"aws/credentials/ec2rolecreds",
"aws/credentials/endpointcreds",
"aws/credentials/stscreds",
"aws/defaults",
"aws/ec2metadata",
"aws/endpoints",
"aws/request",
"aws/session",
"aws/signer/v4",
"internal/shareddefaults",
"private/protocol",
"private/protocol/query",
"private/protocol/query/queryutil",
"private/protocol/rest",
"private/protocol/restxml",
"private/protocol/xml/xmlutil",
"service/s3",
"service/sts"
]
revision = "c652f9369083515c3ddf1fbaf6df68da2c101545"
version = "v1.12.1"
@@ -38,7 +71,11 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
[[projects]]
name = "github.com/gin-gonic/gin"
packages = [".","binding","render"]
packages = [
".",
"binding",
"render"
]
revision = "d459835d2b077e44f7c9b453505ee29881d5d12d"
version = "v1.2"
@@ -75,8 +112,7 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
[[projects]]
name = "github.com/jmespath/go-jmespath"
packages = ["."]
revision = "3433f3ea46d9f8019119e7dd41274e112a2359a9"
version = "0.2.2"
revision = "0b12d6b5"
[[projects]]
name = "github.com/mattn/go-isatty"
@@ -111,7 +147,10 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
[[projects]]
branch = "master"
name = "github.com/ncw/swift"
packages = [".","swifttest"]
packages = [
".",
"swifttest"
]
revision = "8e9b10220613abdbc2896808ee6b43e411a4fa6c"
[[projects]]
@@ -165,7 +204,20 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
[[projects]]
branch = "master"
name = "github.com/syndtr/goleveldb"
packages = ["leveldb","leveldb/cache","leveldb/comparer","leveldb/errors","leveldb/filter","leveldb/iterator","leveldb/journal","leveldb/memdb","leveldb/opt","leveldb/storage","leveldb/table","leveldb/util"]
packages = [
"leveldb",
"leveldb/cache",
"leveldb/comparer",
"leveldb/errors",
"leveldb/filter",
"leveldb/iterator",
"leveldb/journal",
"leveldb/memdb",
"leveldb/opt",
"leveldb/storage",
"leveldb/table",
"leveldb/util"
]
revision = "549b6d6b1c0419617182954dd77770f2e2685ed5"
[[projects]]
@@ -182,7 +234,17 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["cast5","openpgp","openpgp/armor","openpgp/clearsign","openpgp/elgamal","openpgp/errors","openpgp/packet","openpgp/s2k","ssh/terminal"]
packages = [
"cast5",
"openpgp",
"openpgp/armor",
"openpgp/clearsign",
"openpgp/elgamal",
"openpgp/errors",
"openpgp/packet",
"openpgp/s2k",
"ssh/terminal"
]
revision = "459e26527287adbc2adcc5d0d49abff9a5f315a7"
[[projects]]
@@ -214,3 +276,11 @@ memo = "57879f27cc9f82276b92ed638fbc04122c3793ed4a16bea668c9fbfda280c280"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "5ab2b384766e62be84d3941971a1d8e99c637f80a2cb1482b3d9704c668b549f"
solver-name = "gps-cdcl"
solver-version = 1
 
+7 -7
View File
@@ -1,28 +1,28 @@
[[dependencies]]
[[override]]
branch = "master"
name = "github.com/mkrautz/goar"
[[dependencies]]
[[override]]
branch = "master"
name = "github.com/smira/go-uuid"
[[dependencies]]
[[override]]
branch = "master"
name = "github.com/smira/go-xz"
[[dependencies]]
[[override]]
name = "github.com/ugorji/go"
revision = "71c2886f5a673a35f909803f38ece5810165097b"
[[dependencies]]
[[override]]
branch = "master"
name = "golang.org/x/crypto"
[[dependencies]]
[[override]]
branch = "master"
name = "golang.org/x/sys"
[[dependencies]]
[[override]]
branch = "v1"
name = "gopkg.in/check.v1"
+1 -1
View File
@@ -35,7 +35,7 @@ buildfuzz:
go-fuzz-build github.com/jmespath/go-jmespath/fuzz
fuzz: buildfuzz
go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/corpus
go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata
bench:
go test -bench . -cpuprofile cpu.out
+37
View File
@@ -1,5 +1,42 @@
package jmespath
import "strconv"
// JmesPath is the epresentation of a compiled JMES path query. A JmesPath is
// safe for concurrent use by multiple goroutines.
type JMESPath struct {
ast ASTNode
intr *treeInterpreter
}
// Compile parses a JMESPath expression and returns, if successful, a JMESPath
// object that can be used to match against data.
func Compile(expression string) (*JMESPath, error) {
parser := NewParser()
ast, err := parser.Parse(expression)
if err != nil {
return nil, err
}
jmespath := &JMESPath{ast: ast, intr: newInterpreter()}
return jmespath, nil
}
// MustCompile is like Compile but panics if the expression cannot be parsed.
// It simplifies safe initialization of global variables holding compiled
// JMESPaths.
func MustCompile(expression string) *JMESPath {
jmespath, err := Compile(expression)
if err != nil {
panic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error())
}
return jmespath
}
// Search evaluates a JMESPath expression against input data and returns the result.
func (jp *JMESPath) Search(data interface{}) (interface{}, error) {
return jp.intr.Execute(jp.ast, data)
}
// Search evaluates a JMESPath expression against input data and returns the result.
func Search(expression string, data interface{}) (interface{}, error) {
intr := newInterpreter()
+32
View File
@@ -0,0 +1,32 @@
package jmespath
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestValidPrecompiledExpressionSearches(t *testing.T) {
assert := assert.New(t)
data := make(map[string]interface{})
data["foo"] = "bar"
precompiled, err := Compile("foo")
assert.Nil(err)
result, err := precompiled.Search(data)
assert.Nil(err)
assert.Equal("bar", result)
}
func TestInvalidPrecompileErrors(t *testing.T) {
assert := assert.New(t)
_, err := Compile("not a valid expression")
assert.NotNil(err)
}
func TestInvalidMustCompilePanics(t *testing.T) {
defer func() {
r := recover()
assert.NotNil(t, r)
}()
MustCompile("not a valid expression")
}
+65 -63
View File
@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"math"
"reflect"
"sort"
"strconv"
"strings"
@@ -124,197 +125,197 @@ type functionCaller struct {
func newFunctionCaller() *functionCaller {
caller := &functionCaller{}
caller.functionTable = map[string]functionEntry{
"length": functionEntry{
"length": {
name: "length",
arguments: []argSpec{
argSpec{types: []jpType{jpString, jpArray, jpObject}},
{types: []jpType{jpString, jpArray, jpObject}},
},
handler: jpfLength,
},
"starts_with": functionEntry{
"starts_with": {
name: "starts_with",
arguments: []argSpec{
argSpec{types: []jpType{jpString}},
argSpec{types: []jpType{jpString}},
{types: []jpType{jpString}},
{types: []jpType{jpString}},
},
handler: jpfStartsWith,
},
"abs": functionEntry{
"abs": {
name: "abs",
arguments: []argSpec{
argSpec{types: []jpType{jpNumber}},
{types: []jpType{jpNumber}},
},
handler: jpfAbs,
},
"avg": functionEntry{
"avg": {
name: "avg",
arguments: []argSpec{
argSpec{types: []jpType{jpArrayNumber}},
{types: []jpType{jpArrayNumber}},
},
handler: jpfAvg,
},
"ceil": functionEntry{
"ceil": {
name: "ceil",
arguments: []argSpec{
argSpec{types: []jpType{jpNumber}},
{types: []jpType{jpNumber}},
},
handler: jpfCeil,
},
"contains": functionEntry{
"contains": {
name: "contains",
arguments: []argSpec{
argSpec{types: []jpType{jpArray, jpString}},
argSpec{types: []jpType{jpAny}},
{types: []jpType{jpArray, jpString}},
{types: []jpType{jpAny}},
},
handler: jpfContains,
},
"ends_with": functionEntry{
"ends_with": {
name: "ends_with",
arguments: []argSpec{
argSpec{types: []jpType{jpString}},
argSpec{types: []jpType{jpString}},
{types: []jpType{jpString}},
{types: []jpType{jpString}},
},
handler: jpfEndsWith,
},
"floor": functionEntry{
"floor": {
name: "floor",
arguments: []argSpec{
argSpec{types: []jpType{jpNumber}},
{types: []jpType{jpNumber}},
},
handler: jpfFloor,
},
"map": functionEntry{
"map": {
name: "amp",
arguments: []argSpec{
argSpec{types: []jpType{jpExpref}},
argSpec{types: []jpType{jpArray}},
{types: []jpType{jpExpref}},
{types: []jpType{jpArray}},
},
handler: jpfMap,
hasExpRef: true,
},
"max": functionEntry{
"max": {
name: "max",
arguments: []argSpec{
argSpec{types: []jpType{jpArrayNumber, jpArrayString}},
{types: []jpType{jpArrayNumber, jpArrayString}},
},
handler: jpfMax,
},
"merge": functionEntry{
"merge": {
name: "merge",
arguments: []argSpec{
argSpec{types: []jpType{jpObject}, variadic: true},
{types: []jpType{jpObject}, variadic: true},
},
handler: jpfMerge,
},
"max_by": functionEntry{
"max_by": {
name: "max_by",
arguments: []argSpec{
argSpec{types: []jpType{jpArray}},
argSpec{types: []jpType{jpExpref}},
{types: []jpType{jpArray}},
{types: []jpType{jpExpref}},
},
handler: jpfMaxBy,
hasExpRef: true,
},
"sum": functionEntry{
"sum": {
name: "sum",
arguments: []argSpec{
argSpec{types: []jpType{jpArrayNumber}},
{types: []jpType{jpArrayNumber}},
},
handler: jpfSum,
},
"min": functionEntry{
"min": {
name: "min",
arguments: []argSpec{
argSpec{types: []jpType{jpArrayNumber, jpArrayString}},
{types: []jpType{jpArrayNumber, jpArrayString}},
},
handler: jpfMin,
},
"min_by": functionEntry{
"min_by": {
name: "min_by",
arguments: []argSpec{
argSpec{types: []jpType{jpArray}},
argSpec{types: []jpType{jpExpref}},
{types: []jpType{jpArray}},
{types: []jpType{jpExpref}},
},
handler: jpfMinBy,
hasExpRef: true,
},
"type": functionEntry{
"type": {
name: "type",
arguments: []argSpec{
argSpec{types: []jpType{jpAny}},
{types: []jpType{jpAny}},
},
handler: jpfType,
},
"keys": functionEntry{
"keys": {
name: "keys",
arguments: []argSpec{
argSpec{types: []jpType{jpObject}},
{types: []jpType{jpObject}},
},
handler: jpfKeys,
},
"values": functionEntry{
"values": {
name: "values",
arguments: []argSpec{
argSpec{types: []jpType{jpObject}},
{types: []jpType{jpObject}},
},
handler: jpfValues,
},
"sort": functionEntry{
"sort": {
name: "sort",
arguments: []argSpec{
argSpec{types: []jpType{jpArrayString, jpArrayNumber}},
{types: []jpType{jpArrayString, jpArrayNumber}},
},
handler: jpfSort,
},
"sort_by": functionEntry{
"sort_by": {
name: "sort_by",
arguments: []argSpec{
argSpec{types: []jpType{jpArray}},
argSpec{types: []jpType{jpExpref}},
{types: []jpType{jpArray}},
{types: []jpType{jpExpref}},
},
handler: jpfSortBy,
hasExpRef: true,
},
"join": functionEntry{
"join": {
name: "join",
arguments: []argSpec{
argSpec{types: []jpType{jpString}},
argSpec{types: []jpType{jpArrayString}},
{types: []jpType{jpString}},
{types: []jpType{jpArrayString}},
},
handler: jpfJoin,
},
"reverse": functionEntry{
"reverse": {
name: "reverse",
arguments: []argSpec{
argSpec{types: []jpType{jpArray, jpString}},
{types: []jpType{jpArray, jpString}},
},
handler: jpfReverse,
},
"to_array": functionEntry{
"to_array": {
name: "to_array",
arguments: []argSpec{
argSpec{types: []jpType{jpAny}},
{types: []jpType{jpAny}},
},
handler: jpfToArray,
},
"to_string": functionEntry{
"to_string": {
name: "to_string",
arguments: []argSpec{
argSpec{types: []jpType{jpAny}},
{types: []jpType{jpAny}},
},
handler: jpfToString,
},
"to_number": functionEntry{
"to_number": {
name: "to_number",
arguments: []argSpec{
argSpec{types: []jpType{jpAny}},
{types: []jpType{jpAny}},
},
handler: jpfToNumber,
},
"not_null": functionEntry{
"not_null": {
name: "not_null",
arguments: []argSpec{
argSpec{types: []jpType{jpAny}, variadic: true},
{types: []jpType{jpAny}, variadic: true},
},
handler: jpfNotNull,
},
@@ -357,7 +358,7 @@ func (a *argSpec) typeCheck(arg interface{}) error {
return nil
}
case jpArray:
if _, ok := arg.([]interface{}); ok {
if isSliceType(arg) {
return nil
}
case jpObject:
@@ -409,8 +410,9 @@ 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 isSliceType(arg) {
v := reflect.ValueOf(arg)
return float64(v.Len()), nil
} else if c, ok := arg.(map[string]interface{}); ok {
return float64(len(c)), nil
}

Some files were not shown because too many files have changed in this diff Show More