From 6adf5bc3b9f3413db3ea3909755806f39f9a9f10 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Sat, 19 Oct 2019 00:25:57 +0400 Subject: [PATCH] Use Go modules, new import path --- README.md | 13 ++++++++++--- go.mod | 5 +++++ go.sum | 11 +++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/README.md b/README.md index 9771ce7..8ab45d1 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,20 @@ For each value returned by a path, you'll also get the keys & indexes needed to ## The history of a library -This fork is owned and currently maintained by [WTFTeam](https://lab.wtfteam.pro). It's based on [that one](https://github.com/JumboInteractiveLimited/jsonpath) from Jumbo Interactive Limited, which sequentally based/copied from NodePrime/jsonpath Github repository, currently unavailable. The MIT license on this code is inherited from Jumbo Interactive Limited fork, so we can support and maintain this library freely. If there is by any chance someone's proprietary code, you can reach us by ``abuse wtfteam pro`` with details. Unless proved against all code here is licensed under MIT. - +This fork is owned and currently maintained by [WTFTeam](https://wtfteam.pro). It's based on [that one](https://github.com/JumboInteractiveLimited/jsonpath) from Jumbo Interactive Limited, which sequentally based/copied from NodePrime/jsonpath Github repository, currently unavailable. The MIT license on this code is inherited from Jumbo Interactive Limited fork, so we can support and maintain this library freely. If there is by any chance someone's proprietary code, you can reach us by ``abuse wtfteam pro`` with details. Unless proved against all code here is licensed under MIT. + +### Mirrors and development + +The main development goes in [fat0troll's Gitea](https://source.hodakov.me/libraries/jsonpath). There is an official mirror on [GitHub](https://github.com/welltrainedfolks/jsonpath), but we do not guarantee that PRs, opened at GitHub, will be merged. + +The canonical import path hosted by [giredore](https://sources.dev.pztrn.name/pztrn/giredore), our own Go packages redirector. + ### Go Package Start with ```shell -go get lab.wtfteam.pro/wtfteam/jsonpath +go get source.wtfteam.pro/libraries/jsonpath ``` ```go @@ -46,6 +52,7 @@ if eval.Error != nil { `eval.Next()` will traverse JSON until another value is found. This has the potential of traversing the entire JSON document in an attempt to find one. If you prefer to have more control over traversing, use the `eval.Iterate()` method. It will return after every scanned JSON token and return `([]*Result, bool)`. This array will usually be empty, but occasionally contain results. ### Path Syntax + All paths start from the root node `$`. Similar to getting properties in a JavaScript object, a period `.title` or brackets `["title"]` are used. Syntax|Meaning|Examples diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f8e1262 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module source.wtfteam.pro/libraries/jsonpath + +go 1.13 + +require github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8fdee58 --- /dev/null +++ b/go.sum @@ -0,0 +1,11 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=