diff --git a/go.mod b/go.mod index 57733da7b1..bbf5b53a44 100644 --- a/go.mod +++ b/go.mod @@ -87,7 +87,7 @@ require ( github.com/testcontainers/testcontainers-go/modules/opensearch v0.42.0 github.com/theckman/yacspin v0.13.12 github.com/thejerf/suture/v4 v4.0.6 - github.com/tidwall/gjson v1.18.0 + github.com/tidwall/gjson v1.19.0 github.com/tidwall/sjson v1.2.5 github.com/tus/tusd/v2 v2.9.2 github.com/unrolled/secure v1.16.0 diff --git a/go.sum b/go.sum index 1f0860d8bc..375b43d0e1 100644 --- a/go.sum +++ b/go.sum @@ -1202,8 +1202,8 @@ github.com/theckman/yacspin v0.13.12/go.mod h1:Rd2+oG2LmQi5f3zC3yeZAOl245z8QOvrH github.com/thejerf/suture/v4 v4.0.6 h1:QsuCEsCqb03xF9tPAsWAj8QOAJBgQI1c0VqJNaingg8= github.com/thejerf/suture/v4 v4.0.6/go.mod h1:gu9Y4dXNUWFrByqRt30Rm9/UZ0wzRSt9AJS6xu/ZGxU= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= -github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.19.0 h1:xwxm7n691Uf3u5OFjzngavjGTh55KX5q/9w9xHW88JU= +github.com/tidwall/gjson v1.19.0/go.mod h1:V37/opeE/JbLUOfH0QTXiNez2l0RUjYUhpT4szFQAfc= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= diff --git a/vendor/github.com/tidwall/gjson/README.md b/vendor/github.com/tidwall/gjson/README.md index 387766d50c..f87b873776 100644 --- a/vendor/github.com/tidwall/gjson/README.md +++ b/vendor/github.com/tidwall/gjson/README.md @@ -56,7 +56,7 @@ This will print: ``` Prichard ``` -*There's also the [GetMany](#get-multiple-values-at-once) function to get multiple values at once, and [GetBytes](#working-with-bytes) for working with JSON byte slices.* +*There's also [GetBytes](#working-with-bytes) for working with JSON byte slices.* ## Path Syntax diff --git a/vendor/github.com/tidwall/gjson/gjson.go b/vendor/github.com/tidwall/gjson/gjson.go index 5aa2a4ffad..97d6516ae2 100644 --- a/vendor/github.com/tidwall/gjson/gjson.go +++ b/vendor/github.com/tidwall/gjson/gjson.go @@ -1,7 +1,14 @@ +// Copyright 2024 Joshua J Baker. All rights reserved. +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. +// +// https://github.com/tidwall/gjson + // Package gjson provides searching for json strings. package gjson import ( + "iter" "strconv" "strings" "time" @@ -3601,3 +3608,43 @@ func modDig(json, arg string) string { out = append(out, ']') return string(out) } + +// All iterates over a json result. +// This works identically to ForEach, but allows modern Go loops: +// +// for key, value := range res.All() { +// fmt.Printf("%s %s\n", key, value) +// } +func (t Result) All() iter.Seq2[Result, Result] { + return func(yield func(Result, Result) bool) { + t.ForEach(yield) + } +} + +// Keys iterates over a json result. +// This works identically to ForEach, but allows modern Go loops: +// +// for key := range res.Keys() { +// fmt.Printf("%s\n", key) +// } +func (t Result) Keys() iter.Seq[Result] { + return func(yield func(Result) bool) { + t.ForEach(func(key, _ Result) bool { + return yield(key) + }) + } +} + +// Values iterates over a json result. +// This works identically to ForEach, but allows modern Go loops: +// +// for value := range res.Values() { +// fmt.Printf("%s\n", value) +// } +func (t Result) Values() iter.Seq[Result] { + return func(yield func(Result) bool) { + t.ForEach(func(_, value Result) bool { + return yield(value) + }) + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 689910f30a..92d3ec3643 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2093,8 +2093,8 @@ github.com/theckman/yacspin # github.com/thejerf/suture/v4 v4.0.6 ## explicit; go 1.9 github.com/thejerf/suture/v4 -# github.com/tidwall/gjson v1.18.0 -## explicit; go 1.12 +# github.com/tidwall/gjson v1.19.0 +## explicit; go 1.23 github.com/tidwall/gjson # github.com/tidwall/match v1.1.1 ## explicit; go 1.15