client/vendor/github.com/jmespath/go-jmespath
knative-automation 72aeb1c820
upgrade to latest dependencies (#1207)
bumping knative.dev/hack 8d623a0...8368e1f:
  > 8368e1f guard against set -o unset (# 49)
  > 2b4f6fc disable go's proxy and sumdb only for knative deps (# 47)
bumping knative.dev/networking 8b522a9...e24bdfe:
  > e24bdfe upgrade to latest dependencies (# 350)
  > ab1235e Bump a few assorted dependencies to their latest versions (# 349)
  > 45b7ed1 Add ingress conformance test to ensure we do not add retries (# 348)
  > b61da13 upgrade to latest dependencies (# 347)
  > d2088ff Update common github actions (# 346)
  > c069ad2 Create prober request with context right away (# 344)
  > 342a3fb upgrade to latest dependencies (# 342)
  > 94433ab upgrade to latest dependencies (# 341)
bumping knative.dev/pkg 6040b3a...a02dcff:
  > a02dcff Bump a few assorted dependencies to their latest versions (# 2013)
  > 4b2ae07 Replace deprecated github.com/markbates/inflect with github.com/gobuffalo/flect (# 2014)
  > 8878069 upgrade to latest dependencies (# 2010)
  > c493a9e Update common github actions (# 2009)
  > 6045ed4 Allow setting DisableCompression in NewAutoTransport (# 2007)
  > ca02ef7 Genreconciler properly generates reconciler for Resources with Status (# 2004)
  > 0d31134 Fix nil pointer panic in kvstore (# 2002)
bumping knative.dev/serving e61294b...8751d91:
  > 8751d91 Split the reconcile rollout into its own function (# 10722)
  > 2b95084 Optimize the execution path around logging (# 10720)
  > bbca20f Update net-contour nightly (# 10715)
  > ef39273 upgrade to latest dependencies (# 10719)
  > 6449fb8 upgrade to latest dependencies (# 10717)
  > 45a435a Update net-kourier nightly (# 10706)
  > 2fbef5f upgrade to latest dependencies (# 10713)
  > c4ea4ad Fix the analyzer config for load-testing benchmark since it must have a value (# 10709)
  > 6f46354 Apply k8s default values for readiness probe (# 10700)
  > 8c4b2ff Update net-certmanager nightly (# 10705)
  > b6f618b Update net-istio nightly (# 10704)
  > 390f2c2 bump k8s min in DEVELOPMENT.md (# 10699)
  > f2ccdd5 tests (# 10702)
  > 2090edf Update net-istio nightly (# 10695)
  > 789455d Update net-certmanager nightly (# 10674)
  > 1c61d3b Update common github actions (# 10697)
  > 2bc3650 Update net-kourier nightly (# 10696)
  > 8c64d92 Format markdown (# 10698)
  > 0e77ab2 Update net-kourier nightly (# 10676)
  > dd96a0a Update net-contour nightly (# 10686)
  > 8fbcfb0 Unpin the istio version and temporarily disable the error rate check analyzer (# 10655)
  > 58550fd Avoid adding gzip-encoding to requests implicitly (# 10691)
  > 60cdc35 Move Multi Container test to Beta (# 10683)
  > ae7b278 Update net-istio nightly (# 10687)
  > 7a18f38 Fix some nits in e2e tests (# 10678)
  > 9c572cd Allow to specify build platform for test images (# 10672)
  > 0ee79dd Remove the unsed struct items (# 10684)
  > 29da3af Improve debuggability of SKS logs (# 10679)
  > 8e1d587 upgrade to latest dependencies (# 10682)
  > aef0145 Temporarily disable auto TLS test with HTTP01 challenge  (# 10685)
  > 32b0292 Use lister instead of client to directly get ClusterDomainClaim (# 10677)
  > a19ff15 Update net-istio nightly (# 10675)
  > 6313088 Allow kpa to work with timeout in context (# 10673)
  > af7af61 Perform some test helper cleanup (# 10670)
  > 93d2449 upgrade to latest dependencies (# 10671)
  > 888331e Remove the service name from the internal traffic target object. (# 10669)
  > 1901e4c Use consistent alias for autoscaler v1alpha1 everywhere (# 10666)
  > 1e070a3 Remove context from MakeDecider (# 10657)
  > 452bed5 Further remove usage of the context in the scale runner (# 10653)
  > a1ee2ec bump ggcr & k8schain (# 10651)
  > 81818f9 Fix logging of errors in stats scraper (# 10654)
  > 1b0f43c Hide implementation detail inside a function (# 10652)
  > 756fd17 Update net-istio nightly (# 10648)
  > 6d46d52 Add support for decoding Revision from Host. (# 10647)
  > 01fa1a0 Remove the time computation (# 10645)
  > dbccf2a Do not pass context to the scale, but logger instead (# 10646)
  > ab176fa Rename back to the non deprecated name (# 10640)
  > fae6549 Update net-contour nightly (# 10644)
  > 5cd4f64 Update net-istio nightly (# 10643)
  > fbbbb98 Make route stop using the `DeprecatedServiceName` field (# 10638)
  > bf35e3f 💄 updating the HPAs to v2beta2 API usage (# 10631)
  > 51a9c0b Update net-certmanager nightly (# 10636)
  > e5c5c08 Export MESH env value in test script (# 10635)
  > 4a3274c Remove unused constants, make some other small tidy-ups (# 10637)
  > b083383 fix the broken doc's link (# 10634)
  > aac0df2 Deprecate the service name on the revision. (# 10633)
  > 0aa3d0b Remove the propagation from SKS->PA->Rev.Status of the K8s service (# 10632)
  > db90f4f Update net-contour nightly (# 10597)
  > 981c601 Update net-istio nightly (# 10619)
  > 8922f35 Update net-kourier nightly (# 10599)
  > df11c15 chore: Set background to white for autoscaling diagrams ... (# 10629)
  > f637b5a Remove naked returns (# 10618)
  > 6cde241 Improve rollout test to check duration (# 10625)
  > 7700811 At 100ms we still see failures on prow (# 10626)
  > c081a82 Make the singlethreaded code simpler by using boolean guard (# 10624)
  > 55a7edf upgrade to latest dependencies (# 10627)
  > 53d4d5b Fix some annoying nits in the route e2e tests (# 10623)
  > 2c781c7 upgrade to latest dependencies (# 10620)
  > 6dba44a The year was 2021.. (# 10621)
  > 39d33bf upgrade to latest dependencies (# 10617)
bumping golang.org/x/term 7de9c90...2321bbc:
  > 2321bbc Update doc to use "term" instead of "terminal"
  > ee85cb9 README.md: add badge to pkg.go.dev
bumping knative.dev/eventing ea452b5...3fcb645:
  > 3fcb645 🌀 Remvoing contrib refs (# 4855)
  > f05561d upgrade to latest dependencies (# 4853)
  > 37eaf71 switch Harwayne with antoineco (# 4850)
  > b887ac4 upgrade to latest dependencies (# 4848)
  > daa085d Format markdown (# 4846)
  > 3d51c72 Change trigger spec to indicate assigned broker should be immutable (# 4828)
  > 1774243 Add immutable fields validation to v1beta1 broker (# 4816)
  > 935d5fb Format markdown (# 4840)
  > 269b061 Update common github actions (# 4839)
  > 152e608 upgrade to latest dependencies (# 4841)
  > 8171448 Adding Logline for when a cloudevent has been successfully sent from APIServerSource to the sink (# 4723)
  > fd2688d Use SHOULD for TriggerSpec to keep compatibility (# 4838)
  > 1fa597e [# 4796] Bump golang lint timeout to 10m (# 4830)
  > a4a9f48 Format markdown (# 4829)
  > d58bd38 fix the link to head (# 4826)
  > 39d7a9e remove unused functions (# 4824)
  > 6edcbdd Panic in shared main to propagate error to exit code (# 4820)
  > 012a9bd v1beta1.Trigger delivery should be v1.DeliverySpec (# 4822)
  > 321a839 Format markdown (# 4823)
  > ec63881 Fix spec # 4515 (# 4654)
  > 1528750 upgrade to latest dependencies (# 4818)
  > 9dc57e2 Update common github actions (# 4817)
  > b20c96b sinkbing implement bindable (# 4794)
  > 8d51418 Bump golang linter version and timeout (# 4808)
  > f882ff0 Add availability rate to upgrade test report (# 4555)
  > a6635bb Patch HPA eventing-webhook min replicas (# 4811)
  > d46c1d0 It is already 2021 (# 4809)
  > fb8fbf7 Adding new source conformance testcase for CRD RBAC (# 4787)
  > 1725902 Update COMMUNITY_CONTACTS.md test grid link (# 4798)
  > b75d03a Adding new source conformance testcase for CRD Source Registry Spec (# 4780)
  > 77fc350 upgrade to latest dependencies (# 4797)

Signed-off-by: Knative Automation <automation@knative.team>
2021-02-09 10:04:50 -08:00
..
.gitignore Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
.travis.yml upgrade to latest dependencies (#1207) 2021-02-09 10:04:50 -08:00
LICENSE Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
Makefile upgrade to latest dependencies (#1207) 2021-02-09 10:04:50 -08:00
README.md Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
api.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
astnodetype_string.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
functions.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
go.mod upgrade to latest dependencies (#1207) 2021-02-09 10:04:50 -08:00
go.sum upgrade to latest dependencies (#1207) 2021-02-09 10:04:50 -08:00
interpreter.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
lexer.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
parser.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
toktype_string.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00
util.go Pin deps back to master (#1082) 2020-10-30 08:15:35 -07:00

README.md

go-jmespath - A JMESPath implementation in Go

Build Status

go-jmespath is a GO implementation of JMESPath, which is a query language for JSON. It will take a JSON document and transform it into another JSON document through a JMESPath expression.

Using go-jmespath is really easy. There's a single function you use, jmespath.search:

> import "github.com/jmespath/go-jmespath"
>
> var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.Search("foo.bar.baz[2]", data)
result = 2

In the example we gave the search function input data of {"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}} as well as the JMESPath expression foo.bar.baz[2], and the search function evaluated the expression against the input data to produce the result 2.

The JMESPath language can do a lot more than select an element from a list. Here are a few more examples:

> var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.search("foo.bar", data)
result = { "baz": [ 0, 1, 2, 3, 4 ] }


> var jsondata  = []byte(`{"foo": [{"first": "a", "last": "b"},
                           {"first": "c", "last": "d"}]}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.search({"foo[*].first", data)
result [ 'a', 'c' ]


> var jsondata = []byte(`{"foo": [{"age": 20}, {"age": 25},
                           {"age": 30}, {"age": 35},
                           {"age": 40}]}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.search("foo[?age > `30`]")
result = [ { age: 35 }, { age: 40 } ]

You can also pre-compile your query. This is usefull if you are going to run multiple searches with it:

	> var jsondata = []byte(`{"foo": "bar"}`)
	> var data interface{}
    > err := json.Unmarshal(jsondata, &data)
	> precompiled, err := Compile("foo")
	> if err != nil{
    >   // ... handle the error
    > }
    > result, err := precompiled.Search(data)
	result = "bar"

More Resources

The example above only show a small amount of what a JMESPath expression can do. If you want to take a tour of the language, the best place to go is the JMESPath Tutorial.

One of the best things about JMESPath is that it is implemented in many different programming languages including python, ruby, php, lua, etc. To see a complete list of libraries, check out the JMESPath libraries page.

And finally, the full JMESPath specification can be found on the JMESPath site.