vendor: Update everything
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4620
This commit is contained in:
21
vendor/github.com/cznic/ql/builtin.go
generated
vendored
21
vendor/github.com/cznic/ql/builtin.go
generated
vendored
@@ -53,6 +53,7 @@ var builtin = map[string]struct {
|
||||
"second": {builtinSecond, 1, 1, true, false},
|
||||
"seconds": {builtinSeconds, 1, 1, true, false},
|
||||
"since": {builtinSince, 1, 1, false, false},
|
||||
"sleep": {builtinSleep, 1, 1, false, false},
|
||||
"sum": {builtinSum, 1, 1, false, true},
|
||||
"timeIn": {builtinTimeIn, 2, 2, true, false},
|
||||
"weekday": {builtinWeekday, 1, 1, true, false},
|
||||
@@ -873,6 +874,26 @@ func builtinSince(arg []interface{}, ctx map[interface{}]interface{}) (v interfa
|
||||
}
|
||||
}
|
||||
|
||||
func builtinSleep(arg []interface{}, ctx map[interface{}]interface{}) (v interface{}, err error) {
|
||||
switch x := arg[0].(type) {
|
||||
case nil:
|
||||
return nil, nil
|
||||
case time.Duration:
|
||||
time.Sleep(x)
|
||||
return nil, nil
|
||||
case idealInt:
|
||||
v := time.Second * time.Duration(int64(x))
|
||||
time.Sleep(v)
|
||||
return nil, nil
|
||||
case int64:
|
||||
v := time.Second * time.Duration(x)
|
||||
time.Sleep(v)
|
||||
return nil, nil
|
||||
default:
|
||||
return nil, invArg(x, "sleep")
|
||||
}
|
||||
}
|
||||
|
||||
func builtinSum(arg []interface{}, ctx map[interface{}]interface{}) (v interface{}, err error) {
|
||||
if _, ok := ctx["$agg0"]; ok {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user