⬆️ update dependencies, ✨ implement user store
This commit is contained in:
10
vendor/github.com/tidwall/btree/btree.go
generated
vendored
10
vendor/github.com/tidwall/btree/btree.go
generated
vendored
@@ -822,6 +822,16 @@ func (t *BTree) Len() int {
|
||||
return t.length
|
||||
}
|
||||
|
||||
// Context returns the context of the tree.
|
||||
func (t *BTree) Context() interface{} {
|
||||
return t.ctx
|
||||
}
|
||||
|
||||
// SetContext will replace the context of the tree.
|
||||
func (t *BTree) SetContext(ctx interface{}) {
|
||||
t.ctx = ctx
|
||||
}
|
||||
|
||||
// Int implements the Item interface for integers.
|
||||
type Int int
|
||||
|
||||
|
||||
12
vendor/github.com/tidwall/buntdb/buntdb.go
generated
vendored
12
vendor/github.com/tidwall/buntdb/buntdb.go
generated
vendored
@@ -334,8 +334,6 @@ func (idx *index) rebuild() {
|
||||
// less function to handle the content format and comparison.
|
||||
// There are some default less function that can be used such as
|
||||
// IndexString, IndexBinary, etc.
|
||||
//
|
||||
// Deprecated: Use Transactions
|
||||
func (db *DB) CreateIndex(name, pattern string,
|
||||
less ...func(a, b string) bool) error {
|
||||
return db.Update(func(tx *Tx) error {
|
||||
@@ -347,8 +345,6 @@ func (db *DB) CreateIndex(name, pattern string,
|
||||
// The items are ordered in an b-tree and can be retrieved using the
|
||||
// Ascend* and Descend* methods.
|
||||
// If a previous index with the same name exists, that index will be deleted.
|
||||
//
|
||||
// Deprecated: Use Transactions
|
||||
func (db *DB) ReplaceIndex(name, pattern string,
|
||||
less ...func(a, b string) bool) error {
|
||||
return db.Update(func(tx *Tx) error {
|
||||
@@ -381,8 +377,6 @@ func (db *DB) ReplaceIndex(name, pattern string,
|
||||
// Thus min[0] must be less-than-or-equal-to max[0].
|
||||
// The IndexRect is a default function that can be used for the rect
|
||||
// parameter.
|
||||
//
|
||||
// Deprecated: Use Transactions
|
||||
func (db *DB) CreateSpatialIndex(name, pattern string,
|
||||
rect func(item string) (min, max []float64)) error {
|
||||
return db.Update(func(tx *Tx) error {
|
||||
@@ -394,8 +388,6 @@ func (db *DB) CreateSpatialIndex(name, pattern string,
|
||||
// The items are organized in an r-tree and can be retrieved using the
|
||||
// Intersects method.
|
||||
// If a previous index with the same name exists, that index will be deleted.
|
||||
//
|
||||
// Deprecated: Use Transactions
|
||||
func (db *DB) ReplaceSpatialIndex(name, pattern string,
|
||||
rect func(item string) (min, max []float64)) error {
|
||||
return db.Update(func(tx *Tx) error {
|
||||
@@ -415,8 +407,6 @@ func (db *DB) ReplaceSpatialIndex(name, pattern string,
|
||||
}
|
||||
|
||||
// DropIndex removes an index.
|
||||
//
|
||||
// Deprecated: Use Transactions
|
||||
func (db *DB) DropIndex(name string) error {
|
||||
return db.Update(func(tx *Tx) error {
|
||||
return tx.DropIndex(name)
|
||||
@@ -424,8 +414,6 @@ func (db *DB) DropIndex(name string) error {
|
||||
}
|
||||
|
||||
// Indexes returns a list of index names.
|
||||
//
|
||||
// Deprecated: Use Transactions
|
||||
func (db *DB) Indexes() ([]string, error) {
|
||||
var names []string
|
||||
var err = db.View(func(tx *Tx) error {
|
||||
|
||||
12
vendor/github.com/tidwall/buntdb/go.mod
generated
vendored
Normal file
12
vendor/github.com/tidwall/buntdb/go.mod
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
module github.com/tidwall/buntdb
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/tidwall/btree v0.0.0-20191029221954-400434d76274
|
||||
github.com/tidwall/gjson v1.3.4
|
||||
github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb
|
||||
github.com/tidwall/match v1.0.1
|
||||
github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e
|
||||
github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563 // indirect
|
||||
)
|
||||
14
vendor/github.com/tidwall/buntdb/go.sum
generated
vendored
Normal file
14
vendor/github.com/tidwall/buntdb/go.sum
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
github.com/tidwall/btree v0.0.0-20191029221954-400434d76274 h1:G6Z6HvJuPjG6XfNGi/feOATzeJrfgTNJY+rGrHbA04E=
|
||||
github.com/tidwall/btree v0.0.0-20191029221954-400434d76274/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8=
|
||||
github.com/tidwall/gjson v1.3.4 h1:On5waDnyKKk3SWE4EthbjjirAWXp43xx5cKCUZY1eZw=
|
||||
github.com/tidwall/gjson v1.3.4/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||
github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb h1:5NSYaAdrnblKByzd7XByQEJVT8+9v0W/tIY0Oo4OwrE=
|
||||
github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb/go.mod h1:lKYYLFIr9OIgdgrtgkZ9zgRxRdvPYsExnYBsEAd8W5M=
|
||||
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
|
||||
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
|
||||
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e h1:+NL1GDIUOKxVfbp2KoJQD9cTQ6dyP2co9q4yzmT9FZo=
|
||||
github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e/go.mod h1:/h+UnNGt0IhNNJLkGikcdcJqm66zGD/uJGMRxK/9+Ao=
|
||||
github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563 h1:Otn9S136ELckZ3KKDyCkxapfufrqDqwmGjcHfAyXRrE=
|
||||
github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563/go.mod h1:mLqSmt7Dv/CNneF2wfcChfN1rvapyQr01LGKnKex0DQ=
|
||||
3
vendor/github.com/tidwall/gjson/SYNTAX.md
generated
vendored
3
vendor/github.com/tidwall/gjson/SYNTAX.md
generated
vendored
@@ -12,6 +12,7 @@ This document is designed to explain the structure of a GJSON Path through examp
|
||||
- [Queries](#queries)
|
||||
- [Dot vs Pipe](#dot-vs-pipe)
|
||||
- [Modifiers](#modifiers)
|
||||
- [Multipaths](#multipaths)
|
||||
|
||||
The definitive implemenation is [github.com/tidwall/gjson](https://github.com/tidwall/gjson).
|
||||
Use the [GJSON Playground](https://gjson.dev) to experiment with the syntax online.
|
||||
@@ -235,7 +236,7 @@ gjson.AddModifier("case", func(json, arg string) string {
|
||||
"children.@case:lower.@reverse" ["jack","alex","sara"]
|
||||
```
|
||||
|
||||
#### Multipaths
|
||||
### Multipaths
|
||||
|
||||
Starting with v1.3.0, GJSON added the ability to join multiple paths together
|
||||
to form new documents. Wrapping comma-separated paths between `{...}` or
|
||||
|
||||
71
vendor/github.com/tidwall/gjson/gjson.go
generated
vendored
71
vendor/github.com/tidwall/gjson/gjson.go
generated
vendored
@@ -464,9 +464,9 @@ func ParseBytes(json []byte) Result {
|
||||
}
|
||||
|
||||
func squash(json string) string {
|
||||
// expects that the lead character is a '[' or '{'
|
||||
// expects that the lead character is a '[' or '{' or '('
|
||||
// squash the value, ignoring all nested arrays and objects.
|
||||
// the first '[' or '{' has already been read
|
||||
// the first '[' or '{' or '(', has already been read
|
||||
depth := 1
|
||||
for i := 1; i < len(json); i++ {
|
||||
if json[i] >= '"' && json[i] <= '}' {
|
||||
@@ -495,9 +495,9 @@ func squash(json string) string {
|
||||
break
|
||||
}
|
||||
}
|
||||
case '{', '[':
|
||||
case '{', '[', '(':
|
||||
depth++
|
||||
case '}', ']':
|
||||
case '}', ']', ')':
|
||||
depth--
|
||||
if depth == 0 {
|
||||
return json[:i+1]
|
||||
@@ -1056,9 +1056,9 @@ func parseObjectPath(path string) (r objectPathResult) {
|
||||
}
|
||||
|
||||
func parseSquash(json string, i int) (int, string) {
|
||||
// expects that the lead character is a '[' or '{'
|
||||
// expects that the lead character is a '[' or '{' or '('
|
||||
// squash the value, ignoring all nested arrays and objects.
|
||||
// the first '[' or '{' has already been read
|
||||
// the first '[' or '{' or '(' has already been read
|
||||
s := i
|
||||
i++
|
||||
depth := 1
|
||||
@@ -1089,9 +1089,9 @@ func parseSquash(json string, i int) (int, string) {
|
||||
break
|
||||
}
|
||||
}
|
||||
case '{', '[':
|
||||
case '{', '[', '(':
|
||||
depth++
|
||||
case '}', ']':
|
||||
case '}', ']', ')':
|
||||
depth--
|
||||
if depth == 0 {
|
||||
i++
|
||||
@@ -1556,19 +1556,30 @@ func parseArray(c *parseContext, i int, path string) (int, bool) {
|
||||
var jsons = make([]byte, 0, 64)
|
||||
jsons = append(jsons, '[')
|
||||
for j, k := 0, 0; j < len(alog); j++ {
|
||||
_, res, ok := parseAny(c.json, alog[j], true)
|
||||
if ok {
|
||||
res := res.Get(rp.alogkey)
|
||||
if res.Exists() {
|
||||
if k > 0 {
|
||||
jsons = append(jsons, ',')
|
||||
idx := alog[j]
|
||||
for idx < len(c.json) {
|
||||
switch c.json[idx] {
|
||||
case ' ', '\t', '\r', '\n':
|
||||
idx++
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
if idx < len(c.json) && c.json[idx] != ']' {
|
||||
_, res, ok := parseAny(c.json, idx, true)
|
||||
if ok {
|
||||
res := res.Get(rp.alogkey)
|
||||
if res.Exists() {
|
||||
if k > 0 {
|
||||
jsons = append(jsons, ',')
|
||||
}
|
||||
raw := res.Raw
|
||||
if len(raw) == 0 {
|
||||
raw = res.String()
|
||||
}
|
||||
jsons = append(jsons, []byte(raw)...)
|
||||
k++
|
||||
}
|
||||
raw := res.Raw
|
||||
if len(raw) == 0 {
|
||||
raw = res.String()
|
||||
}
|
||||
jsons = append(jsons, []byte(raw)...)
|
||||
k++
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1615,10 +1626,21 @@ func splitPossiblePipe(path string) (left, right string, ok bool) {
|
||||
return
|
||||
}
|
||||
|
||||
if len(path) > 0 && path[0] == '{' {
|
||||
squashed := squash(path[1:])
|
||||
if len(squashed) < len(path)-1 {
|
||||
squashed = path[:len(squashed)+1]
|
||||
remain := path[len(squashed):]
|
||||
if remain[0] == '|' {
|
||||
return squashed, remain[1:], true
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// split the left and right side of the path with the pipe character as
|
||||
// the delimiter. This is a little tricky because we'll need to basically
|
||||
// parse the entire path.
|
||||
|
||||
for i := 0; i < len(path); i++ {
|
||||
if path[i] == '\\' {
|
||||
i++
|
||||
@@ -1699,6 +1721,7 @@ type subSelector struct {
|
||||
// first character in path is either '[' or '{', and has already been checked
|
||||
// prior to calling this function.
|
||||
func parseSubSelectors(path string) (sels []subSelector, out string, ok bool) {
|
||||
modifer := 0
|
||||
depth := 1
|
||||
colon := 0
|
||||
start := 1
|
||||
@@ -1719,8 +1742,12 @@ func parseSubSelectors(path string) (sels []subSelector, out string, ok bool) {
|
||||
switch path[i] {
|
||||
case '\\':
|
||||
i++
|
||||
case '@':
|
||||
if modifer == 0 && i > 0 && (path[i-1] == '.' || path[i-1] == '|') {
|
||||
modifer = i
|
||||
}
|
||||
case ':':
|
||||
if depth == 1 {
|
||||
if modifer == 0 && colon == 0 && depth == 1 {
|
||||
colon = i
|
||||
}
|
||||
case ',':
|
||||
|
||||
Reference in New Issue
Block a user