From 5d920465245906e2250c288c2b1ffea608a37539 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:41:41 +0200 Subject: Merging upstream version 1.2.0. Signed-off-by: Daniel Baumann --- .github/dependabot.yml | 14 +- .mailmap | 1 + AUTHORS | 1 + CHANGELOG.md | 34 + README.md | 7 +- cmd/icingadb-migrate/convert.go | 33 +- cmd/icingadb-migrate/misc.go | 3 +- cmd/icingadb/main.go | 17 +- config.example.yml | 64 +- .../cache/download/filippo.io/edwards25519/@v/list | 1 + .../filippo.io/edwards25519/@v/v1.1.0.info | 1 + .../filippo.io/edwards25519/@v/v1.1.0.lock | 0 .../download/filippo.io/edwards25519/@v/v1.1.0.mod | 3 + .../download/filippo.io/edwards25519/@v/v1.1.0.zip | Bin 0 -> 55809 bytes .../filippo.io/edwards25519/@v/v1.1.0.ziphash | 1 + .../download/github.com/benbjohnson/clock/@v/list | 1 - .../github.com/benbjohnson/clock/@v/v1.3.0.mod | 3 - .../download/github.com/cespare/xxhash/v2/@v/list | 2 +- .../github.com/cespare/xxhash/v2/@v/v2.1.2.lock | 0 .../github.com/cespare/xxhash/v2/@v/v2.1.2.mod | 3 - .../github.com/cespare/xxhash/v2/@v/v2.1.2.zip | Bin 15284 -> 0 bytes .../github.com/cespare/xxhash/v2/@v/v2.1.2.ziphash | 1 - .../github.com/cespare/xxhash/v2/@v/v2.2.0.info | 1 - .../github.com/cespare/xxhash/v2/@v/v2.2.0.lock | 0 .../github.com/cespare/xxhash/v2/@v/v2.2.0.zip | Bin 0 -> 17183 bytes .../github.com/cespare/xxhash/v2/@v/v2.2.0.ziphash | 1 + .../github.com/cespare/xxhash/v2/@v/v2.3.0.info | 1 + .../github.com/cespare/xxhash/v2/@v/v2.3.0.mod | 3 + .../cache/download/github.com/fatih/color/@v/list | 2 +- .../github.com/fatih/color/@v/v1.15.0.info | 1 - .../download/github.com/fatih/color/@v/v1.15.0.mod | 10 - .../github.com/fatih/color/@v/v1.16.0.info | 1 + .../download/github.com/fatih/color/@v/v1.16.0.mod | 10 + .../download/github.com/go-redis/redis/v8/@v/list | 1 - .../github.com/go-redis/redis/v8/@v/v8.11.5.info | 1 - .../github.com/go-redis/redis/v8/@v/v8.11.5.lock | 0 .../github.com/go-redis/redis/v8/@v/v8.11.5.mod | 20 - .../github.com/go-redis/redis/v8/@v/v8.11.5.zip | Bin 176032 -> 0 bytes .../go-redis/redis/v8/@v/v8.11.5.ziphash | 1 - .../github.com/go-sql-driver/mysql/@v/list | 2 +- .../github.com/go-sql-driver/mysql/@v/v1.7.1.info | 1 - .../github.com/go-sql-driver/mysql/@v/v1.7.1.lock | 0 .../github.com/go-sql-driver/mysql/@v/v1.7.1.mod | 3 - .../github.com/go-sql-driver/mysql/@v/v1.7.1.zip | Bin 119398 -> 0 bytes .../go-sql-driver/mysql/@v/v1.7.1.ziphash | 1 - .../github.com/go-sql-driver/mysql/@v/v1.8.1.info | 1 + .../github.com/go-sql-driver/mysql/@v/v1.8.1.lock | 0 .../github.com/go-sql-driver/mysql/@v/v1.8.1.mod | 5 + .../github.com/go-sql-driver/mysql/@v/v1.8.1.zip | Bin 0 -> 129854 bytes .../go-sql-driver/mysql/@v/v1.8.1.ziphash | 1 + .../download/github.com/goccy/go-yaml/@v/list | 2 +- .../github.com/goccy/go-yaml/@v/v1.11.0.info | 1 - .../github.com/goccy/go-yaml/@v/v1.11.0.lock | 0 .../github.com/goccy/go-yaml/@v/v1.11.0.mod | 20 - .../github.com/goccy/go-yaml/@v/v1.11.0.zip | Bin 106106 -> 0 bytes .../github.com/goccy/go-yaml/@v/v1.11.0.ziphash | 1 - .../github.com/goccy/go-yaml/@v/v1.11.3.info | 1 + .../github.com/goccy/go-yaml/@v/v1.11.3.lock | 0 .../github.com/goccy/go-yaml/@v/v1.11.3.mod | 20 + .../github.com/goccy/go-yaml/@v/v1.11.3.zip | Bin 0 -> 109283 bytes .../github.com/goccy/go-yaml/@v/v1.11.3.ziphash | 1 + .../cache/download/github.com/google/uuid/@v/list | 2 +- .../download/github.com/google/uuid/@v/v1.3.0.info | 1 - .../download/github.com/google/uuid/@v/v1.3.0.lock | 0 .../download/github.com/google/uuid/@v/v1.3.0.mod | 1 - .../download/github.com/google/uuid/@v/v1.3.0.zip | Bin 25027 -> 0 bytes .../github.com/google/uuid/@v/v1.3.0.ziphash | 1 - .../download/github.com/google/uuid/@v/v1.6.0.info | 1 + .../download/github.com/google/uuid/@v/v1.6.0.lock | 0 .../download/github.com/google/uuid/@v/v1.6.0.mod | 1 + .../download/github.com/google/uuid/@v/v1.6.0.zip | Bin 0 -> 31981 bytes .../github.com/google/uuid/@v/v1.6.0.ziphash | 1 + .../download/github.com/mattn/go-isatty/@v/list | 2 +- .../github.com/mattn/go-isatty/@v/v0.0.19.info | 1 - .../github.com/mattn/go-isatty/@v/v0.0.19.mod | 5 - .../github.com/mattn/go-isatty/@v/v0.0.20.info | 1 + .../github.com/mattn/go-isatty/@v/v0.0.20.mod | 5 + .../download/github.com/mattn/go-sqlite3/@v/list | 2 +- .../github.com/mattn/go-sqlite3/@v/v1.14.17.info | 1 - .../github.com/mattn/go-sqlite3/@v/v1.14.17.lock | 0 .../github.com/mattn/go-sqlite3/@v/v1.14.17.mod | 7 - .../github.com/mattn/go-sqlite3/@v/v1.14.17.zip | Bin 2599934 -> 0 bytes .../mattn/go-sqlite3/@v/v1.14.17.ziphash | 1 - .../github.com/mattn/go-sqlite3/@v/v1.14.22.info | 1 + .../github.com/mattn/go-sqlite3/@v/v1.14.22.lock | 0 .../github.com/mattn/go-sqlite3/@v/v1.14.22.mod | 7 + .../github.com/mattn/go-sqlite3/@v/v1.14.22.zip | Bin 0 -> 2674679 bytes .../mattn/go-sqlite3/@v/v1.14.22.ziphash | 1 + .../download/github.com/redis/go-redis/v9/@v/list | 1 + .../github.com/redis/go-redis/v9/@v/v9.5.1.info | 1 + .../github.com/redis/go-redis/v9/@v/v9.5.1.lock | 0 .../github.com/redis/go-redis/v9/@v/v9.5.1.mod | 10 + .../github.com/redis/go-redis/v9/@v/v9.5.1.zip | Bin 0 -> 250611 bytes .../github.com/redis/go-redis/v9/@v/v9.5.1.ziphash | 1 + .../cache/download/github.com/rivo/uniseg/@v/list | 2 +- .../download/github.com/rivo/uniseg/@v/v0.4.4.info | 1 - .../download/github.com/rivo/uniseg/@v/v0.4.4.mod | 3 - .../download/github.com/rivo/uniseg/@v/v0.4.7.info | 1 + .../download/github.com/rivo/uniseg/@v/v0.4.7.mod | 3 + .../download/github.com/stretchr/testify/@v/list | 2 +- .../github.com/stretchr/testify/@v/v1.8.4.mod | 10 - .../github.com/stretchr/testify/@v/v1.9.0.mod | 16 + .../pkg/mod/cache/download/go.uber.org/zap/@v/list | 2 +- .../cache/download/go.uber.org/zap/@v/v1.25.0.info | 1 - .../cache/download/go.uber.org/zap/@v/v1.25.0.lock | 0 .../cache/download/go.uber.org/zap/@v/v1.25.0.mod | 17 - .../cache/download/go.uber.org/zap/@v/v1.25.0.zip | Bin 277618 -> 0 bytes .../download/go.uber.org/zap/@v/v1.25.0.ziphash | 1 - .../cache/download/go.uber.org/zap/@v/v1.27.0.info | 1 + .../cache/download/go.uber.org/zap/@v/v1.27.0.lock | 0 .../cache/download/go.uber.org/zap/@v/v1.27.0.mod | 16 + .../cache/download/go.uber.org/zap/@v/v1.27.0.zip | Bin 0 -> 287887 bytes .../download/go.uber.org/zap/@v/v1.27.0.ziphash | 1 + .../mod/cache/download/golang.org/x/exp/@v/list | 2 +- .../exp/@v/v0.0.0-20230809094429-853ea248256d.info | 1 - .../exp/@v/v0.0.0-20230809094429-853ea248256d.mod | 11 - .../exp/@v/v0.0.0-20240409090435-93d18d7e34b8.info | 1 + .../exp/@v/v0.0.0-20240409090435-93d18d7e34b8.mod | 11 + .../mod/cache/download/golang.org/x/sync/@v/list | 2 +- .../download/golang.org/x/sync/@v/v0.3.0.info | 1 - .../download/golang.org/x/sync/@v/v0.3.0.lock | 0 .../cache/download/golang.org/x/sync/@v/v0.3.0.mod | 3 - .../cache/download/golang.org/x/sync/@v/v0.3.0.zip | Bin 29766 -> 0 bytes .../download/golang.org/x/sync/@v/v0.3.0.ziphash | 1 - .../download/golang.org/x/sync/@v/v0.7.0.info | 1 + .../download/golang.org/x/sync/@v/v0.7.0.lock | 0 .../cache/download/golang.org/x/sync/@v/v0.7.0.mod | 3 + .../cache/download/golang.org/x/sync/@v/v0.7.0.zip | Bin 0 -> 26990 bytes .../download/golang.org/x/sync/@v/v0.7.0.ziphash | 1 + .../mod/cache/download/golang.org/x/sys/@v/list | 3 +- .../sys/@v/v0.0.0-20211216021012-1d35b9e2eb4e.mod | 3 - .../download/golang.org/x/sys/@v/v0.11.0.info | 1 - .../cache/download/golang.org/x/sys/@v/v0.11.0.mod | 3 - .../download/golang.org/x/sys/@v/v0.19.0.info | 1 + .../cache/download/golang.org/x/sys/@v/v0.19.0.mod | 3 + .../cache/download/golang.org/x/xerrors/@v/list | 1 + .../@v/v0.0.0-20220907171357-04be3eba64a2.info | 1 - .../@v/v0.0.0-20231012003039-104605ab7028.info | 1 + .../@v/v0.0.0-20231012003039-104605ab7028.mod | 3 + .../lookup/github.com/cespare/xxhash/v2@v2.2.0 | 9 - .../lookup/github.com/cespare/xxhash/v2@v2.3.0 | 9 + .../lookup/github.com/davecgh/go-spew@v1.1.0 | 6 +- .../lookup/github.com/fatih/color@v1.10.0 | 6 +- .../lookup/github.com/fatih/color@v1.15.0 | 9 - .../lookup/github.com/fatih/color@v1.16.0 | 9 + .../lookup/github.com/mattn/go-colorable@v0.1.8 | 6 +- .../lookup/github.com/mattn/go-isatty@v0.0.19 | 9 - .../lookup/github.com/mattn/go-isatty@v0.0.20 | 9 + .../lookup/github.com/mattn/go-runewidth@v0.0.15 | 6 +- .../lookup/github.com/rivo/uniseg@v0.4.4 | 9 - .../lookup/github.com/rivo/uniseg@v0.4.7 | 9 + .../lookup/github.com/stretchr/objx@v0.1.0 | 6 +- .../lookup/github.com/stretchr/objx@v0.4.0 | 6 +- .../lookup/github.com/stretchr/objx@v0.5.0 | 6 +- .../lookup/github.com/stretchr/testify@v1.7.0 | 6 +- .../lookup/github.com/stretchr/testify@v1.7.1 | 6 +- .../lookup/github.com/stretchr/testify@v1.8.0 | 6 +- .../lookup/github.com/stretchr/testify@v1.8.1 | 6 +- .../lookup/go.uber.org/multierr@v1.11.0 | 6 +- .../x/exp@v0.0.0-20230809094429-853ea248256d | 9 - .../x/exp@v0.0.0-20240409090435-93d18d7e34b8 | 9 + .../x/sys@v0.0.0-20211019181941-9d821ace8654 | 6 +- .../x/sys@v0.0.0-20211216021012-1d35b9e2eb4e | 9 - .../sum.golang.org/lookup/golang.org/x/sys@v0.11.0 | 9 - .../sum.golang.org/lookup/golang.org/x/sys@v0.19.0 | 9 + .../x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 | 6 +- .../x/xerrors@v0.0.0-20231012003039-104605ab7028 | 9 + .../yaml.v3@v3.0.0-20200313102051-9f266ea9e77c | 6 +- .../sumdb/sum.golang.org/tile/8/0/x032/849 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x055/239 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x061/424 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x063/929 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x068/671 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x073/736 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/030 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/030.p/198 | Bin 6336 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/031 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/033 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/034 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/035 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/036 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/037 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/037.p/124 | Bin 3968 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/038 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/038.p/229 | Bin 7328 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x074/039.p/138 | Bin 4416 -> 0 bytes .../sumdb/sum.golang.org/tile/8/0/x078/105 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x078/530 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x080/086 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x088/466 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x097/483 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x097/509 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x097/821 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/031 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/031.p/226 | Bin 0 -> 7232 bytes .../sumdb/sum.golang.org/tile/8/0/x098/032 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/033 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/034 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/035 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/036 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/037 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/0/x098/038.p/224 | Bin 0 -> 7168 bytes .../sumdb/sum.golang.org/tile/8/0/x098/038.p/227 | Bin 0 -> 7264 bytes .../download/sumdb/sum.golang.org/tile/8/1/128 | Bin 8192 -> 0 bytes .../download/sumdb/sum.golang.org/tile/8/1/215 | Bin 8192 -> 0 bytes .../download/sumdb/sum.golang.org/tile/8/1/239 | Bin 8192 -> 0 bytes .../download/sumdb/sum.golang.org/tile/8/1/249 | Bin 8192 -> 0 bytes .../download/sumdb/sum.golang.org/tile/8/1/268 | Bin 8192 -> 0 bytes .../download/sumdb/sum.golang.org/tile/8/1/288 | Bin 8192 -> 0 bytes .../sumdb/sum.golang.org/tile/8/1/289.p/46 | Bin 1472 -> 0 bytes .../sumdb/sum.golang.org/tile/8/1/289.p/53 | Bin 1696 -> 0 bytes .../sumdb/sum.golang.org/tile/8/1/289.p/54 | Bin 1728 -> 0 bytes .../sumdb/sum.golang.org/tile/8/1/289.p/55 | Bin 1760 -> 0 bytes .../download/sumdb/sum.golang.org/tile/8/1/305 | Bin 0 -> 8192 bytes .../download/sumdb/sum.golang.org/tile/8/1/306 | Bin 0 -> 8192 bytes .../download/sumdb/sum.golang.org/tile/8/1/312 | Bin 0 -> 8192 bytes .../download/sumdb/sum.golang.org/tile/8/1/345 | Bin 0 -> 8192 bytes .../download/sumdb/sum.golang.org/tile/8/1/380 | Bin 0 -> 8192 bytes .../sumdb/sum.golang.org/tile/8/1/382.p/239 | Bin 0 -> 7648 bytes .../sumdb/sum.golang.org/tile/8/1/382.p/246 | Bin 0 -> 7872 bytes .../sumdb/sum.golang.org/tile/8/2/001.p/126 | Bin 0 -> 4032 bytes .../sumdb/sum.golang.org/tile/8/2/001.p/33 | Bin 1056 -> 0 bytes .../edwards25519@v1.1.0/.github/workflows/test.yml | 17 + .../pkg/mod/filippo.io/edwards25519@v1.1.0/LICENSE | 27 + .../mod/filippo.io/edwards25519@v1.1.0/README.md | 14 + .../pkg/mod/filippo.io/edwards25519@v1.1.0/doc.go | 20 + .../filippo.io/edwards25519@v1.1.0/edwards25519.go | 427 + .../edwards25519@v1.1.0/edwards25519_test.go | 311 + .../mod/filippo.io/edwards25519@v1.1.0/extra.go | 349 + .../filippo.io/edwards25519@v1.1.0/extra_test.go | 220 + .../mod/filippo.io/edwards25519@v1.1.0/field/fe.go | 420 + .../edwards25519@v1.1.0/field/fe_alias_test.go | 140 + .../edwards25519@v1.1.0/field/fe_amd64.go | 16 + .../edwards25519@v1.1.0/field/fe_amd64.s | 379 + .../edwards25519@v1.1.0/field/fe_amd64_noasm.go | 12 + .../edwards25519@v1.1.0/field/fe_arm64.go | 16 + .../edwards25519@v1.1.0/field/fe_arm64.s | 42 + .../edwards25519@v1.1.0/field/fe_arm64_noasm.go | 12 + .../edwards25519@v1.1.0/field/fe_bench_test.go | 49 + .../edwards25519@v1.1.0/field/fe_extra.go | 50 + .../edwards25519@v1.1.0/field/fe_extra_test.go | 37 + .../edwards25519@v1.1.0/field/fe_generic.go | 266 + .../edwards25519@v1.1.0/field/fe_test.go | 566 + .../pkg/mod/filippo.io/edwards25519@v1.1.0/go.mod | 3 + .../mod/filippo.io/edwards25519@v1.1.0/scalar.go | 343 + .../edwards25519@v1.1.0/scalar_alias_test.go | 111 + .../filippo.io/edwards25519@v1.1.0/scalar_fiat.go | 1147 + .../filippo.io/edwards25519@v1.1.0/scalar_test.go | 255 + .../filippo.io/edwards25519@v1.1.0/scalarmult.go | 214 + .../edwards25519@v1.1.0/scalarmult_test.go | 205 + .../mod/filippo.io/edwards25519@v1.1.0/tables.go | 129 + .../filippo.io/edwards25519@v1.1.0/tables_test.go | 119 + .../xxhash/v2@v2.1.2/.github/workflows/test.yml | 32 - .../cespare/xxhash/v2@v2.1.2/LICENSE.txt | 22 - .../github.com/cespare/xxhash/v2@v2.1.2/README.md | 69 - .../cespare/xxhash/v2@v2.1.2/bench_test.go | 74 - .../cespare/xxhash/v2@v2.1.2/dynamic/.gitignore | 1 - .../xxhash/v2@v2.1.2/dynamic/dynamic_test.go | 46 - .../cespare/xxhash/v2@v2.1.2/dynamic/plugin.go | 46 - .../mod/github.com/cespare/xxhash/v2@v2.1.2/go.mod | 3 - .../mod/github.com/cespare/xxhash/v2@v2.1.2/go.sum | 0 .../github.com/cespare/xxhash/v2@v2.1.2/xxhash.go | 235 - .../cespare/xxhash/v2@v2.1.2/xxhash_amd64.go | 13 - .../cespare/xxhash/v2@v2.1.2/xxhash_amd64.s | 215 - .../cespare/xxhash/v2@v2.1.2/xxhash_other.go | 76 - .../cespare/xxhash/v2@v2.1.2/xxhash_safe.go | 15 - .../cespare/xxhash/v2@v2.1.2/xxhash_test.go | 166 - .../cespare/xxhash/v2@v2.1.2/xxhash_unsafe.go | 57 - .../cespare/xxhash/v2@v2.1.2/xxhash_unsafe_test.go | 61 - .../cespare/xxhash/v2@v2.1.2/xxhsum/.gitignore | 1 - .../cespare/xxhash/v2@v2.1.2/xxhsum/xxhsum.go | 50 - .../xxhash/v2@v2.2.0/.github/workflows/test.yml | 56 + .../cespare/xxhash/v2@v2.2.0/LICENSE.txt | 22 + .../github.com/cespare/xxhash/v2@v2.2.0/README.md | 72 + .../cespare/xxhash/v2@v2.2.0/bench_test.go | 75 + .../cespare/xxhash/v2@v2.2.0/dynamic/.gitignore | 1 + .../xxhash/v2@v2.2.0/dynamic/dynamic_test.go | 48 + .../cespare/xxhash/v2@v2.2.0/dynamic/plugin.go | 47 + .../mod/github.com/cespare/xxhash/v2@v2.2.0/go.mod | 3 + .../mod/github.com/cespare/xxhash/v2@v2.2.0/go.sum | 0 .../github.com/cespare/xxhash/v2@v2.2.0/testall.sh | 10 + .../github.com/cespare/xxhash/v2@v2.2.0/xxhash.go | 228 + .../cespare/xxhash/v2@v2.2.0/xxhash_amd64.s | 209 + .../cespare/xxhash/v2@v2.2.0/xxhash_arm64.s | 183 + .../cespare/xxhash/v2@v2.2.0/xxhash_asm.go | 15 + .../cespare/xxhash/v2@v2.2.0/xxhash_other.go | 76 + .../cespare/xxhash/v2@v2.2.0/xxhash_safe.go | 16 + .../cespare/xxhash/v2@v2.2.0/xxhash_test.go | 166 + .../cespare/xxhash/v2@v2.2.0/xxhash_unsafe.go | 58 + .../cespare/xxhash/v2@v2.2.0/xxhash_unsafe_test.go | 60 + .../cespare/xxhash/v2@v2.2.0/xxhsum/.gitignore | 1 + .../cespare/xxhash/v2@v2.2.0/xxhsum/xxhsum.go | 50 + .../go-redis/redis/v8@v8.11.5/.github/FUNDING.yml | 1 - .../.github/ISSUE_TEMPLATE/bug_report.md | 49 - .../v8@v8.11.5/.github/ISSUE_TEMPLATE/config.yml | 5 - .../redis/v8@v8.11.5/.github/dependabot.yml | 10 - .../redis/v8@v8.11.5/.github/workflows/build.yml | 36 - .../v8@v8.11.5/.github/workflows/commitlint.yml | 11 - .../v8@v8.11.5/.github/workflows/golangci-lint.yml | 19 - .../redis/v8@v8.11.5/.github/workflows/release.yml | 17 - .../go-redis/redis/v8@v8.11.5/.gitignore | 3 - .../go-redis/redis/v8@v8.11.5/.golangci.yml | 4 - .../go-redis/redis/v8@v8.11.5/.prettierrc.yml | 4 - .../go-redis/redis/v8@v8.11.5/CHANGELOG.md | 177 - .../github.com/go-redis/redis/v8@v8.11.5/LICENSE | 25 - .../github.com/go-redis/redis/v8@v8.11.5/Makefile | 35 - .../github.com/go-redis/redis/v8@v8.11.5/README.md | 175 - .../go-redis/redis/v8@v8.11.5/RELEASING.md | 15 - .../go-redis/redis/v8@v8.11.5/bench_decode_test.go | 309 - .../go-redis/redis/v8@v8.11.5/bench_test.go | 412 - .../go-redis/redis/v8@v8.11.5/cluster.go | 1750 - .../go-redis/redis/v8@v8.11.5/cluster_commands.go | 109 - .../go-redis/redis/v8@v8.11.5/cluster_test.go | 1283 - .../go-redis/redis/v8@v8.11.5/command.go | 3478 - .../go-redis/redis/v8@v8.11.5/command_test.go | 96 - .../go-redis/redis/v8@v8.11.5/commands.go | 3475 - .../go-redis/redis/v8@v8.11.5/commands_test.go | 5522 - .../github.com/go-redis/redis/v8@v8.11.5/doc.go | 4 - .../github.com/go-redis/redis/v8@v8.11.5/error.go | 144 - .../v8@v8.11.5/example_instrumentation_test.go | 80 - .../go-redis/redis/v8@v8.11.5/example_test.go | 634 - .../go-redis/redis/v8@v8.11.5/export_test.go | 95 - .../go-redis/redis/v8@v8.11.5/fuzz/fuzz.go | 49 - .../github.com/go-redis/redis/v8@v8.11.5/go.mod | 20 - .../github.com/go-redis/redis/v8@v8.11.5/go.sum | 108 - .../go-redis/redis/v8@v8.11.5/internal/arg.go | 56 - .../redis/v8@v8.11.5/internal/hashtag/hashtag.go | 78 - .../v8@v8.11.5/internal/hashtag/hashtag_test.go | 71 - .../redis/v8@v8.11.5/internal/hscan/hscan.go | 201 - .../redis/v8@v8.11.5/internal/hscan/hscan_test.go | 178 - .../redis/v8@v8.11.5/internal/hscan/structmap.go | 93 - .../go-redis/redis/v8@v8.11.5/internal/internal.go | 29 - .../redis/v8@v8.11.5/internal/internal_test.go | 18 - .../go-redis/redis/v8@v8.11.5/internal/log.go | 26 - .../go-redis/redis/v8@v8.11.5/internal/once.go | 60 - .../redis/v8@v8.11.5/internal/pool/bench_test.go | 97 - .../redis/v8@v8.11.5/internal/pool/conn.go | 121 - .../redis/v8@v8.11.5/internal/pool/export_test.go | 9 - .../redis/v8@v8.11.5/internal/pool/main_test.go | 36 - .../redis/v8@v8.11.5/internal/pool/pool.go | 557 - .../redis/v8@v8.11.5/internal/pool/pool_single.go | 58 - .../redis/v8@v8.11.5/internal/pool/pool_sticky.go | 201 - .../redis/v8@v8.11.5/internal/pool/pool_test.go | 458 - .../redis/v8@v8.11.5/internal/proto/proto_test.go | 13 - .../redis/v8@v8.11.5/internal/proto/reader.go | 332 - .../redis/v8@v8.11.5/internal/proto/reader_test.go | 72 - .../redis/v8@v8.11.5/internal/proto/scan.go | 180 - .../redis/v8@v8.11.5/internal/proto/scan_test.go | 50 - .../redis/v8@v8.11.5/internal/proto/writer.go | 155 - .../redis/v8@v8.11.5/internal/proto/writer_test.go | 93 - .../redis/v8@v8.11.5/internal/rand/rand.go | 50 - .../go-redis/redis/v8@v8.11.5/internal/safe.go | 12 - .../go-redis/redis/v8@v8.11.5/internal/unsafe.go | 21 - .../go-redis/redis/v8@v8.11.5/internal/util.go | 46 - .../redis/v8@v8.11.5/internal/util/safe.go | 12 - .../redis/v8@v8.11.5/internal/util/strconv.go | 19 - .../redis/v8@v8.11.5/internal/util/unsafe.go | 23 - .../go-redis/redis/v8@v8.11.5/internal_test.go | 67 - .../go-redis/redis/v8@v8.11.5/iterator.go | 77 - .../go-redis/redis/v8@v8.11.5/iterator_test.go | 136 - .../go-redis/redis/v8@v8.11.5/main_test.go | 448 - .../go-redis/redis/v8@v8.11.5/options.go | 429 - .../go-redis/redis/v8@v8.11.5/options_test.go | 216 - .../go-redis/redis/v8@v8.11.5/package.json | 8 - .../go-redis/redis/v8@v8.11.5/pipeline.go | 147 - .../go-redis/redis/v8@v8.11.5/pipeline_test.go | 104 - .../go-redis/redis/v8@v8.11.5/pool_test.go | 157 - .../github.com/go-redis/redis/v8@v8.11.5/pubsub.go | 668 - .../go-redis/redis/v8@v8.11.5/pubsub_test.go | 495 - .../go-redis/redis/v8@v8.11.5/race_test.go | 392 - .../github.com/go-redis/redis/v8@v8.11.5/redis.go | 773 - .../go-redis/redis/v8@v8.11.5/redis_test.go | 449 - .../github.com/go-redis/redis/v8@v8.11.5/result.go | 180 - .../github.com/go-redis/redis/v8@v8.11.5/ring.go | 736 - .../go-redis/redis/v8@v8.11.5/ring_test.go | 645 - .../github.com/go-redis/redis/v8@v8.11.5/script.go | 65 - .../go-redis/redis/v8@v8.11.5/scripts/bump_deps.sh | 9 - .../go-redis/redis/v8@v8.11.5/scripts/release.sh | 69 - .../go-redis/redis/v8@v8.11.5/scripts/tag.sh | 42 - .../go-redis/redis/v8@v8.11.5/sentinel.go | 796 - .../go-redis/redis/v8@v8.11.5/sentinel_test.go | 287 - .../go-redis/redis/v8@v8.11.5/testdata/redis.conf | 10 - .../mod/github.com/go-redis/redis/v8@v8.11.5/tx.go | 149 - .../go-redis/redis/v8@v8.11.5/tx_test.go | 151 - .../go-redis/redis/v8@v8.11.5/universal.go | 215 - .../go-redis/redis/v8@v8.11.5/universal_test.go | 40 - .../go-redis/redis/v8@v8.11.5/version.go | 6 - .../mysql@v1.7.1/.github/CONTRIBUTING.md | 23 - .../mysql@v1.7.1/.github/ISSUE_TEMPLATE.md | 21 - .../mysql@v1.7.1/.github/PULL_REQUEST_TEMPLATE.md | 9 - .../mysql@v1.7.1/.github/workflows/codeql.yml | 41 - .../mysql@v1.7.1/.github/workflows/test.yml | 110 - .../go-sql-driver/mysql@v1.7.1/.gitignore | 9 - .../github.com/go-sql-driver/mysql@v1.7.1/AUTHORS | 126 - .../go-sql-driver/mysql@v1.7.1/CHANGELOG.md | 266 - .../github.com/go-sql-driver/mysql@v1.7.1/LICENSE | 373 - .../go-sql-driver/mysql@v1.7.1/README.md | 531 - .../go-sql-driver/mysql@v1.7.1/atomic_bool.go | 19 - .../mysql@v1.7.1/atomic_bool_go118.go | 47 - .../go-sql-driver/mysql@v1.7.1/atomic_bool_test.go | 71 - .../github.com/go-sql-driver/mysql@v1.7.1/auth.go | 437 - .../go-sql-driver/mysql@v1.7.1/auth_test.go | 1330 - .../go-sql-driver/mysql@v1.7.1/benchmark_test.go | 374 - .../go-sql-driver/mysql@v1.7.1/buffer.go | 182 - .../go-sql-driver/mysql@v1.7.1/collations.go | 266 - .../go-sql-driver/mysql@v1.7.1/conncheck.go | 55 - .../go-sql-driver/mysql@v1.7.1/conncheck_dummy.go | 18 - .../go-sql-driver/mysql@v1.7.1/conncheck_test.go | 39 - .../go-sql-driver/mysql@v1.7.1/connection.go | 650 - .../go-sql-driver/mysql@v1.7.1/connection_test.go | 203 - .../go-sql-driver/mysql@v1.7.1/connector.go | 146 - .../go-sql-driver/mysql@v1.7.1/connector_test.go | 30 - .../github.com/go-sql-driver/mysql@v1.7.1/const.go | 174 - .../go-sql-driver/mysql@v1.7.1/driver.go | 107 - .../go-sql-driver/mysql@v1.7.1/driver_test.go | 3211 - .../github.com/go-sql-driver/mysql@v1.7.1/dsn.go | 577 - .../go-sql-driver/mysql@v1.7.1/dsn_test.go | 417 - .../go-sql-driver/mysql@v1.7.1/errors.go | 77 - .../go-sql-driver/mysql@v1.7.1/errors_test.go | 61 - .../go-sql-driver/mysql@v1.7.1/fields.go | 206 - .../github.com/go-sql-driver/mysql@v1.7.1/fuzz.go | 25 - .../github.com/go-sql-driver/mysql@v1.7.1/go.mod | 3 - .../go-sql-driver/mysql@v1.7.1/infile.go | 182 - .../go-sql-driver/mysql@v1.7.1/nulltime.go | 71 - .../go-sql-driver/mysql@v1.7.1/nulltime_test.go | 62 - .../go-sql-driver/mysql@v1.7.1/packets.go | 1349 - .../go-sql-driver/mysql@v1.7.1/packets_test.go | 336 - .../go-sql-driver/mysql@v1.7.1/result.go | 22 - .../github.com/go-sql-driver/mysql@v1.7.1/rows.go | 223 - .../go-sql-driver/mysql@v1.7.1/statement.go | 220 - .../go-sql-driver/mysql@v1.7.1/statement_test.go | 151 - .../go-sql-driver/mysql@v1.7.1/transaction.go | 31 - .../github.com/go-sql-driver/mysql@v1.7.1/utils.go | 834 - .../go-sql-driver/mysql@v1.7.1/utils_test.go | 477 - .../mysql@v1.8.1/.github/CONTRIBUTING.md | 23 + .../mysql@v1.8.1/.github/ISSUE_TEMPLATE.md | 21 + .../mysql@v1.8.1/.github/PULL_REQUEST_TEMPLATE.md | 9 + .../mysql@v1.8.1/.github/workflows/codeql.yml | 41 + .../mysql@v1.8.1/.github/workflows/test.yml | 116 + .../go-sql-driver/mysql@v1.8.1/.gitignore | 9 + .../github.com/go-sql-driver/mysql@v1.8.1/AUTHORS | 142 + .../go-sql-driver/mysql@v1.8.1/CHANGELOG.md | 308 + .../github.com/go-sql-driver/mysql@v1.8.1/LICENSE | 373 + .../go-sql-driver/mysql@v1.8.1/README.md | 581 + .../go-sql-driver/mysql@v1.8.1/atomic_bool.go | 19 + .../mysql@v1.8.1/atomic_bool_go118.go | 47 + .../go-sql-driver/mysql@v1.8.1/atomic_bool_test.go | 71 + .../github.com/go-sql-driver/mysql@v1.8.1/auth.go | 484 + .../go-sql-driver/mysql@v1.8.1/auth_test.go | 1381 + .../go-sql-driver/mysql@v1.8.1/benchmark_test.go | 430 + .../go-sql-driver/mysql@v1.8.1/buffer.go | 182 + .../go-sql-driver/mysql@v1.8.1/collations.go | 266 + .../go-sql-driver/mysql@v1.8.1/conncheck.go | 55 + .../go-sql-driver/mysql@v1.8.1/conncheck_dummy.go | 18 + .../go-sql-driver/mysql@v1.8.1/conncheck_test.go | 39 + .../go-sql-driver/mysql@v1.8.1/connection.go | 688 + .../go-sql-driver/mysql@v1.8.1/connection_test.go | 204 + .../go-sql-driver/mysql@v1.8.1/connector.go | 197 + .../go-sql-driver/mysql@v1.8.1/connector_test.go | 30 + .../github.com/go-sql-driver/mysql@v1.8.1/const.go | 187 + .../go-sql-driver/mysql@v1.8.1/driver.go | 118 + .../go-sql-driver/mysql@v1.8.1/driver_test.go | 3612 + .../github.com/go-sql-driver/mysql@v1.8.1/dsn.go | 653 + .../go-sql-driver/mysql@v1.8.1/dsn_fuzz_test.go | 47 + .../go-sql-driver/mysql@v1.8.1/dsn_test.go | 438 + .../go-sql-driver/mysql@v1.8.1/errors.go | 83 + .../go-sql-driver/mysql@v1.8.1/errors_test.go | 61 + .../go-sql-driver/mysql@v1.8.1/fields.go | 222 + .../github.com/go-sql-driver/mysql@v1.8.1/go.mod | 5 + .../github.com/go-sql-driver/mysql@v1.8.1/go.sum | 2 + .../go-sql-driver/mysql@v1.8.1/infile.go | 182 + .../go-sql-driver/mysql@v1.8.1/nulltime.go | 71 + .../go-sql-driver/mysql@v1.8.1/nulltime_test.go | 62 + .../go-sql-driver/mysql@v1.8.1/packets.go | 1406 + .../go-sql-driver/mysql@v1.8.1/packets_test.go | 343 + .../go-sql-driver/mysql@v1.8.1/result.go | 50 + .../github.com/go-sql-driver/mysql@v1.8.1/rows.go | 232 + .../go-sql-driver/mysql@v1.8.1/statement.go | 217 + .../go-sql-driver/mysql@v1.8.1/statement_test.go | 151 + .../go-sql-driver/mysql@v1.8.1/transaction.go | 31 + .../github.com/go-sql-driver/mysql@v1.8.1/utils.go | 843 + .../go-sql-driver/mysql@v1.8.1/utils_test.go | 520 + .../github.com/goccy/go-yaml@v1.11.0/.codecov.yml | 31 - .../goccy/go-yaml@v1.11.0/.github/FUNDING.yml | 1 - .../goccy/go-yaml@v1.11.0/.github/workflows/go.yml | 79 - .../github.com/goccy/go-yaml@v1.11.0/CHANGELOG.md | 163 - .../mod/github.com/goccy/go-yaml@v1.11.0/LICENSE | 21 - .../mod/github.com/goccy/go-yaml@v1.11.0/Makefile | 19 - .../mod/github.com/goccy/go-yaml@v1.11.0/README.md | 370 - .../github.com/goccy/go-yaml@v1.11.0/ast/ast.go | 2117 - .../goccy/go-yaml@v1.11.0/ast/ast_test.go | 36 - .../goccy/go-yaml@v1.11.0/cmd/ycat/ycat.go | 83 - .../mod/github.com/goccy/go-yaml@v1.11.0/decode.go | 1753 - .../goccy/go-yaml@v1.11.0/decode_test.go | 2872 - .../mod/github.com/goccy/go-yaml@v1.11.0/encode.go | 871 - .../goccy/go-yaml@v1.11.0/encode_test.go | 1593 - .../mod/github.com/goccy/go-yaml@v1.11.0/error.go | 62 - .../mod/github.com/goccy/go-yaml@v1.11.0/go.mod | 20 - .../mod/github.com/goccy/go-yaml@v1.11.0/go.sum | 44 - .../goccy/go-yaml@v1.11.0/internal/errors/error.go | 260 - .../goccy/go-yaml@v1.11.0/lexer/lexer.go | 23 - .../goccy/go-yaml@v1.11.0/lexer/lexer_test.go | 621 - .../mod/github.com/goccy/go-yaml@v1.11.0/option.go | 278 - .../goccy/go-yaml@v1.11.0/parser/context.go | 199 - .../goccy/go-yaml@v1.11.0/parser/parser.go | 714 - .../goccy/go-yaml@v1.11.0/parser/parser_test.go | 886 - .../goccy/go-yaml@v1.11.0/parser/testdata/cr.yml | 1 - .../goccy/go-yaml@v1.11.0/parser/testdata/crlf.yml | 3 - .../goccy/go-yaml@v1.11.0/parser/testdata/lf.yml | 3 - .../mod/github.com/goccy/go-yaml@v1.11.0/path.go | 794 - .../github.com/goccy/go-yaml@v1.11.0/path_test.go | 659 - .../goccy/go-yaml@v1.11.0/printer/printer.go | 352 - .../goccy/go-yaml@v1.11.0/printer/printer_test.go | 223 - .../goccy/go-yaml@v1.11.0/scanner/context.go | 229 - .../goccy/go-yaml@v1.11.0/scanner/scanner.go | 903 - .../goccy/go-yaml@v1.11.0/stdlib_quote.go | 103 - .../mod/github.com/goccy/go-yaml@v1.11.0/struct.go | 130 - .../goccy/go-yaml@v1.11.0/testdata/anchor.yml | 3 - .../goccy/go-yaml@v1.11.0/token/token.go | 1070 - .../goccy/go-yaml@v1.11.0/token/token_test.go | 135 - .../github.com/goccy/go-yaml@v1.11.0/validate.go | 13 - .../goccy/go-yaml@v1.11.0/validate_test.go | 198 - .../mod/github.com/goccy/go-yaml@v1.11.0/yaml.go | 290 - .../github.com/goccy/go-yaml@v1.11.0/yaml_test.go | 1195 - .../github.com/goccy/go-yaml@v1.11.3/.codecov.yml | 31 + .../goccy/go-yaml@v1.11.3/.github/FUNDING.yml | 1 + .../.github/ISSUE_TEMPLATE/bug_report.md | 29 + .../.github/ISSUE_TEMPLATE/feature_request.md | 20 + .../.github/pull_request_template.md | 4 + .../goccy/go-yaml@v1.11.3/.github/workflows/go.yml | 79 + .../github.com/goccy/go-yaml@v1.11.3/CHANGELOG.md | 186 + .../mod/github.com/goccy/go-yaml@v1.11.3/LICENSE | 21 + .../mod/github.com/goccy/go-yaml@v1.11.3/Makefile | 19 + .../mod/github.com/goccy/go-yaml@v1.11.3/README.md | 370 + .../github.com/goccy/go-yaml@v1.11.3/ast/ast.go | 2115 + .../goccy/go-yaml@v1.11.3/ast/ast_test.go | 36 + .../goccy/go-yaml@v1.11.3/cmd/ycat/ycat.go | 83 + .../mod/github.com/goccy/go-yaml@v1.11.3/decode.go | 1753 + .../goccy/go-yaml@v1.11.3/decode_test.go | 2908 + .../mod/github.com/goccy/go-yaml@v1.11.3/encode.go | 875 + .../goccy/go-yaml@v1.11.3/encode_test.go | 1632 + .../mod/github.com/goccy/go-yaml@v1.11.3/error.go | 62 + .../mod/github.com/goccy/go-yaml@v1.11.3/go.mod | 20 + .../mod/github.com/goccy/go-yaml@v1.11.3/go.sum | 44 + .../goccy/go-yaml@v1.11.3/internal/errors/error.go | 260 + .../goccy/go-yaml@v1.11.3/lexer/lexer.go | 23 + .../goccy/go-yaml@v1.11.3/lexer/lexer_test.go | 621 + .../mod/github.com/goccy/go-yaml@v1.11.3/option.go | 278 + .../goccy/go-yaml@v1.11.3/parser/context.go | 192 + .../goccy/go-yaml@v1.11.3/parser/parser.go | 743 + .../goccy/go-yaml@v1.11.3/parser/parser_test.go | 1010 + .../goccy/go-yaml@v1.11.3/parser/testdata/cr.yml | 1 + .../goccy/go-yaml@v1.11.3/parser/testdata/crlf.yml | 3 + .../goccy/go-yaml@v1.11.3/parser/testdata/lf.yml | 3 + .../mod/github.com/goccy/go-yaml@v1.11.3/path.go | 814 + .../github.com/goccy/go-yaml@v1.11.3/path_test.go | 666 + .../goccy/go-yaml@v1.11.3/printer/printer.go | 352 + .../goccy/go-yaml@v1.11.3/printer/printer_test.go | 223 + .../goccy/go-yaml@v1.11.3/scanner/context.go | 236 + .../goccy/go-yaml@v1.11.3/scanner/scanner.go | 908 + .../goccy/go-yaml@v1.11.3/stdlib_quote.go | 103 + .../mod/github.com/goccy/go-yaml@v1.11.3/struct.go | 130 + .../goccy/go-yaml@v1.11.3/testdata/anchor.yml | 3 + .../goccy/go-yaml@v1.11.3/token/token.go | 1070 + .../goccy/go-yaml@v1.11.3/token/token_test.go | 138 + .../github.com/goccy/go-yaml@v1.11.3/validate.go | 13 + .../goccy/go-yaml@v1.11.3/validate_test.go | 198 + .../mod/github.com/goccy/go-yaml@v1.11.3/yaml.go | 288 + .../github.com/goccy/go-yaml@v1.11.3/yaml_test.go | 1284 + .../mod/github.com/google/uuid@v1.3.0/.travis.yml | 9 - .../github.com/google/uuid@v1.3.0/CONTRIBUTING.md | 10 - .../mod/github.com/google/uuid@v1.3.0/CONTRIBUTORS | 9 - .../pkg/mod/github.com/google/uuid@v1.3.0/LICENSE | 27 - .../mod/github.com/google/uuid@v1.3.0/README.md | 19 - .../pkg/mod/github.com/google/uuid@v1.3.0/dce.go | 80 - .../pkg/mod/github.com/google/uuid@v1.3.0/doc.go | 12 - .../pkg/mod/github.com/google/uuid@v1.3.0/go.mod | 1 - .../pkg/mod/github.com/google/uuid@v1.3.0/hash.go | 53 - .../mod/github.com/google/uuid@v1.3.0/json_test.go | 62 - .../mod/github.com/google/uuid@v1.3.0/marshal.go | 38 - .../pkg/mod/github.com/google/uuid@v1.3.0/node.go | 90 - .../mod/github.com/google/uuid@v1.3.0/node_js.go | 12 - .../mod/github.com/google/uuid@v1.3.0/node_net.go | 33 - .../pkg/mod/github.com/google/uuid@v1.3.0/null.go | 118 - .../mod/github.com/google/uuid@v1.3.0/null_test.go | 214 - .../mod/github.com/google/uuid@v1.3.0/seq_test.go | 66 - .../pkg/mod/github.com/google/uuid@v1.3.0/sql.go | 59 - .../mod/github.com/google/uuid@v1.3.0/sql_test.go | 113 - .../pkg/mod/github.com/google/uuid@v1.3.0/time.go | 123 - .../pkg/mod/github.com/google/uuid@v1.3.0/util.go | 43 - .../pkg/mod/github.com/google/uuid@v1.3.0/uuid.go | 294 - .../mod/github.com/google/uuid@v1.3.0/uuid_test.go | 702 - .../mod/github.com/google/uuid@v1.3.0/version1.go | 44 - .../mod/github.com/google/uuid@v1.3.0/version4.go | 76 - .../google/uuid@v1.6.0/.github/CODEOWNERS | 6 + .../google/uuid@v1.6.0/.github/release-please.yml | 2 + .../uuid@v1.6.0/.github/workflows/apidiff.yaml | 26 + .../uuid@v1.6.0/.github/workflows/tests.yaml | 20 + .../mod/github.com/google/uuid@v1.6.0/CHANGELOG.md | 41 + .../github.com/google/uuid@v1.6.0/CONTRIBUTING.md | 26 + .../mod/github.com/google/uuid@v1.6.0/CONTRIBUTORS | 9 + .../pkg/mod/github.com/google/uuid@v1.6.0/LICENSE | 27 + .../mod/github.com/google/uuid@v1.6.0/README.md | 21 + .../pkg/mod/github.com/google/uuid@v1.6.0/dce.go | 80 + .../pkg/mod/github.com/google/uuid@v1.6.0/doc.go | 12 + .../pkg/mod/github.com/google/uuid@v1.6.0/go.mod | 1 + .../pkg/mod/github.com/google/uuid@v1.6.0/hash.go | 59 + .../mod/github.com/google/uuid@v1.6.0/json_test.go | 113 + .../mod/github.com/google/uuid@v1.6.0/marshal.go | 38 + .../pkg/mod/github.com/google/uuid@v1.6.0/node.go | 90 + .../mod/github.com/google/uuid@v1.6.0/node_js.go | 12 + .../mod/github.com/google/uuid@v1.6.0/node_net.go | 33 + .../pkg/mod/github.com/google/uuid@v1.6.0/null.go | 118 + .../mod/github.com/google/uuid@v1.6.0/null_test.go | 214 + .../mod/github.com/google/uuid@v1.6.0/seq_test.go | 66 + .../pkg/mod/github.com/google/uuid@v1.6.0/sql.go | 59 + .../mod/github.com/google/uuid@v1.6.0/sql_test.go | 113 + .../pkg/mod/github.com/google/uuid@v1.6.0/time.go | 134 + .../pkg/mod/github.com/google/uuid@v1.6.0/util.go | 43 + .../pkg/mod/github.com/google/uuid@v1.6.0/uuid.go | 365 + .../mod/github.com/google/uuid@v1.6.0/uuid_test.go | 930 + .../mod/github.com/google/uuid@v1.6.0/version1.go | 44 + .../mod/github.com/google/uuid@v1.6.0/version4.go | 76 + .../mod/github.com/google/uuid@v1.6.0/version6.go | 56 + .../mod/github.com/google/uuid@v1.6.0/version7.go | 104 + .../mattn/go-sqlite3@v1.14.17/.codecov.yml | 4 - .../mattn/go-sqlite3@v1.14.17/.github/FUNDING.yml | 8 - .../.github/workflows/cifuzz.yaml | 29 - .../.github/workflows/docker.yaml | 22 - .../go-sqlite3@v1.14.17/.github/workflows/go.yaml | 115 - .../mattn/go-sqlite3@v1.14.17/.gitignore | 14 - .../github.com/mattn/go-sqlite3@v1.14.17/LICENSE | 21 - .../github.com/mattn/go-sqlite3@v1.14.17/README.md | 603 - .../_example/custom_driver_name/Makefile | 12 - .../_example/custom_driver_name/main.go | 13 - .../_example/custom_func/main.go | 133 - .../_example/fuzz/fuzz_openexec.go | 30 - .../go-sqlite3@v1.14.17/_example/hook/hook.go | 78 - .../go-sqlite3@v1.14.17/_example/limit/limit.go | 113 - .../_example/mod_regexp/Makefile | 27 - .../_example/mod_regexp/extension.go | 43 - .../_example/mod_regexp/sqlite3_mod_regexp.c | 35 - .../_example/mod_vtable/Makefile | 29 - .../_example/mod_vtable/extension.go | 37 - .../_example/mod_vtable/picojson.h | 1040 - .../_example/mod_vtable/sqlite3_mod_vtable.cc | 238 - .../go-sqlite3@v1.14.17/_example/simple/Dockerfile | 45 - .../go-sqlite3@v1.14.17/_example/simple/simple.go | 109 - .../go-sqlite3@v1.14.17/_example/trace/main.go | 264 - .../go-sqlite3@v1.14.17/_example/vtable/main.go | 38 - .../go-sqlite3@v1.14.17/_example/vtable/vtable.go | 116 - .../_example/vtable_eponymous_only/main.go | 33 - .../_example/vtable_eponymous_only/vtable.go | 118 - .../github.com/mattn/go-sqlite3@v1.14.17/backup.go | 85 - .../mattn/go-sqlite3@v1.14.17/backup_test.go | 294 - .../mattn/go-sqlite3@v1.14.17/callback.go | 411 - .../mattn/go-sqlite3@v1.14.17/callback_test.go | 116 - .../mattn/go-sqlite3@v1.14.17/convert.go | 299 - .../github.com/mattn/go-sqlite3@v1.14.17/doc.go | 135 - .../github.com/mattn/go-sqlite3@v1.14.17/error.go | 150 - .../mattn/go-sqlite3@v1.14.17/error_test.go | 275 - .../github.com/mattn/go-sqlite3@v1.14.17/go.mod | 7 - .../github.com/mattn/go-sqlite3@v1.14.17/go.sum | 0 .../mattn/go-sqlite3@v1.14.17/sqlite3-binding.c | 247989 ----------------- .../mattn/go-sqlite3@v1.14.17/sqlite3-binding.h | 13169 - .../mattn/go-sqlite3@v1.14.17/sqlite3.go | 2262 - .../mattn/go-sqlite3@v1.14.17/sqlite3_context.go | 103 - .../go-sqlite3@v1.14.17/sqlite3_func_crypt.go | 120 - .../go-sqlite3@v1.14.17/sqlite3_func_crypt_test.go | 57 - .../go-sqlite3@v1.14.17/sqlite3_go113_test.go | 119 - .../mattn/go-sqlite3@v1.14.17/sqlite3_go18.go | 54 - .../mattn/go-sqlite3@v1.14.17/sqlite3_go18_test.go | 503 - .../go-sqlite3@v1.14.17/sqlite3_libsqlite3.go | 21 - .../go-sqlite3@v1.14.17/sqlite3_load_extension.go | 84 - .../sqlite3_load_extension_omit.go | 24 - .../sqlite3_load_extension_test.go | 63 - .../sqlite3_opt_allow_uri_authority.go | 15 - .../go-sqlite3@v1.14.17/sqlite3_opt_app_armor.go | 16 - .../sqlite3_opt_column_metadata.go | 21 - .../sqlite3_opt_column_metadata_test.go | 39 - .../sqlite3_opt_foreign_keys.go | 15 - .../go-sqlite3@v1.14.17/sqlite3_opt_fts3_test.go | 132 - .../mattn/go-sqlite3@v1.14.17/sqlite3_opt_fts5.go | 14 - .../mattn/go-sqlite3@v1.14.17/sqlite3_opt_icu.go | 19 - .../go-sqlite3@v1.14.17/sqlite3_opt_introspect.go | 15 - .../sqlite3_opt_math_functions.go | 14 - .../sqlite3_opt_math_functions_test.go | 29 - .../go-sqlite3@v1.14.17/sqlite3_opt_os_trace.go | 15 - .../go-sqlite3@v1.14.17/sqlite3_opt_preupdate.go | 20 - .../sqlite3_opt_preupdate_hook.go | 112 - .../sqlite3_opt_preupdate_hook_test.go | 128 - .../sqlite3_opt_preupdate_omit.go | 21 - .../sqlite3_opt_secure_delete.go | 15 - .../sqlite3_opt_secure_delete_fast.go | 15 - .../go-sqlite3@v1.14.17/sqlite3_opt_serialize.go | 82 - .../sqlite3_opt_serialize_omit.go | 20 - .../sqlite3_opt_serialize_test.go | 99 - .../mattn/go-sqlite3@v1.14.17/sqlite3_opt_stat4.go | 15 - .../sqlite3_opt_unlock_notify.c | 85 - .../sqlite3_opt_unlock_notify.go | 93 - .../sqlite3_opt_unlock_notify_test.go | 222 - .../go-sqlite3@v1.14.17/sqlite3_opt_userauth.go | 289 - .../sqlite3_opt_userauth_omit.go | 152 - .../sqlite3_opt_userauth_test.go | 643 - .../go-sqlite3@v1.14.17/sqlite3_opt_vacuum_full.go | 15 - .../go-sqlite3@v1.14.17/sqlite3_opt_vacuum_incr.go | 15 - .../go-sqlite3@v1.14.17/sqlite3_opt_vtable.go | 720 - .../go-sqlite3@v1.14.17/sqlite3_opt_vtable_test.go | 609 - .../mattn/go-sqlite3@v1.14.17/sqlite3_other.go | 17 - .../mattn/go-sqlite3@v1.14.17/sqlite3_solaris.go | 14 - .../mattn/go-sqlite3@v1.14.17/sqlite3_test.go | 2570 - .../mattn/go-sqlite3@v1.14.17/sqlite3_trace.go | 287 - .../mattn/go-sqlite3@v1.14.17/sqlite3_type.go | 108 - .../go-sqlite3@v1.14.17/sqlite3_usleep_windows.go | 41 - .../mattn/go-sqlite3@v1.14.17/sqlite3_windows.go | 17 - .../mattn/go-sqlite3@v1.14.17/sqlite3ext.h | 718 - .../mattn/go-sqlite3@v1.14.17/static_mock.go | 37 - .../mattn/go-sqlite3@v1.14.22/.codecov.yml | 4 + .../mattn/go-sqlite3@v1.14.22/.github/FUNDING.yml | 8 + .../.github/workflows/cifuzz.yaml | 29 + .../.github/workflows/docker.yaml | 21 + .../go-sqlite3@v1.14.22/.github/workflows/go.yaml | 115 + .../mattn/go-sqlite3@v1.14.22/.gitignore | 14 + .../github.com/mattn/go-sqlite3@v1.14.22/LICENSE | 21 + .../github.com/mattn/go-sqlite3@v1.14.22/README.md | 603 + .../_example/custom_driver_name/Makefile | 12 + .../_example/custom_driver_name/main.go | 13 + .../_example/custom_func/main.go | 133 + .../_example/fuzz/fuzz_openexec.go | 30 + .../go-sqlite3@v1.14.22/_example/hook/hook.go | 78 + .../go-sqlite3@v1.14.22/_example/json/json.go | 81 + .../go-sqlite3@v1.14.22/_example/limit/limit.go | 113 + .../_example/mod_regexp/Makefile | 27 + .../_example/mod_regexp/extension.go | 43 + .../_example/mod_regexp/sqlite3_mod_regexp.c | 35 + .../_example/mod_vtable/Makefile | 29 + .../_example/mod_vtable/extension.go | 37 + .../_example/mod_vtable/picojson.h | 1040 + .../_example/mod_vtable/sqlite3_mod_vtable.cc | 238 + .../go-sqlite3@v1.14.22/_example/simple/Dockerfile | 47 + .../go-sqlite3@v1.14.22/_example/simple/simple.go | 109 + .../go-sqlite3@v1.14.22/_example/trace/main.go | 264 + .../go-sqlite3@v1.14.22/_example/vtable/main.go | 38 + .../go-sqlite3@v1.14.22/_example/vtable/vtable.go | 116 + .../_example/vtable_eponymous_only/main.go | 33 + .../_example/vtable_eponymous_only/vtable.go | 118 + .../github.com/mattn/go-sqlite3@v1.14.22/backup.go | 85 + .../mattn/go-sqlite3@v1.14.22/backup_test.go | 295 + .../mattn/go-sqlite3@v1.14.22/callback.go | 411 + .../mattn/go-sqlite3@v1.14.22/callback_test.go | 117 + .../mattn/go-sqlite3@v1.14.22/convert.go | 299 + .../github.com/mattn/go-sqlite3@v1.14.22/doc.go | 134 + .../github.com/mattn/go-sqlite3@v1.14.22/error.go | 150 + .../mattn/go-sqlite3@v1.14.22/error_test.go | 276 + .../github.com/mattn/go-sqlite3@v1.14.22/go.mod | 7 + .../github.com/mattn/go-sqlite3@v1.14.22/go.sum | 0 .../mattn/go-sqlite3@v1.14.22/sqlite3-binding.c | 256040 ++++++++++++++++++ .../mattn/go-sqlite3@v1.14.22/sqlite3-binding.h | 13456 + .../mattn/go-sqlite3@v1.14.22/sqlite3.go | 2281 + .../mattn/go-sqlite3@v1.14.22/sqlite3_context.go | 103 + .../go-sqlite3@v1.14.22/sqlite3_func_crypt.go | 120 + .../go-sqlite3@v1.14.22/sqlite3_func_crypt_test.go | 57 + .../go-sqlite3@v1.14.22/sqlite3_go113_test.go | 120 + .../mattn/go-sqlite3@v1.14.22/sqlite3_go18.go | 54 + .../mattn/go-sqlite3@v1.14.22/sqlite3_go18_test.go | 504 + .../go-sqlite3@v1.14.22/sqlite3_libsqlite3.go | 22 + .../go-sqlite3@v1.14.22/sqlite3_load_extension.go | 85 + .../sqlite3_load_extension_omit.go | 25 + .../sqlite3_load_extension_test.go | 64 + .../sqlite3_opt_allow_uri_authority.go | 16 + .../go-sqlite3@v1.14.22/sqlite3_opt_app_armor.go | 16 + .../sqlite3_opt_column_metadata.go | 22 + .../sqlite3_opt_column_metadata_test.go | 40 + .../sqlite3_opt_foreign_keys.go | 16 + .../go-sqlite3@v1.14.22/sqlite3_opt_fts3_test.go | 133 + .../mattn/go-sqlite3@v1.14.22/sqlite3_opt_fts5.go | 15 + .../mattn/go-sqlite3@v1.14.22/sqlite3_opt_icu.go | 20 + .../go-sqlite3@v1.14.22/sqlite3_opt_introspect.go | 16 + .../sqlite3_opt_math_functions.go | 15 + .../sqlite3_opt_math_functions_test.go | 30 + .../go-sqlite3@v1.14.22/sqlite3_opt_os_trace.go | 15 + .../go-sqlite3@v1.14.22/sqlite3_opt_preupdate.go | 21 + .../sqlite3_opt_preupdate_hook.go | 113 + .../sqlite3_opt_preupdate_hook_test.go | 129 + .../sqlite3_opt_preupdate_omit.go | 22 + .../sqlite3_opt_secure_delete.go | 16 + .../sqlite3_opt_secure_delete_fast.go | 16 + .../go-sqlite3@v1.14.22/sqlite3_opt_serialize.go | 83 + .../sqlite3_opt_serialize_omit.go | 21 + .../sqlite3_opt_serialize_test.go | 100 + .../mattn/go-sqlite3@v1.14.22/sqlite3_opt_stat4.go | 16 + .../sqlite3_opt_unlock_notify.c | 85 + .../sqlite3_opt_unlock_notify.go | 93 + .../sqlite3_opt_unlock_notify_test.go | 223 + .../go-sqlite3@v1.14.22/sqlite3_opt_userauth.go | 295 + .../sqlite3_opt_userauth_omit.go | 158 + .../sqlite3_opt_userauth_test.go | 644 + .../go-sqlite3@v1.14.22/sqlite3_opt_vacuum_full.go | 16 + .../go-sqlite3@v1.14.22/sqlite3_opt_vacuum_incr.go | 16 + .../go-sqlite3@v1.14.22/sqlite3_opt_vtable.go | 721 + .../go-sqlite3@v1.14.22/sqlite3_opt_vtable_test.go | 609 + .../mattn/go-sqlite3@v1.14.22/sqlite3_other.go | 18 + .../mattn/go-sqlite3@v1.14.22/sqlite3_solaris.go | 15 + .../mattn/go-sqlite3@v1.14.22/sqlite3_test.go | 2570 + .../mattn/go-sqlite3@v1.14.22/sqlite3_trace.go | 288 + .../mattn/go-sqlite3@v1.14.22/sqlite3_type.go | 108 + .../go-sqlite3@v1.14.22/sqlite3_usleep_windows.go | 42 + .../mattn/go-sqlite3@v1.14.22/sqlite3_windows.go | 18 + .../mattn/go-sqlite3@v1.14.22/sqlite3ext.h | 728 + .../mattn/go-sqlite3@v1.14.22/static_mock.go | 38 + .../redis/go-redis/v9@v9.5.1/.github/CODEOWNERS | 1 + .../redis/go-redis/v9@v9.5.1/.github/FUNDING.yml | 1 + .../v9@v9.5.1/.github/ISSUE_TEMPLATE/bug_report.md | 49 + .../v9@v9.5.1/.github/ISSUE_TEMPLATE/config.yml | 5 + .../go-redis/v9@v9.5.1/.github/dependabot.yml | 10 + .../v9@v9.5.1/.github/release-drafter-config.yml | 48 + .../v9@v9.5.1/.github/spellcheck-settings.yml | 29 + .../redis/go-redis/v9@v9.5.1/.github/wordlist.txt | 60 + .../go-redis/v9@v9.5.1/.github/workflows/build.yml | 39 + .../v9@v9.5.1/.github/workflows/doctests.yaml | 41 + .../v9@v9.5.1/.github/workflows/golangci-lint.yml | 26 + .../.github/workflows/release-drafter.yml | 24 + .../v9@v9.5.1/.github/workflows/spellcheck.yml | 14 + .../v9@v9.5.1/.github/workflows/stale-issues.yml | 25 + .../.github/workflows/test-redis-enterprise.yml | 59 + .../github.com/redis/go-redis/v9@v9.5.1/.gitignore | 6 + .../redis/go-redis/v9@v9.5.1/.golangci.yml | 4 + .../redis/go-redis/v9@v9.5.1/.prettierrc.yml | 4 + .../redis/go-redis/v9@v9.5.1/CHANGELOG.md | 124 + .../redis/go-redis/v9@v9.5.1/CONTRIBUTING.md | 101 + .../github.com/redis/go-redis/v9@v9.5.1/LICENSE | 25 + .../github.com/redis/go-redis/v9@v9.5.1/Makefile | 44 + .../github.com/redis/go-redis/v9@v9.5.1/README.md | 274 + .../redis/go-redis/v9@v9.5.1/RELEASING.md | 15 + .../redis/go-redis/v9@v9.5.1/acl_commands.go | 35 + .../redis/go-redis/v9@v9.5.1/bench_decode_test.go | 316 + .../redis/go-redis/v9@v9.5.1/bench_test.go | 442 + .../redis/go-redis/v9@v9.5.1/bitmap_commands.go | 163 + .../go-redis/v9@v9.5.1/bitmap_commands_test.go | 98 + .../redis/go-redis/v9@v9.5.1/cluster_commands.go | 192 + .../github.com/redis/go-redis/v9@v9.5.1/command.go | 5483 + .../redis/go-redis/v9@v9.5.1/command_test.go | 96 + .../redis/go-redis/v9@v9.5.1/commands.go | 718 + .../redis/go-redis/v9@v9.5.1/commands_test.go | 7014 + .../mod/github.com/redis/go-redis/v9@v9.5.1/doc.go | 4 + .../redis/go-redis/v9@v9.5.1/doctests/README.md | 22 + .../v9@v9.5.1/doctests/lpush_lrange_test.go | 48 + .../go-redis/v9@v9.5.1/doctests/set_get_test.go | 48 + .../github.com/redis/go-redis/v9@v9.5.1/error.go | 156 + .../v9@v9.5.1/example_instrumentation_test.go | 94 + .../redis/go-redis/v9@v9.5.1/example_test.go | 705 + .../redis/go-redis/v9@v9.5.1/export_test.go | 104 + .../redis/go-redis/v9@v9.5.1/fuzz/fuzz.go | 49 + .../redis/go-redis/v9@v9.5.1/gears_commands.go | 149 + .../go-redis/v9@v9.5.1/gears_commands_test.go | 114 + .../redis/go-redis/v9@v9.5.1/generic_commands.go | 384 + .../redis/go-redis/v9@v9.5.1/geo_commands.go | 155 + .../mod/github.com/redis/go-redis/v9@v9.5.1/go.mod | 10 + .../mod/github.com/redis/go-redis/v9@v9.5.1/go.sum | 8 + .../redis/go-redis/v9@v9.5.1/hash_commands.go | 174 + .../go-redis/v9@v9.5.1/hyperloglog_commands.go | 42 + .../redis/go-redis/v9@v9.5.1/internal/arg.go | 58 + .../go-redis/v9@v9.5.1/internal/hashtag/hashtag.go | 78 + .../v9@v9.5.1/internal/hashtag/hashtag_test.go | 71 + .../go-redis/v9@v9.5.1/internal/hscan/hscan.go | 207 + .../v9@v9.5.1/internal/hscan/hscan_test.go | 220 + .../go-redis/v9@v9.5.1/internal/hscan/structmap.go | 125 + .../redis/go-redis/v9@v9.5.1/internal/internal.go | 29 + .../go-redis/v9@v9.5.1/internal/internal_test.go | 18 + .../redis/go-redis/v9@v9.5.1/internal/log.go | 26 + .../redis/go-redis/v9@v9.5.1/internal/once.go | 63 + .../go-redis/v9@v9.5.1/internal/pool/bench_test.go | 95 + .../redis/go-redis/v9@v9.5.1/internal/pool/conn.go | 127 + .../go-redis/v9@v9.5.1/internal/pool/conn_check.go | 49 + .../v9@v9.5.1/internal/pool/conn_check_dummy.go | 9 + .../v9@v9.5.1/internal/pool/conn_check_test.go | 47 + .../v9@v9.5.1/internal/pool/export_test.go | 14 + .../go-redis/v9@v9.5.1/internal/pool/main_test.go | 123 + .../redis/go-redis/v9@v9.5.1/internal/pool/pool.go | 518 + .../v9@v9.5.1/internal/pool/pool_single.go | 58 + .../v9@v9.5.1/internal/pool/pool_sticky.go | 201 + .../go-redis/v9@v9.5.1/internal/pool/pool_test.go | 356 + .../v9@v9.5.1/internal/proto/proto_test.go | 13 + .../go-redis/v9@v9.5.1/internal/proto/reader.go | 552 + .../v9@v9.5.1/internal/proto/reader_test.go | 100 + .../go-redis/v9@v9.5.1/internal/proto/scan.go | 185 + .../go-redis/v9@v9.5.1/internal/proto/scan_test.go | 50 + .../go-redis/v9@v9.5.1/internal/proto/writer.go | 189 + .../v9@v9.5.1/internal/proto/writer_test.go | 154 + .../redis/go-redis/v9@v9.5.1/internal/rand/rand.go | 50 + .../redis/go-redis/v9@v9.5.1/internal/util.go | 66 + .../redis/go-redis/v9@v9.5.1/internal/util/safe.go | 11 + .../go-redis/v9@v9.5.1/internal/util/strconv.go | 19 + .../redis/go-redis/v9@v9.5.1/internal/util/type.go | 5 + .../go-redis/v9@v9.5.1/internal/util/unsafe.go | 22 + .../redis/go-redis/v9@v9.5.1/internal/util_test.go | 53 + .../redis/go-redis/v9@v9.5.1/internal_test.go | 354 + .../redis/go-redis/v9@v9.5.1/iterator.go | 66 + .../redis/go-redis/v9@v9.5.1/iterator_test.go | 136 + .../github.com/redis/go-redis/v9@v9.5.1/json.go | 599 + .../redis/go-redis/v9@v9.5.1/json_test.go | 660 + .../redis/go-redis/v9@v9.5.1/list_commands.go | 289 + .../redis/go-redis/v9@v9.5.1/main_test.go | 484 + .../redis/go-redis/v9@v9.5.1/monitor_test.go | 48 + .../github.com/redis/go-redis/v9@v9.5.1/options.go | 518 + .../redis/go-redis/v9@v9.5.1/options_test.go | 221 + .../redis/go-redis/v9@v9.5.1/osscluster.go | 1913 + .../go-redis/v9@v9.5.1/osscluster_commands.go | 109 + .../redis/go-redis/v9@v9.5.1/osscluster_test.go | 1590 + .../redis/go-redis/v9@v9.5.1/pipeline.go | 121 + .../redis/go-redis/v9@v9.5.1/pipeline_test.go | 110 + .../redis/go-redis/v9@v9.5.1/pool_test.go | 130 + .../redis/go-redis/v9@v9.5.1/probabilistic.go | 1429 + .../redis/go-redis/v9@v9.5.1/probabilistic_test.go | 733 + .../github.com/redis/go-redis/v9@v9.5.1/pubsub.go | 729 + .../redis/go-redis/v9@v9.5.1/pubsub_commands.go | 76 + .../redis/go-redis/v9@v9.5.1/pubsub_test.go | 570 + .../redis/go-redis/v9@v9.5.1/race_test.go | 317 + .../github.com/redis/go-redis/v9@v9.5.1/redis.go | 852 + .../redis/go-redis/v9@v9.5.1/redis_test.go | 635 + .../github.com/redis/go-redis/v9@v9.5.1/result.go | 188 + .../github.com/redis/go-redis/v9@v9.5.1/ring.go | 827 + .../redis/go-redis/v9@v9.5.1/ring_test.go | 796 + .../github.com/redis/go-redis/v9@v9.5.1/script.go | 84 + .../redis/go-redis/v9@v9.5.1/scripting_commands.go | 215 + .../redis/go-redis/v9@v9.5.1/scripts/bump_deps.sh | 9 + .../redis/go-redis/v9@v9.5.1/scripts/release.sh | 70 + .../redis/go-redis/v9@v9.5.1/scripts/tag.sh | 42 + .../redis/go-redis/v9@v9.5.1/sentinel.go | 838 + .../redis/go-redis/v9@v9.5.1/sentinel_test.go | 383 + .../redis/go-redis/v9@v9.5.1/set_commands.go | 217 + .../redis/go-redis/v9@v9.5.1/sortedset_commands.go | 772 + .../redis/go-redis/v9@v9.5.1/stream_commands.go | 438 + .../redis/go-redis/v9@v9.5.1/string_commands.go | 303 + .../go-redis/v9@v9.5.1/timeseries_commands.go | 922 + .../go-redis/v9@v9.5.1/timeseries_commands_test.go | 940 + .../mod/github.com/redis/go-redis/v9@v9.5.1/tx.go | 151 + .../github.com/redis/go-redis/v9@v9.5.1/tx_test.go | 148 + .../redis/go-redis/v9@v9.5.1/universal.go | 247 + .../redis/go-redis/v9@v9.5.1/universal_test.go | 41 + .../github.com/redis/go-redis/v9@v9.5.1/version.go | 6 + .../pkg/mod/go.uber.org/zap@v1.25.0/.codecov.yml | 17 - .../.github/ISSUE_TEMPLATE/bug_report.md | 20 - .../zap@v1.25.0/.github/ISSUE_TEMPLATE/config.yml | 4 - .../.github/ISSUE_TEMPLATE/feature_request.md | 22 - .../go.uber.org/zap@v1.25.0/.github/dependabot.yml | 19 - .../zap@v1.25.0/.github/workflows/fossa.yaml | 20 - .../zap@v1.25.0/.github/workflows/go.yml | 54 - .../pkg/mod/go.uber.org/zap@v1.25.0/.gitignore | 32 - .../pkg/mod/go.uber.org/zap@v1.25.0/.readme.tmpl | 109 - .../pkg/mod/go.uber.org/zap@v1.25.0/CHANGELOG.md | 638 - .../mod/go.uber.org/zap@v1.25.0/CODE_OF_CONDUCT.md | 75 - .../mod/go.uber.org/zap@v1.25.0/CONTRIBUTING.md | 70 - .../pkg/mod/go.uber.org/zap@v1.25.0/FAQ.md | 164 - .../pkg/mod/go.uber.org/zap@v1.25.0/LICENSE.txt | 19 - .../pkg/mod/go.uber.org/zap@v1.25.0/Makefile | 82 - .../pkg/mod/go.uber.org/zap@v1.25.0/README.md | 137 - .../pkg/mod/go.uber.org/zap@v1.25.0/array.go | 320 - .../pkg/mod/go.uber.org/zap@v1.25.0/array_go118.go | 156 - .../go.uber.org/zap@v1.25.0/array_go118_test.go | 240 - .../pkg/mod/go.uber.org/zap@v1.25.0/array_test.go | 107 - .../mod/go.uber.org/zap@v1.25.0/buffer/buffer.go | 141 - .../go.uber.org/zap@v1.25.0/buffer/buffer_test.go | 95 - .../pkg/mod/go.uber.org/zap@v1.25.0/buffer/pool.go | 53 - .../go.uber.org/zap@v1.25.0/buffer/pool_test.go | 52 - .../mod/go.uber.org/zap@v1.25.0/checklicense.sh | 17 - .../pkg/mod/go.uber.org/zap@v1.25.0/clock_test.go | 47 - .../pkg/mod/go.uber.org/zap@v1.25.0/common_test.go | 57 - .../pkg/mod/go.uber.org/zap@v1.25.0/config.go | 330 - .../pkg/mod/go.uber.org/zap@v1.25.0/config_test.go | 203 - .../pkg/mod/go.uber.org/zap@v1.25.0/doc.go | 117 - .../pkg/mod/go.uber.org/zap@v1.25.0/encoder.go | 79 - .../mod/go.uber.org/zap@v1.25.0/encoder_test.go | 88 - .../pkg/mod/go.uber.org/zap@v1.25.0/error.go | 79 - .../pkg/mod/go.uber.org/zap@v1.25.0/error_test.go | 97 - .../go.uber.org/zap@v1.25.0/example_go118_test.go | 66 - .../mod/go.uber.org/zap@v1.25.0/example_test.go | 360 - .../pkg/mod/go.uber.org/zap@v1.25.0/field.go | 590 - .../pkg/mod/go.uber.org/zap@v1.25.0/field_test.go | 290 - .../pkg/mod/go.uber.org/zap@v1.25.0/flag.go | 39 - .../pkg/mod/go.uber.org/zap@v1.25.0/flag_test.go | 103 - .../pkg/mod/go.uber.org/zap@v1.25.0/glide.yaml | 34 - .../pkg/mod/go.uber.org/zap@v1.25.0/global.go | 169 - .../pkg/mod/go.uber.org/zap@v1.25.0/global_test.go | 281 - .../pkg/mod/go.uber.org/zap@v1.25.0/go.mod | 17 - .../pkg/mod/go.uber.org/zap@v1.25.0/go.sum | 29 - .../mod/go.uber.org/zap@v1.25.0/http_handler.go | 133 - .../go.uber.org/zap@v1.25.0/http_handler_test.go | 190 - .../go.uber.org/zap@v1.25.0/increase_level_test.go | 94 - .../zap@v1.25.0/internal/bufferpool/bufferpool.go | 31 - .../zap@v1.25.0/internal/color/color.go | 44 - .../zap@v1.25.0/internal/color/color_test.go | 36 - .../go.uber.org/zap@v1.25.0/internal/exit/exit.go | 66 - .../zap@v1.25.0/internal/exit/exit_test.go | 48 - .../zap@v1.25.0/internal/level_enabler.go | 37 - .../go.uber.org/zap@v1.25.0/internal/pool/pool.go | 58 - .../zap@v1.25.0/internal/pool/pool_test.go | 106 - .../zap@v1.25.0/internal/readme/readme.go | 244 - .../zap@v1.25.0/internal/ztest/clock.go | 50 - .../zap@v1.25.0/internal/ztest/clock_test.go | 57 - .../go.uber.org/zap@v1.25.0/internal/ztest/doc.go | 24 - .../zap@v1.25.0/internal/ztest/timeout.go | 59 - .../zap@v1.25.0/internal/ztest/writer.go | 96 - .../pkg/mod/go.uber.org/zap@v1.25.0/leak_test.go | 31 - .../pkg/mod/go.uber.org/zap@v1.25.0/level.go | 153 - .../pkg/mod/go.uber.org/zap@v1.25.0/level_test.go | 140 - .../pkg/mod/go.uber.org/zap@v1.25.0/logger.go | 406 - .../go.uber.org/zap@v1.25.0/logger_bench_test.go | 318 - .../pkg/mod/go.uber.org/zap@v1.25.0/logger_test.go | 705 - .../pkg/mod/go.uber.org/zap@v1.25.0/options.go | 167 - .../pkg/mod/go.uber.org/zap@v1.25.0/sink.go | 179 - .../pkg/mod/go.uber.org/zap@v1.25.0/sink_test.go | 108 - .../go.uber.org/zap@v1.25.0/sink_windows_test.go | 71 - .../pkg/mod/go.uber.org/zap@v1.25.0/stacktrace.go | 174 - .../go.uber.org/zap@v1.25.0/stacktrace_ext_test.go | 210 - .../mod/go.uber.org/zap@v1.25.0/stacktrace_test.go | 106 - .../pkg/mod/go.uber.org/zap@v1.25.0/sugar.go | 437 - .../pkg/mod/go.uber.org/zap@v1.25.0/sugar_test.go | 515 - .../pkg/mod/go.uber.org/zap@v1.25.0/time.go | 27 - .../pkg/mod/go.uber.org/zap@v1.25.0/time_test.go | 42 - .../pkg/mod/go.uber.org/zap@v1.25.0/writer.go | 98 - .../pkg/mod/go.uber.org/zap@v1.25.0/writer_test.go | 266 - .../zap@v1.25.0/zapcore/buffered_write_syncer.go | 219 - .../zapcore/buffered_write_syncer_bench_test.go | 51 - .../zapcore/buffered_write_syncer_test.go | 139 - .../mod/go.uber.org/zap@v1.25.0/zapcore/clock.go | 48 - .../go.uber.org/zap@v1.25.0/zapcore/clock_test.go | 44 - .../zap@v1.25.0/zapcore/console_encoder.go | 157 - .../zapcore/console_encoder_bench_test.go | 49 - .../zap@v1.25.0/zapcore/console_encoder_test.go | 91 - .../mod/go.uber.org/zap@v1.25.0/zapcore/core.go | 122 - .../go.uber.org/zap@v1.25.0/zapcore/core_test.go | 165 - .../pkg/mod/go.uber.org/zap@v1.25.0/zapcore/doc.go | 24 - .../mod/go.uber.org/zap@v1.25.0/zapcore/encoder.go | 451 - .../zap@v1.25.0/zapcore/encoder_test.go | 730 - .../mod/go.uber.org/zap@v1.25.0/zapcore/entry.go | 298 - .../go.uber.org/zap@v1.25.0/zapcore/entry_test.go | 149 - .../mod/go.uber.org/zap@v1.25.0/zapcore/error.go | 133 - .../go.uber.org/zap@v1.25.0/zapcore/error_test.go | 163 - .../mod/go.uber.org/zap@v1.25.0/zapcore/field.go | 233 - .../go.uber.org/zap@v1.25.0/zapcore/field_test.go | 318 - .../mod/go.uber.org/zap@v1.25.0/zapcore/hook.go | 77 - .../go.uber.org/zap@v1.25.0/zapcore/hook_test.go | 82 - .../zap@v1.25.0/zapcore/increase_level.go | 75 - .../zap@v1.25.0/zapcore/increase_level_test.go | 128 - .../zap@v1.25.0/zapcore/json_encoder.go | 558 - .../zap@v1.25.0/zapcore/json_encoder_bench_test.go | 101 - .../zap@v1.25.0/zapcore/json_encoder_impl_test.go | 659 - .../zap@v1.25.0/zapcore/json_encoder_test.go | 268 - .../go.uber.org/zap@v1.25.0/zapcore/leak_test.go | 31 - .../mod/go.uber.org/zap@v1.25.0/zapcore/level.go | 229 - .../zap@v1.25.0/zapcore/level_strings.go | 46 - .../zap@v1.25.0/zapcore/level_strings_test.go | 38 - .../go.uber.org/zap@v1.25.0/zapcore/level_test.go | 248 - .../go.uber.org/zap@v1.25.0/zapcore/marshaler.go | 61 - .../zap@v1.25.0/zapcore/memory_encoder.go | 179 - .../zap@v1.25.0/zapcore/memory_encoder_test.go | 364 - .../zap@v1.25.0/zapcore/reflected_encoder.go | 41 - .../mod/go.uber.org/zap@v1.25.0/zapcore/sampler.go | 229 - .../zap@v1.25.0/zapcore/sampler_bench_test.go | 285 - .../zap@v1.25.0/zapcore/sampler_test.go | 328 - .../pkg/mod/go.uber.org/zap@v1.25.0/zapcore/tee.go | 96 - .../zap@v1.25.0/zapcore/tee_logger_bench_test.go | 62 - .../go.uber.org/zap@v1.25.0/zapcore/tee_test.go | 191 - .../zap@v1.25.0/zapcore/write_syncer.go | 122 - .../zap@v1.25.0/zapcore/write_syncer_bench_test.go | 90 - .../zap@v1.25.0/zapcore/write_syncer_test.go | 136 - .../mod/go.uber.org/zap@v1.25.0/zapgrpc/zapgrpc.go | 245 - .../zap@v1.25.0/zapgrpc/zapgrpc_test.go | 263 - .../go.uber.org/zap@v1.25.0/zapio/example_test.go | 47 - .../mod/go.uber.org/zap@v1.25.0/zapio/writer.go | 149 - .../go.uber.org/zap@v1.25.0/zapio/writer_test.go | 248 - .../pkg/mod/go.uber.org/zap@v1.25.0/zaptest/doc.go | 22 - .../mod/go.uber.org/zap@v1.25.0/zaptest/logger.go | 140 - .../go.uber.org/zap@v1.25.0/zaptest/logger_test.go | 193 - .../zap@v1.25.0/zaptest/observer/logged_entry.go | 39 - .../zaptest/observer/logged_entry_test.go | 88 - .../zap@v1.25.0/zaptest/observer/observer.go | 196 - .../zap@v1.25.0/zaptest/observer/observer_test.go | 258 - .../go.uber.org/zap@v1.25.0/zaptest/testingt.go | 47 - .../zap@v1.25.0/zaptest/testingt_test.go | 29 - .../mod/go.uber.org/zap@v1.25.0/zaptest/timeout.go | 45 - .../zap@v1.25.0/zaptest/timeout_test.go | 43 - .../mod/go.uber.org/zap@v1.25.0/zaptest/writer.go | 44 - .../go.uber.org/zap@v1.25.0/zaptest/writer_test.go | 68 - .../pkg/mod/go.uber.org/zap@v1.27.0/.codecov.yml | 17 + .../.github/ISSUE_TEMPLATE/bug_report.md | 20 + .../zap@v1.27.0/.github/ISSUE_TEMPLATE/config.yml | 4 + .../.github/ISSUE_TEMPLATE/feature_request.md | 22 + .../go.uber.org/zap@v1.27.0/.github/dependabot.yml | 19 + .../zap@v1.27.0/.github/workflows/fossa.yaml | 20 + .../zap@v1.27.0/.github/workflows/go.yml | 69 + .../pkg/mod/go.uber.org/zap@v1.27.0/.gitignore | 32 + .../pkg/mod/go.uber.org/zap@v1.27.0/.golangci.yml | 77 + .../pkg/mod/go.uber.org/zap@v1.27.0/.readme.tmpl | 117 + .../pkg/mod/go.uber.org/zap@v1.27.0/CHANGELOG.md | 687 + .../mod/go.uber.org/zap@v1.27.0/CODE_OF_CONDUCT.md | 75 + .../mod/go.uber.org/zap@v1.27.0/CONTRIBUTING.md | 70 + .../pkg/mod/go.uber.org/zap@v1.27.0/FAQ.md | 164 + .../pkg/mod/go.uber.org/zap@v1.27.0/LICENSE | 19 + .../pkg/mod/go.uber.org/zap@v1.27.0/Makefile | 76 + .../pkg/mod/go.uber.org/zap@v1.27.0/README.md | 149 + .../pkg/mod/go.uber.org/zap@v1.27.0/array.go | 447 + .../pkg/mod/go.uber.org/zap@v1.27.0/array_test.go | 316 + .../mod/go.uber.org/zap@v1.27.0/buffer/buffer.go | 146 + .../go.uber.org/zap@v1.27.0/buffer/buffer_test.go | 95 + .../pkg/mod/go.uber.org/zap@v1.27.0/buffer/pool.go | 53 + .../go.uber.org/zap@v1.27.0/buffer/pool_test.go | 52 + .../mod/go.uber.org/zap@v1.27.0/checklicense.sh | 17 + .../pkg/mod/go.uber.org/zap@v1.27.0/clock_test.go | 47 + .../pkg/mod/go.uber.org/zap@v1.27.0/common_test.go | 57 + .../pkg/mod/go.uber.org/zap@v1.27.0/config.go | 330 + .../pkg/mod/go.uber.org/zap@v1.27.0/config_test.go | 203 + .../pkg/mod/go.uber.org/zap@v1.27.0/doc.go | 117 + .../pkg/mod/go.uber.org/zap@v1.27.0/encoder.go | 79 + .../mod/go.uber.org/zap@v1.27.0/encoder_test.go | 88 + .../pkg/mod/go.uber.org/zap@v1.27.0/error.go | 82 + .../pkg/mod/go.uber.org/zap@v1.27.0/error_test.go | 133 + .../mod/go.uber.org/zap@v1.27.0/example_test.go | 413 + .../pkg/mod/go.uber.org/zap@v1.27.0/field.go | 615 + .../pkg/mod/go.uber.org/zap@v1.27.0/field_test.go | 316 + .../pkg/mod/go.uber.org/zap@v1.27.0/flag.go | 39 + .../pkg/mod/go.uber.org/zap@v1.27.0/flag_test.go | 103 + .../pkg/mod/go.uber.org/zap@v1.27.0/glide.yaml | 34 + .../pkg/mod/go.uber.org/zap@v1.27.0/global.go | 169 + .../pkg/mod/go.uber.org/zap@v1.27.0/global_test.go | 281 + .../pkg/mod/go.uber.org/zap@v1.27.0/go.mod | 16 + .../pkg/mod/go.uber.org/zap@v1.27.0/go.sum | 25 + .../mod/go.uber.org/zap@v1.27.0/http_handler.go | 140 + .../go.uber.org/zap@v1.27.0/http_handler_test.go | 217 + .../go.uber.org/zap@v1.27.0/increase_level_test.go | 94 + .../zap@v1.27.0/internal/bufferpool/bufferpool.go | 31 + .../zap@v1.27.0/internal/color/color.go | 44 + .../zap@v1.27.0/internal/color/color_test.go | 36 + .../go.uber.org/zap@v1.27.0/internal/exit/exit.go | 66 + .../zap@v1.27.0/internal/exit/exit_test.go | 48 + .../zap@v1.27.0/internal/level_enabler.go | 37 + .../go.uber.org/zap@v1.27.0/internal/pool/pool.go | 58 + .../zap@v1.27.0/internal/pool/pool_test.go | 106 + .../zap@v1.27.0/internal/readme/readme.go | 243 + .../zap@v1.27.0/internal/stacktrace/stack.go | 181 + .../zap@v1.27.0/internal/stacktrace/stack_test.go | 106 + .../zap@v1.27.0/internal/ztest/clock.go | 153 + .../zap@v1.27.0/internal/ztest/clock_test.go | 80 + .../go.uber.org/zap@v1.27.0/internal/ztest/doc.go | 24 + .../zap@v1.27.0/internal/ztest/timeout.go | 59 + .../zap@v1.27.0/internal/ztest/writer.go | 96 + .../pkg/mod/go.uber.org/zap@v1.27.0/leak_test.go | 31 + .../pkg/mod/go.uber.org/zap@v1.27.0/level.go | 153 + .../pkg/mod/go.uber.org/zap@v1.27.0/level_test.go | 140 + .../pkg/mod/go.uber.org/zap@v1.27.0/logger.go | 435 + .../go.uber.org/zap@v1.27.0/logger_bench_test.go | 361 + .../pkg/mod/go.uber.org/zap@v1.27.0/logger_test.go | 1061 + .../pkg/mod/go.uber.org/zap@v1.27.0/options.go | 182 + .../pkg/mod/go.uber.org/zap@v1.27.0/sink.go | 180 + .../pkg/mod/go.uber.org/zap@v1.27.0/sink_test.go | 107 + .../go.uber.org/zap@v1.27.0/sink_windows_test.go | 71 + .../go.uber.org/zap@v1.27.0/stacktrace_ext_test.go | 210 + .../pkg/mod/go.uber.org/zap@v1.27.0/sugar.go | 476 + .../pkg/mod/go.uber.org/zap@v1.27.0/sugar_test.go | 602 + .../pkg/mod/go.uber.org/zap@v1.27.0/time.go | 27 + .../pkg/mod/go.uber.org/zap@v1.27.0/time_test.go | 42 + .../pkg/mod/go.uber.org/zap@v1.27.0/writer.go | 98 + .../pkg/mod/go.uber.org/zap@v1.27.0/writer_test.go | 266 + .../zap@v1.27.0/zapcore/buffered_write_syncer.go | 219 + .../zapcore/buffered_write_syncer_bench_test.go | 55 + .../zapcore/buffered_write_syncer_test.go | 140 + .../mod/go.uber.org/zap@v1.27.0/zapcore/clock.go | 48 + .../go.uber.org/zap@v1.27.0/zapcore/clock_test.go | 44 + .../zap@v1.27.0/zapcore/console_encoder.go | 157 + .../zapcore/console_encoder_bench_test.go | 50 + .../zap@v1.27.0/zapcore/console_encoder_test.go | 135 + .../mod/go.uber.org/zap@v1.27.0/zapcore/core.go | 122 + .../go.uber.org/zap@v1.27.0/zapcore/core_test.go | 166 + .../pkg/mod/go.uber.org/zap@v1.27.0/zapcore/doc.go | 24 + .../mod/go.uber.org/zap@v1.27.0/zapcore/encoder.go | 466 + .../zap@v1.27.0/zapcore/encoder_test.go | 734 + .../mod/go.uber.org/zap@v1.27.0/zapcore/entry.go | 298 + .../zap@v1.27.0/zapcore/entry_ext_test.go | 55 + .../go.uber.org/zap@v1.27.0/zapcore/entry_test.go | 149 + .../mod/go.uber.org/zap@v1.27.0/zapcore/error.go | 136 + .../go.uber.org/zap@v1.27.0/zapcore/error_test.go | 210 + .../mod/go.uber.org/zap@v1.27.0/zapcore/field.go | 233 + .../go.uber.org/zap@v1.27.0/zapcore/field_test.go | 329 + .../mod/go.uber.org/zap@v1.27.0/zapcore/hook.go | 77 + .../go.uber.org/zap@v1.27.0/zapcore/hook_test.go | 83 + .../zap@v1.27.0/zapcore/increase_level.go | 75 + .../zap@v1.27.0/zapcore/increase_level_test.go | 130 + .../zap@v1.27.0/zapcore/json_encoder.go | 583 + .../zap@v1.27.0/zapcore/json_encoder_bench_test.go | 132 + .../zap@v1.27.0/zapcore/json_encoder_impl_test.go | 736 + .../zap@v1.27.0/zapcore/json_encoder_test.go | 282 + .../go.uber.org/zap@v1.27.0/zapcore/lazy_with.go | 54 + .../zap@v1.27.0/zapcore/lazy_with_test.go | 154 + .../go.uber.org/zap@v1.27.0/zapcore/leak_test.go | 31 + .../mod/go.uber.org/zap@v1.27.0/zapcore/level.go | 229 + .../zap@v1.27.0/zapcore/level_strings.go | 46 + .../zap@v1.27.0/zapcore/level_strings_test.go | 38 + .../go.uber.org/zap@v1.27.0/zapcore/level_test.go | 248 + .../go.uber.org/zap@v1.27.0/zapcore/marshaler.go | 61 + .../zap@v1.27.0/zapcore/memory_encoder.go | 179 + .../zap@v1.27.0/zapcore/memory_encoder_test.go | 370 + .../zap@v1.27.0/zapcore/reflected_encoder.go | 41 + .../mod/go.uber.org/zap@v1.27.0/zapcore/sampler.go | 229 + .../zap@v1.27.0/zapcore/sampler_bench_test.go | 287 + .../zap@v1.27.0/zapcore/sampler_test.go | 329 + .../pkg/mod/go.uber.org/zap@v1.27.0/zapcore/tee.go | 96 + .../zap@v1.27.0/zapcore/tee_logger_bench_test.go | 63 + .../go.uber.org/zap@v1.27.0/zapcore/tee_test.go | 192 + .../zap@v1.27.0/zapcore/write_syncer.go | 122 + .../zap@v1.27.0/zapcore/write_syncer_bench_test.go | 101 + .../zap@v1.27.0/zapcore/write_syncer_test.go | 136 + .../mod/go.uber.org/zap@v1.27.0/zapgrpc/zapgrpc.go | 243 + .../zap@v1.27.0/zapgrpc/zapgrpc_test.go | 263 + .../go.uber.org/zap@v1.27.0/zapio/example_test.go | 47 + .../mod/go.uber.org/zap@v1.27.0/zapio/writer.go | 149 + .../go.uber.org/zap@v1.27.0/zapio/writer_test.go | 248 + .../pkg/mod/go.uber.org/zap@v1.27.0/zaptest/doc.go | 22 + .../mod/go.uber.org/zap@v1.27.0/zaptest/logger.go | 157 + .../go.uber.org/zap@v1.27.0/zaptest/logger_test.go | 193 + .../zap@v1.27.0/zaptest/observer/logged_entry.go | 39 + .../zaptest/observer/logged_entry_test.go | 88 + .../zap@v1.27.0/zaptest/observer/observer.go | 196 + .../zap@v1.27.0/zaptest/observer/observer_test.go | 260 + .../go.uber.org/zap@v1.27.0/zaptest/testingt.go | 47 + .../zap@v1.27.0/zaptest/testingt_test.go | 29 + .../mod/go.uber.org/zap@v1.27.0/zaptest/timeout.go | 45 + .../zap@v1.27.0/zaptest/timeout_test.go | 43 + .../mod/go.uber.org/zap@v1.27.0/zaptest/writer.go | 44 + .../go.uber.org/zap@v1.27.0/zaptest/writer_test.go | 68 + .../mod/golang.org/x/sync@v0.3.0/CONTRIBUTING.md | 26 - .../pkg/mod/golang.org/x/sync@v0.3.0/LICENSE | 27 - .../pkg/mod/golang.org/x/sync@v0.3.0/PATENTS | 22 - .../pkg/mod/golang.org/x/sync@v0.3.0/README.md | 20 - .../mod/golang.org/x/sync@v0.3.0/codereview.cfg | 1 - .../golang.org/x/sync@v0.3.0/errgroup/errgroup.go | 132 - .../errgroup/errgroup_example_md5all_test.go | 101 - .../x/sync@v0.3.0/errgroup/errgroup_test.go | 262 - .../mod/golang.org/x/sync@v0.3.0/errgroup/go120.go | 14 - .../x/sync@v0.3.0/errgroup/go120_test.go | 55 - .../golang.org/x/sync@v0.3.0/errgroup/pre_go120.go | 15 - .../pkg/mod/golang.org/x/sync@v0.3.0/go.mod | 3 - .../x/sync@v0.3.0/semaphore/semaphore.go | 136 - .../sync@v0.3.0/semaphore/semaphore_bench_test.go | 132 - .../semaphore/semaphore_example_test.go | 84 - .../x/sync@v0.3.0/semaphore/semaphore_test.go | 202 - .../x/sync@v0.3.0/singleflight/singleflight.go | 205 - .../sync@v0.3.0/singleflight/singleflight_test.go | 359 - .../mod/golang.org/x/sync@v0.3.0/syncmap/go19.go | 18 - .../mod/golang.org/x/sync@v0.3.0/syncmap/map.go | 8 - .../x/sync@v0.3.0/syncmap/map_bench_test.go | 216 - .../x/sync@v0.3.0/syncmap/map_reference_test.go | 151 - .../golang.org/x/sync@v0.3.0/syncmap/map_test.go | 172 - .../golang.org/x/sync@v0.3.0/syncmap/pre_go19.go | 371 - .../mod/golang.org/x/sync@v0.7.0/CONTRIBUTING.md | 26 + .../pkg/mod/golang.org/x/sync@v0.7.0/LICENSE | 27 + .../pkg/mod/golang.org/x/sync@v0.7.0/PATENTS | 22 + .../pkg/mod/golang.org/x/sync@v0.7.0/README.md | 20 + .../mod/golang.org/x/sync@v0.7.0/codereview.cfg | 1 + .../golang.org/x/sync@v0.7.0/errgroup/errgroup.go | 135 + .../errgroup/errgroup_example_md5all_test.go | 101 + .../x/sync@v0.7.0/errgroup/errgroup_test.go | 262 + .../mod/golang.org/x/sync@v0.7.0/errgroup/go120.go | 13 + .../x/sync@v0.7.0/errgroup/go120_test.go | 54 + .../golang.org/x/sync@v0.7.0/errgroup/pre_go120.go | 14 + .../pkg/mod/golang.org/x/sync@v0.7.0/go.mod | 3 + .../x/sync@v0.7.0/semaphore/semaphore.go | 160 + .../sync@v0.7.0/semaphore/semaphore_bench_test.go | 129 + .../semaphore/semaphore_example_test.go | 84 + .../x/sync@v0.7.0/semaphore/semaphore_test.go | 237 + .../x/sync@v0.7.0/singleflight/singleflight.go | 214 + .../sync@v0.7.0/singleflight/singleflight_test.go | 422 + .../mod/golang.org/x/sync@v0.7.0/syncmap/map.go | 18 + .../x/sync@v0.7.0/syncmap/map_bench_test.go | 216 + .../x/sync@v0.7.0/syncmap/map_reference_test.go | 151 + .../golang.org/x/sync@v0.7.0/syncmap/map_test.go | 172 + dependencies/pkg/sumdb/sum.golang.org/latest | 6 +- doc/01-About.md | 7 +- doc/02-Installation.md | 12 +- doc/03-Configuration.md | 120 +- doc/04-Upgrading.md | 106 +- doc/05-Distributed-Setups.md | 16 +- doc/TRADEMARKS.md | 13 + doc/images/icingadb-architecture.png | Bin 563761 -> 454289 bytes doc/images/icingadb-daemon.png | Bin 527021 -> 419862 bytes doc/images/icingadb-database.png | Bin 528639 -> 418924 bytes doc/images/icingadb-envs.png | Bin 660235 -> 470088 bytes doc/images/icingadb-ha.png | Bin 642860 -> 764923 bytes doc/images/icingadb-web.png | Bin 532529 -> 424776 bytes go.mod | 22 +- go.sum | 61 +- internal/version.go | 2 +- pkg/backoff/backoff.go | 4 +- pkg/config/config.go | 24 +- pkg/config/config_test.go | 50 +- pkg/config/database.go | 75 +- pkg/config/redis.go | 10 +- pkg/driver/driver.go | 114 - pkg/driver/pgsql.go | 22 - pkg/flatten/flatten.go | 11 +- pkg/flatten/flatten_test.go | 45 + pkg/icingadb/cleanup.go | 47 +- pkg/icingadb/db.go | 66 +- pkg/icingadb/driver.go | 90 + pkg/icingadb/dump_signals.go | 2 +- pkg/icingadb/ha.go | 208 +- pkg/icingadb/history/sla.go | 2 +- pkg/icingadb/history/sync.go | 8 +- pkg/icingadb/objectpacker/objectpacker.go | 13 +- pkg/icingadb/overdue/sync.go | 2 +- pkg/icingadb/runtime_updates.go | 2 +- pkg/icingadb/v1/checkable.go | 2 +- pkg/icingadb/v1/history/state.go | 2 +- pkg/icingadb/v1/state.go | 2 +- pkg/icingaredis/client.go | 2 +- pkg/icingaredis/heartbeat.go | 14 +- pkg/icingaredis/telemetry/heartbeat.go | 2 +- pkg/icingaredis/telemetry/stats.go | 2 +- pkg/icingaredis/utils.go | 2 +- pkg/retry/retry.go | 141 +- pkg/types/string.go | 8 + schema/mysql/schema.sql | 10 +- schema/mysql/upgrades/1.0.0-rc2.sql | 2 +- schema/mysql/upgrades/1.0.0.sql | 2 +- schema/mysql/upgrades/1.1.1.sql | 2 +- schema/mysql/upgrades/1.2.0.sql | 13 + schema/mysql/upgrades/optional/1.2.0-history.sql | 1 + schema/pgsql/schema.sql | 14 +- schema/pgsql/upgrades/1.2.0.sql | 153 + schema/pgsql/upgrades/optional/1.2-0-history.sql | 3 + tests/go.mod | 48 +- tests/go.sum | 1090 +- tests/history_bench_test.go | 13 +- tests/history_test.go | 8 +- tests/internal/utils/redis.go | 2 +- tests/object_sync_test.go | 2 +- tests/sla_test.go | 13 +- tests/sql/sla_test.go | 36 + 1338 files changed, 400559 insertions(+), 370186 deletions(-) create mode 100644 dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/list create mode 100644 dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.info create mode 100644 dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.lock create mode 100644 dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.mod create mode 100644 dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.zip create mode 100644 dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/list delete mode 100644 dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/v1.3.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.lock delete mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.zip delete mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.lock create mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.zip create mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.ziphash create mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/list delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.lock delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.zip delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.lock delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.zip delete mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.ziphash create mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.lock create mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.zip create mode 100644 dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.lock delete mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.zip delete mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.ziphash create mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.lock create mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.zip create mode 100644 dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.lock delete mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.zip delete mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.ziphash create mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.lock create mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.zip create mode 100644 dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.lock delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.zip delete mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.ziphash create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.lock create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.zip create mode 100644 dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.ziphash create mode 100644 dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/list create mode 100644 dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.lock create mode 100644 dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.zip create mode 100644 dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.info delete mode 100644 dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.info create mode 100644 dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.mod delete mode 100644 dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.8.4.mod create mode 100644 dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.9.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.info delete mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.lock delete mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.zip delete mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.ziphash create mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.info create mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.lock create mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.mod create mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.zip create mode 100644 dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.info delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.mod create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.info create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.mod delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.info delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.lock delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.zip delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.ziphash create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.info create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.lock create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.mod create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.zip create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.ziphash delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20211216021012-1d35b9e2eb4e.mod delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.info delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.mod create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.info create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.mod delete mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20220907171357-04be3eba64a2.info create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.info create mode 100644 dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.mod delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.2.0 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.3.0 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.15.0 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.16.0 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.19 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.20 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.4 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.7 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20230809094429-853ea248256d create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20240409090435-93d18d7e34b8 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211216021012-1d35b9e2eb4e delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.11.0 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.19.0 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20231012003039-104605ab7028 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x032/849 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x055/239 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x061/424 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x063/929 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x068/671 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x073/736 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030.p/198 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/031 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/033 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/034 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/035 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/036 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037.p/124 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038.p/229 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/039.p/138 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/105 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/530 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x080/086 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x088/466 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/483 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/509 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/821 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031.p/226 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/032 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/033 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/034 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/035 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/036 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/037 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/224 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/227 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/128 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/215 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/239 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/249 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/268 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/288 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/46 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/53 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/54 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/55 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/305 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/306 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/312 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/345 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/380 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/239 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/246 create mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/126 delete mode 100644 dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/33 create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/.github/workflows/test.yml create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/LICENSE create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/README.md create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/doc.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_alias_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.s create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64_noasm.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.s create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64_noasm.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_bench_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_generic.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/go.mod create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_alias_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_fiat.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult_test.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables.go create mode 100644 dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables_test.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/.github/workflows/test.yml delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/LICENSE.txt delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/README.md delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/bench_test.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/.gitignore delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/dynamic_test.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/plugin.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.mod delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.sum delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.s delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_other.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_safe.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_test.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe_test.go delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/.gitignore delete mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/xxhsum.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/.github/workflows/test.yml create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/LICENSE.txt create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/README.md create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/bench_test.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/.gitignore create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/dynamic_test.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/plugin.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.mod create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.sum create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/testall.sh create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_amd64.s create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_arm64.s create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_asm.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_other.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_safe.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_test.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe_test.go create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/.gitignore create mode 100644 dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/xxhsum.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/FUNDING.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/config.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/dependabot.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/build.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/commitlint.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/golangci-lint.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/release.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.gitignore delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.golangci.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.prettierrc.yml delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/CHANGELOG.md delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/LICENSE delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/Makefile delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/README.md delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/RELEASING.md delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_decode_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_commands.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/commands.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/commands_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/doc.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/error.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/example_instrumentation_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/example_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/export_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/fuzz/fuzz.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/go.mod delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/go.sum delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/arg.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/hashtag/hashtag.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/hashtag/hashtag_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/hscan/hscan.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/hscan/hscan_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/hscan/structmap.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/internal.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/internal_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/log.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/once.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/bench_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/conn.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/export_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/main_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/pool.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/pool_single.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/pool_sticky.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/pool_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/proto_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/reader.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/reader_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/scan.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/scan_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/writer.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/proto/writer_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/rand/rand.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/safe.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/unsafe.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/util.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/util/safe.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/util/strconv.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/util/unsafe.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/iterator.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/iterator_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/main_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/options.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/options_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/package.json delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/pipeline.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/pipeline_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/pool_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/pubsub.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/pubsub_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/race_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/redis.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/redis_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/result.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/ring.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/ring_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/script.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/scripts/bump_deps.sh delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/scripts/release.sh delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/scripts/tag.sh delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/sentinel.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/sentinel_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/testdata/redis.conf delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/tx.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/tx_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/universal.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/universal_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/version.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/.github/CONTRIBUTING.md delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/.github/ISSUE_TEMPLATE.md delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/.github/workflows/codeql.yml delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/.github/workflows/test.yml delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/.gitignore delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/AUTHORS delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/CHANGELOG.md delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/LICENSE delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/README.md delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/atomic_bool.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/atomic_bool_go118.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/atomic_bool_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/auth.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/auth_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/benchmark_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/buffer.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/collations.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/conncheck.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/conncheck_dummy.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/conncheck_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/connection.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/connection_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/connector.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/connector_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/const.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/driver.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/driver_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/dsn.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/dsn_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/errors.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/errors_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/fields.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/fuzz.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/go.mod delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/infile.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/nulltime.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/nulltime_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/packets.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/packets_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/result.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/rows.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/statement.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/statement_test.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/transaction.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/utils.go delete mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.7.1/utils_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/.github/CONTRIBUTING.md create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/.github/ISSUE_TEMPLATE.md create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/.github/workflows/codeql.yml create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/.github/workflows/test.yml create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/.gitignore create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/AUTHORS create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/CHANGELOG.md create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/LICENSE create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/README.md create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/atomic_bool.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/atomic_bool_go118.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/atomic_bool_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/auth.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/auth_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/benchmark_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/buffer.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/collations.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/conncheck.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/conncheck_dummy.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/conncheck_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/connection.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/connection_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/connector.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/connector_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/const.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/driver.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/driver_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/dsn.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/dsn_fuzz_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/dsn_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/errors.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/errors_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/fields.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/go.mod create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/go.sum create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/infile.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/nulltime.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/nulltime_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/packets.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/packets_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/result.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/rows.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/statement.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/statement_test.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/transaction.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/utils.go create mode 100644 dependencies/pkg/mod/github.com/go-sql-driver/mysql@v1.8.1/utils_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/.codecov.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/.github/FUNDING.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/.github/workflows/go.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/CHANGELOG.md delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/LICENSE delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/Makefile delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/README.md delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/ast/ast.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/ast/ast_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/cmd/ycat/ycat.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/decode.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/decode_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/encode.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/encode_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/error.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/go.mod delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/go.sum delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/internal/errors/error.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/lexer/lexer.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/lexer/lexer_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/option.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/parser/context.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/parser/parser.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/parser/parser_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/parser/testdata/cr.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/parser/testdata/crlf.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/parser/testdata/lf.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/path.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/path_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/printer/printer.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/printer/printer_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/scanner/context.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/scanner/scanner.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/stdlib_quote.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/struct.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/testdata/anchor.yml delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/token/token.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/token/token_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/validate.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/validate_test.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/yaml.go delete mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.0/yaml_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/.codecov.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/.github/FUNDING.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/.github/pull_request_template.md create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/.github/workflows/go.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/CHANGELOG.md create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/LICENSE create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/Makefile create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/README.md create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/ast/ast.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/ast/ast_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/cmd/ycat/ycat.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/decode.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/decode_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/encode.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/encode_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/error.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/go.mod create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/go.sum create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/internal/errors/error.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/lexer/lexer.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/lexer/lexer_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/option.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/parser/context.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/parser/parser.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/parser/parser_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/parser/testdata/cr.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/parser/testdata/crlf.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/parser/testdata/lf.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/path.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/path_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/printer/printer.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/printer/printer_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/scanner/context.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/scanner/scanner.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/stdlib_quote.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/struct.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/testdata/anchor.yml create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/token/token.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/token/token_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/validate.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/validate_test.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/yaml.go create mode 100644 dependencies/pkg/mod/github.com/goccy/go-yaml@v1.11.3/yaml_test.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/.travis.yml delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/CONTRIBUTING.md delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/CONTRIBUTORS delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/LICENSE delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/README.md delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/dce.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/doc.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/go.mod delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/hash.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/json_test.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/marshal.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/node.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/node_js.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/node_net.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/null.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/null_test.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/seq_test.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/sql.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/sql_test.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/time.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/util.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/uuid.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/uuid_test.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/version1.go delete mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.3.0/version4.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/.github/CODEOWNERS create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/.github/release-please.yml create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/.github/workflows/apidiff.yaml create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/.github/workflows/tests.yaml create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/CHANGELOG.md create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/CONTRIBUTING.md create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/CONTRIBUTORS create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/LICENSE create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/README.md create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/dce.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/doc.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/go.mod create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/hash.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/json_test.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/marshal.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/node.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/node_js.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/node_net.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/null.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/null_test.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/seq_test.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/sql.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/sql_test.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/time.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/util.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/uuid.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/uuid_test.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/version1.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/version4.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/version6.go create mode 100644 dependencies/pkg/mod/github.com/google/uuid@v1.6.0/version7.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/.codecov.yml delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/.github/FUNDING.yml delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/.github/workflows/cifuzz.yaml delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/.github/workflows/docker.yaml delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/.github/workflows/go.yaml delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/.gitignore delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/LICENSE delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/README.md delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/custom_driver_name/Makefile delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/custom_driver_name/main.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/custom_func/main.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/fuzz/fuzz_openexec.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/hook/hook.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/limit/limit.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_regexp/Makefile delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_regexp/extension.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_regexp/sqlite3_mod_regexp.c delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_vtable/Makefile delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_vtable/extension.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_vtable/picojson.h delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/mod_vtable/sqlite3_mod_vtable.cc delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/simple/Dockerfile delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/simple/simple.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/trace/main.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/vtable/main.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/vtable/vtable.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/vtable_eponymous_only/main.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/_example/vtable_eponymous_only/vtable.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/backup.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/backup_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/callback.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/callback_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/convert.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/doc.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/error.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/error_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/go.mod delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/go.sum delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3-binding.c delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3-binding.h delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_context.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_func_crypt.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_func_crypt_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_go113_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_go18.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_go18_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_libsqlite3.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_load_extension.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_load_extension_omit.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_load_extension_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_allow_uri_authority.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_app_armor.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_column_metadata.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_column_metadata_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_foreign_keys.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_fts3_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_fts5.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_icu.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_introspect.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_math_functions.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_math_functions_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_os_trace.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_preupdate.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_preupdate_hook.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_preupdate_hook_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_preupdate_omit.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_secure_delete.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_secure_delete_fast.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_serialize.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_serialize_omit.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_serialize_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_stat4.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_unlock_notify.c delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_unlock_notify.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_unlock_notify_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_userauth.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_userauth_omit.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_userauth_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_vacuum_full.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_vacuum_incr.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_vtable.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_opt_vtable_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_other.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_solaris.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_test.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_trace.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_type.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_usleep_windows.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3_windows.go delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/sqlite3ext.h delete mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.17/static_mock.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/.codecov.yml create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/.github/FUNDING.yml create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/.github/workflows/cifuzz.yaml create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/.github/workflows/docker.yaml create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/.github/workflows/go.yaml create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/.gitignore create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/LICENSE create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/README.md create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/custom_driver_name/Makefile create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/custom_driver_name/main.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/custom_func/main.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/fuzz/fuzz_openexec.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/hook/hook.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/json/json.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/limit/limit.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_regexp/Makefile create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_regexp/extension.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_regexp/sqlite3_mod_regexp.c create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_vtable/Makefile create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_vtable/extension.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_vtable/picojson.h create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/mod_vtable/sqlite3_mod_vtable.cc create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/simple/Dockerfile create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/simple/simple.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/trace/main.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/vtable/main.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/vtable/vtable.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/vtable_eponymous_only/main.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/_example/vtable_eponymous_only/vtable.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/backup.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/backup_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/callback.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/callback_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/convert.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/doc.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/error.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/error_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/go.mod create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/go.sum create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3-binding.c create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3-binding.h create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_context.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_func_crypt.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_func_crypt_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_go113_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_go18.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_go18_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_libsqlite3.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_load_extension.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_load_extension_omit.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_load_extension_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_allow_uri_authority.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_app_armor.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_column_metadata.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_column_metadata_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_foreign_keys.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_fts3_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_fts5.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_icu.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_introspect.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_math_functions.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_math_functions_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_os_trace.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_preupdate.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_preupdate_hook.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_preupdate_hook_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_preupdate_omit.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_secure_delete.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_secure_delete_fast.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_serialize.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_serialize_omit.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_serialize_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_stat4.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_unlock_notify.c create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_unlock_notify.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_unlock_notify_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_userauth.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_userauth_omit.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_userauth_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_vacuum_full.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_vacuum_incr.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_vtable.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_opt_vtable_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_other.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_solaris.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_test.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_trace.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_type.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_usleep_windows.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3_windows.go create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/sqlite3ext.h create mode 100644 dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.22/static_mock.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/CODEOWNERS create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/FUNDING.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/ISSUE_TEMPLATE/config.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/dependabot.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/release-drafter-config.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/spellcheck-settings.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/wordlist.txt create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/build.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/doctests.yaml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/golangci-lint.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/release-drafter.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/spellcheck.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/stale-issues.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.github/workflows/test-redis-enterprise.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.gitignore create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.golangci.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/.prettierrc.yml create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/CHANGELOG.md create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/CONTRIBUTING.md create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/LICENSE create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/Makefile create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/README.md create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/RELEASING.md create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/acl_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/bench_decode_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/bench_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/bitmap_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/bitmap_commands_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/cluster_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/command.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/command_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/commands_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/doc.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/doctests/README.md create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/doctests/lpush_lrange_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/doctests/set_get_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/error.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/example_instrumentation_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/example_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/export_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/fuzz/fuzz.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/gears_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/gears_commands_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/generic_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/geo_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/go.mod create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/go.sum create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/hash_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/hyperloglog_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/arg.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/hashtag/hashtag.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/hashtag/hashtag_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/hscan/hscan.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/hscan/hscan_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/hscan/structmap.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/internal.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/internal_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/log.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/once.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/bench_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/conn.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/conn_check.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/conn_check_dummy.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/conn_check_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/export_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/main_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/pool.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/pool_single.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/pool_sticky.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/pool/pool_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/proto_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/reader.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/reader_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/scan.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/scan_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/writer.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/proto/writer_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/rand/rand.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/util.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/util/safe.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/util/strconv.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/util/type.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/util/unsafe.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal/util_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/internal_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/iterator.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/iterator_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/json.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/json_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/list_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/main_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/monitor_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/options.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/options_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/osscluster.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/osscluster_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/osscluster_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/pipeline.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/pipeline_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/pool_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/probabilistic.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/probabilistic_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/pubsub.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/pubsub_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/pubsub_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/race_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/redis.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/redis_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/result.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/ring.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/ring_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/script.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/scripting_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/scripts/bump_deps.sh create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/scripts/release.sh create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/scripts/tag.sh create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/sentinel.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/sentinel_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/set_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/sortedset_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/stream_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/string_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/timeseries_commands.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/timeseries_commands_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/tx.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/tx_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/universal.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/universal_test.go create mode 100644 dependencies/pkg/mod/github.com/redis/go-redis/v9@v9.5.1/version.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.codecov.yml delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.github/ISSUE_TEMPLATE/config.yml delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.github/dependabot.yml delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.github/workflows/fossa.yaml delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.github/workflows/go.yml delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.gitignore delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/.readme.tmpl delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/CHANGELOG.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/CODE_OF_CONDUCT.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/CONTRIBUTING.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/FAQ.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/LICENSE.txt delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/Makefile delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/README.md delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/array.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/array_go118.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/array_go118_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/array_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/buffer/buffer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/buffer/buffer_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/buffer/pool.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/buffer/pool_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/checklicense.sh delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/clock_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/common_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/config.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/config_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/doc.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/encoder.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/encoder_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/error.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/error_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/example_go118_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/example_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/field.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/field_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/flag.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/flag_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/glide.yaml delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/global.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/global_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/go.mod delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/go.sum delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/http_handler.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/http_handler_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/increase_level_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/bufferpool/bufferpool.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/color/color.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/color/color_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/exit/exit.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/exit/exit_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/level_enabler.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/pool/pool.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/pool/pool_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/readme/readme.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/ztest/clock.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/ztest/clock_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/ztest/doc.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/ztest/timeout.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/internal/ztest/writer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/leak_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/level.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/level_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/logger.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/logger_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/logger_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/options.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/sink.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/sink_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/sink_windows_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/stacktrace.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/stacktrace_ext_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/stacktrace_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/sugar.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/sugar_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/time.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/time_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/writer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/writer_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/buffered_write_syncer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/buffered_write_syncer_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/buffered_write_syncer_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/clock.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/clock_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/console_encoder.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/console_encoder_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/console_encoder_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/core.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/core_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/doc.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/encoder.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/encoder_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/entry.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/entry_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/error.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/error_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/field.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/field_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/hook.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/hook_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/increase_level.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/increase_level_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/json_encoder.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/json_encoder_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/json_encoder_impl_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/json_encoder_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/leak_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/level.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/level_strings.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/level_strings_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/level_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/marshaler.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/memory_encoder.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/memory_encoder_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/reflected_encoder.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/sampler.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/sampler_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/sampler_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/tee.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/tee_logger_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/tee_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/write_syncer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/write_syncer_bench_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapcore/write_syncer_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapgrpc/zapgrpc.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapgrpc/zapgrpc_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapio/example_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapio/writer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zapio/writer_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/doc.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/logger.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/logger_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/observer/logged_entry.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/observer/logged_entry_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/observer/observer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/observer/observer_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/testingt.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/testingt_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/timeout.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/timeout_test.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/writer.go delete mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.25.0/zaptest/writer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.codecov.yml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.github/ISSUE_TEMPLATE/config.yml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.github/dependabot.yml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.github/workflows/fossa.yaml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.github/workflows/go.yml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.gitignore create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.golangci.yml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/.readme.tmpl create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/CHANGELOG.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/CODE_OF_CONDUCT.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/CONTRIBUTING.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/FAQ.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/LICENSE create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/Makefile create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/README.md create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/array.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/array_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/buffer/buffer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/buffer/buffer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/buffer/pool.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/buffer/pool_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/checklicense.sh create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/clock_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/common_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/config.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/config_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/doc.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/encoder.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/encoder_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/error.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/error_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/example_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/field.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/field_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/flag.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/flag_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/glide.yaml create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/global.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/global_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/go.mod create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/go.sum create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/http_handler.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/http_handler_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/increase_level_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/bufferpool/bufferpool.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/color/color.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/color/color_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/exit/exit.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/exit/exit_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/level_enabler.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/pool/pool.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/pool/pool_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/readme/readme.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/stacktrace/stack.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/stacktrace/stack_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/ztest/clock.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/ztest/clock_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/ztest/doc.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/ztest/timeout.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/internal/ztest/writer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/leak_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/level.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/level_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/logger.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/logger_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/logger_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/options.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/sink.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/sink_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/sink_windows_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/stacktrace_ext_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/sugar.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/sugar_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/time.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/time_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/writer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/writer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/buffered_write_syncer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/buffered_write_syncer_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/buffered_write_syncer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/clock.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/clock_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/console_encoder.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/console_encoder_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/console_encoder_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/core.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/core_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/doc.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/encoder.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/encoder_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/entry.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/entry_ext_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/entry_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/error.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/error_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/field.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/field_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/hook.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/hook_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/increase_level.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/increase_level_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/json_encoder.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/json_encoder_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/json_encoder_impl_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/json_encoder_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/lazy_with.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/lazy_with_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/leak_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/level.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/level_strings.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/level_strings_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/level_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/marshaler.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/memory_encoder.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/memory_encoder_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/reflected_encoder.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/sampler.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/sampler_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/sampler_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/tee.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/tee_logger_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/tee_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/write_syncer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/write_syncer_bench_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapcore/write_syncer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapgrpc/zapgrpc.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapgrpc/zapgrpc_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapio/example_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapio/writer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zapio/writer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/doc.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/logger.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/logger_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/observer/logged_entry.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/observer/logged_entry_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/observer/observer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/observer/observer_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/testingt.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/testingt_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/timeout.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/timeout_test.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/writer.go create mode 100644 dependencies/pkg/mod/go.uber.org/zap@v1.27.0/zaptest/writer_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/CONTRIBUTING.md delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/LICENSE delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/PATENTS delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/README.md delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/codereview.cfg delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup_example_md5all_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/go120.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/go120_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/pre_go120.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/go.mod delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/semaphore/semaphore.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/semaphore/semaphore_bench_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/semaphore/semaphore_example_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/semaphore/semaphore_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/singleflight/singleflight.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/singleflight/singleflight_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/syncmap/go19.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/syncmap/map.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/syncmap/map_bench_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/syncmap/map_reference_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/syncmap/map_test.go delete mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.3.0/syncmap/pre_go19.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/CONTRIBUTING.md create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/LICENSE create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/PATENTS create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/README.md create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/codereview.cfg create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup_example_md5all_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/go120.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/go120_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/pre_go120.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/go.mod create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/semaphore/semaphore.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/semaphore/semaphore_bench_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/semaphore/semaphore_example_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/semaphore/semaphore_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/singleflight/singleflight.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/singleflight/singleflight_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/syncmap/map.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/syncmap/map_bench_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/syncmap/map_reference_test.go create mode 100644 dependencies/pkg/mod/golang.org/x/sync@v0.7.0/syncmap/map_test.go create mode 100644 doc/TRADEMARKS.md delete mode 100644 pkg/driver/driver.go delete mode 100644 pkg/driver/pgsql.go create mode 100644 pkg/flatten/flatten_test.go create mode 100644 pkg/icingadb/driver.go create mode 100644 schema/mysql/upgrades/1.2.0.sql create mode 100644 schema/mysql/upgrades/optional/1.2.0-history.sql create mode 100644 schema/pgsql/upgrades/1.2.0.sql create mode 100644 schema/pgsql/upgrades/optional/1.2-0-history.sql diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3395774..9512ea0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,14 @@ version: 2 updates: + - package-ecosystem: gomod directory: "/" schedule: - interval: weekly - time: '10:00' + interval: daily + open-pull-requests-limit: 10 + +- package-ecosystem: gomod + directory: "/tests" + schedule: + interval: daily open-pull-requests-limit: 10 - reviewers: - - Al2Klimov - - julianbrost - - lippserd diff --git a/.mailmap b/.mailmap index edbf393..bd13a63 100644 --- a/.mailmap +++ b/.mailmap @@ -3,5 +3,6 @@ Diana Flach Diana Flach Diana Flach Henrik Triem <43344334+htriem@users.noreply.github.com> +Julian Brost diff --git a/AUTHORS b/AUTHORS index 37c365d..7971eb2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,5 @@ Alexander A. Klimov +Alvar Penning Eric Lippmann Feu Mourek Henrik Triem diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c8aea..73b88fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Icinga DB Changelog +## 1.2.0 (2024-04-11) + +This release addresses multiple issues related to fault recoveries, +with a particular focus on retryable database errors that may occur when using Icinga DB with database clusters. + +Since there may be a large number of errors that are resolved by retrying after a certain amount of time, +#698 changed the retry behavior to retry every database-related error for five minutes. +This helps Icinga DB survive network hiccups or more complicated database situations, +such as working with a database cluster. + +The latter was specifically addressed in #711 for Galera Clusters on MySQL or MariaDB by configuring `wsrep_sync_wait` on used database sessions. +Galera users should refer to the [Configuration documentation](doc/03-Configuration.md#database-options) for more details. + +In summary, the most notable changes are as follows: + +* Custom Variables: Render large numbers as-is, not using scientific notation. #657 +* Enhance retries for database errors and other failures for up to five minutes. #693, #698, #739, #740 +* MySQL/MariaDB: Use strict SQL mode. #699 +* MySQL/MariaDB Galera Cluster: Set `wsrep_sync_wait` for cluster-wide causality checks. #711 +* Don't crash history sync in the absence of Redis®[\*](doc/TRADEMARKS.md#redis). #725 +* Update dependencies. [27 times](https://github.com/Icinga/icingadb/pulls?q=is%3Apr+is%3Amerged+label%3Adependencies+milestone%3A1.2.0) + +### Schema + +In addition to mandatory schema upgrades, this release includes an optional upgrade that can be applied subsequently. +Details are available in the [Upgrading documentation](doc/04-Upgrading.md#upgrading-to-icinga-db-v120) and #656. + +All schema changes are listed below: + +* Allow host and service check attempts >= 256. #656 +* Composite `INDEX` for the history table to speed up history view in Icinga DB Web. #686 +* MySQL/MariaDB: Fix `icingadb_schema.timestamp` not being Unix time. #700 +* PostgreSQL: Change `get_sla_ok_percent` to return decimal numbers in SLA overview. #710 + ## 1.1.1 (2023-08-09) This release fixes a few crashes in the Icinga DB daemon, addresses some shortcomings in the database schema, diff --git a/README.md b/README.md index 8cc7c16..54fe707 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,14 @@ Icinga DB is a set of components for publishing, synchronizing and visualizing monitoring data in the Icinga ecosystem, consisting of: -* The Icinga DB daemon, which synchronizes monitoring data between a Redis server and a database +* The Icinga DB daemon, + which synchronizes monitoring data between a Redis®[\*](doc/TRADEMARKS.md#redis) server and a database * Icinga 2 with its [Icinga DB feature](https://icinga.com/docs/icinga-2/latest/doc/14-features/#icinga-db) enabled, - responsible for publishing the data to the Redis server, i.e. configuration and its runtime updates, check results, + responsible for publishing the data to the Redis® server, i.e. configuration and its runtime updates, check results, state changes, downtimes, acknowledgements, notifications, and other events such as flapping * And Icinga Web with the [Icinga DB Web](https://icinga.com/docs/icinga-db-web) module enabled, - which connects to both Redis and the database to display and work with the most up-to-date data + which connects to both Redis® and the database to display and work with the most up-to-date data ![Icinga DB Architecture](doc/images/icingadb-architecture.png) diff --git a/cmd/icingadb-migrate/convert.go b/cmd/icingadb-migrate/convert.go index e14746e..5cfa7bd 100644 --- a/cmd/icingadb-migrate/convert.go +++ b/cmd/icingadb-migrate/convert.go @@ -150,19 +150,9 @@ func convertCommentRows( }, AckHistoryUpserter: history.AckHistoryUpserter{ClearTime: clearTime}, SetTime: setTime, - Author: icingadbTypes.String{ - NullString: sql.NullString{ - String: row.AuthorName, - Valid: true, - }, - }, - Comment: icingadbTypes.String{ - NullString: sql.NullString{ - String: row.CommentData, - Valid: true, - }, - }, - ExpireTime: convertTime(row.ExpirationTime, 0), + Author: icingadbTypes.MakeString(row.AuthorName), + Comment: icingadbTypes.MakeString(row.CommentData), + ExpireTime: convertTime(row.ExpirationTime, 0), IsPersistent: icingadbTypes.Bool{ Bool: row.IsPersistent != 0, Valid: true, @@ -656,13 +646,8 @@ func convertNotificationRows( SendTime: ts, State: row.State, PreviousHardState: previousHardState, - Text: icingadbTypes.String{ - NullString: sql.NullString{ - String: text, - Valid: true, - }, - }, - UsersNotified: row.ContactsNotified, + Text: icingadbTypes.MakeString(text), + UsersNotified: row.ContactsNotified, }) allHistory = append(allHistory, &history.HistoryNotification{ @@ -739,8 +724,8 @@ type stateRow = struct { StateTimeUsec uint32 State uint8 StateType uint8 - CurrentCheckAttempt uint16 - MaxCheckAttempts uint16 + CurrentCheckAttempt uint32 + MaxCheckAttempts uint32 LastState uint8 LastHardState uint8 Output sql.NullString @@ -813,10 +798,10 @@ func convertStateRows( HardState: row.LastHardState, PreviousSoftState: row.LastState, PreviousHardState: previousHardState, - CheckAttempt: uint8(row.CurrentCheckAttempt), + CheckAttempt: row.CurrentCheckAttempt, Output: icingadbTypes.String{NullString: row.Output}, LongOutput: icingadbTypes.String{NullString: row.LongOutput}, - MaxCheckAttempts: uint32(row.MaxCheckAttempts), + MaxCheckAttempts: row.MaxCheckAttempts, CheckSource: icingadbTypes.String{NullString: row.CheckSource}, }) diff --git a/cmd/icingadb-migrate/misc.go b/cmd/icingadb-migrate/misc.go index f1db20c..b8d358f 100644 --- a/cmd/icingadb-migrate/misc.go +++ b/cmd/icingadb-migrate/misc.go @@ -4,7 +4,6 @@ import ( "context" "crypto/sha1" "github.com/icinga/icingadb/pkg/contracts" - "github.com/icinga/icingadb/pkg/driver" "github.com/icinga/icingadb/pkg/icingadb" "github.com/icinga/icingadb/pkg/icingadb/objectpacker" icingadbTypes "github.com/icinga/icingadb/pkg/types" @@ -110,7 +109,7 @@ func sliceIdoHistory[Row any]( args["checkpoint"] = checkpoint args["bulk"] = 20000 - if ht.snapshot.DriverName() != driver.MySQL { + if ht.snapshot.DriverName() != icingadb.MySQL { query = strings.ReplaceAll(query, " USE INDEX (PRIMARY)", "") } diff --git a/cmd/icingadb/main.go b/cmd/icingadb/main.go index 77ce577..4e165eb 100644 --- a/cmd/icingadb/main.go +++ b/cmd/icingadb/main.go @@ -3,7 +3,7 @@ package main import ( "context" "fmt" - "github.com/go-redis/redis/v8" + "github.com/icinga/icingadb/internal" "github.com/icinga/icingadb/internal/command" "github.com/icinga/icingadb/pkg/common" "github.com/icinga/icingadb/pkg/icingadb" @@ -16,6 +16,7 @@ import ( "github.com/icinga/icingadb/pkg/utils" "github.com/okzk/sdnotify" "github.com/pkg/errors" + "github.com/redis/go-redis/v9" "go.uber.org/zap" "golang.org/x/sync/errgroup" "os" @@ -55,11 +56,7 @@ func run() int { logger := logs.GetLogger() defer logger.Sync() - if warn := cmd.Config.DecodeWarning; warn != nil { - logger.Warnf("ignoring unknown config option, this will become a fatal error in Icinga DB v1.2:\n\n%v", warn) - } - - logger.Info("Starting Icinga DB") + logger.Infof("Starting Icinga DB daemon (%s)", internal.Version.Version) db, err := cmd.Database(logs.GetChildLogger("database")) if err != nil { @@ -165,8 +162,8 @@ func run() int { hactx, cancelHactx := context.WithCancel(ctx) for hactx.Err() == nil { select { - case <-ha.Takeover(): - logger.Info("Taking over") + case takeoverReason := <-ha.Takeover(): + logger.Infow("Taking over", zap.String("reason", takeoverReason)) go func() { for hactx.Err() == nil { @@ -327,8 +324,8 @@ func run() int { } } }() - case <-ha.Handover(): - logger.Warn("Handing over") + case handoverReason := <-ha.Handover(): + logger.Warnw("Handing over", zap.String("reason", handoverReason)) cancelHactx() case <-hactx.Done(): diff --git a/config.example.yml b/config.example.yml index 61d3933..90fea96 100644 --- a/config.example.yml +++ b/config.example.yml @@ -23,25 +23,59 @@ database: # Database password. password: CHANGEME -# Connection configuration for the Redis server where Icinga 2 writes its configuration, state and history items. + # List of low-level database options that can be set to influence some Icinga DB internal default behaviours. + # Do not change the defaults if you don't have to! +# options: + # Maximum number of connections Icinga DB is allowed to open in parallel to the database. + # By default, Icinga DB is allowed to open up to "16" connections whenever necessary. + # Setting this to a number less than or equal to "-1" allows Icinga DB to open an unlimited number of connections. + # However, it is not possible to set this option to "0". +# max_connections: 16 + + # Maximum number of queries allowed to connect to a single database table simultaneously. + # By default, Icinga DB is allowed to execute up to "8" queries of any kind, e.g. INSERT,UPDATE,DELETE + # concurrently on a given table. + # It is not possible to set this option to a smaller number than "1". +# max_connections_per_table: 8 + + # Maximum number of placeholders Icinga DB is allowed to use for a single SQL statement. + # By default, Icinga DB uses up to "8192" placeholders when necessary, which showed the + # best performance in terms of execution time and parallelism in our tests. + # It is not possible to set this option to a smaller number than "1". +# max_placeholders_per_statement: 8192 + + # Maximum number of rows Icinga DB is allowed to select, delete, update or insert in a single transaction. + # By default, Icinga DB selects,deletes,updates,inserts up to "8192" rows in a single transaction, which showed + # the best performance in terms of execution time and parallelism in our tests. + # It is not possible to set this option to a smaller number than "1". +# max_rows_per_transaction: 8192 + + # Enforce Galera cluster nodes to perform strict cluster-wide causality checks before executing + # specific SQL queries determined by the number you provided. + # Note: You can only set this option to a number "0 - 15". + # Defaults to 7. + # See https://icinga.com/docs/icinga-db/latest/doc/03-Configuration/#galera-cluster +# wsrep_sync_wait: 7 + +# Connection configuration for the Redis® server where Icinga 2 writes its configuration, state and history items. # This is the same connection as configured in the 'icingadb' feature of the corresponding Icinga 2 node. -# High availability setups require a dedicated Redis server per Icinga 2 node and +# High availability setups require a dedicated Redis® server per Icinga 2 node and # therefore a dedicated Icinga DB instance that connects to it. redis: - # Redis host or absolute Unix socket path. + # Host name or address, or absolute Unix socket path. host: localhost - # Redis port. - # Defaults to '6380' since the Redis server provided by the 'icingadb-redis' package listens on that port. + # TCP port. + # Defaults to '6380' as the Redis® open source server provided by the 'icingadb-redis' package listens on that port. # port: 6380 - # Redis password. + # Authentication password. # password: # Icinga DB logs its activities at various severity levels and any errors that occur either # on the console or in systemd's journal. The latter is used automatically when running under systemd. # In any case, the default log level is 'info'. -logging: +#logging: # Default logging level. Can be set to 'fatal', 'error', 'warn', 'info' or 'debug'. # If not set, defaults to 'info'. # level: info @@ -57,7 +91,7 @@ logging: # interval: 20s # Map of component-logging level pairs to define a different log level than the default value for each component. - options: +# options: # config-sync: # database: # dump-signals: @@ -72,17 +106,27 @@ logging: # Retention is an optional feature to limit the number of days that historical data is available, # as no historical data is deleted by default. -retention: +#retention: # Number of days to retain full historical data. By default, historical data is retained forever. # history-days: # Number of days to retain historical data for SLA reporting. By default, it is retained forever. # sla-days: + # Interval for periodically cleaning up the historical data, defined as a duration string. + # A duration string is a sequence of decimal numbers and a unit suffix, such as "20s". + # Valid units are "ms", "s", "m", "h". + # Defaults to "1h". +# interval: 1h + + # Number of old historical entries a single query can delete in a "DELETE FROM ... LIMIT count" manner. + # By default, this is limited to 5000 entries. +# count: 5000 + # Map of history category to number of days to retain its data in order to # enable retention only for specific categories or to # override the number that has been configured in history-days. - options: +# options: # acknowledgement: # comment: # downtime: diff --git a/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/list b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/list new file mode 100644 index 0000000..795460f --- /dev/null +++ b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/list @@ -0,0 +1 @@ +v1.1.0 diff --git a/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.info b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.info new file mode 100644 index 0000000..8d28d4f --- /dev/null +++ b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.info @@ -0,0 +1 @@ +{"Version":"v1.1.0","Time":"2023-12-10T19:13:24Z","Origin":{"VCS":"git","URL":"https://github.com/FiloSottile/edwards25519","Ref":"refs/tags/v1.1.0","Hash":"325f520de716c1d2d2b4e8dc2f82c7ccc5fac764"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.lock b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.mod b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.mod new file mode 100644 index 0000000..78e04e9 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.mod @@ -0,0 +1,3 @@ +module filippo.io/edwards25519 + +go 1.20 diff --git a/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.zip b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.zip new file mode 100644 index 0000000..b475167 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.zip differ diff --git a/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.ziphash b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.ziphash new file mode 100644 index 0000000..e183bc3 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/filippo.io/edwards25519/@v/v1.1.0.ziphash @@ -0,0 +1 @@ +h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/list b/dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/list deleted file mode 100644 index 18fa8e7..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/list +++ /dev/null @@ -1 +0,0 @@ -v1.3.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/v1.3.0.mod b/dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/v1.3.0.mod deleted file mode 100644 index 758903a..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/benbjohnson/clock/@v/v1.3.0.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/benbjohnson/clock - -go 1.15 diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/list b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/list index 9811b76..6526ce1 100644 --- a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/list @@ -1,2 +1,2 @@ -v2.1.2 v2.2.0 +v2.3.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.lock b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.mod b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.mod deleted file mode 100644 index 49f6760..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/cespare/xxhash/v2 - -go 1.11 diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.zip b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.zip deleted file mode 100644 index abc5f21..0000000 Binary files a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.ziphash b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.ziphash deleted file mode 100644 index 21a12fd..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.1.2.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.info b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.info deleted file mode 100644 index b1d832f..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v2.2.0","Time":"2022-12-04T02:06:23Z","Origin":{"VCS":"git","URL":"https://github.com/cespare/xxhash","Ref":"refs/tags/v2.2.0","Hash":"a76eb16a93c1e30527c073ca831d9048b4b935f6"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.lock b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.zip b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.zip new file mode 100644 index 0000000..380ad72 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.zip differ diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.ziphash b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.ziphash new file mode 100644 index 0000000..cf8dd5b --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.2.0.ziphash @@ -0,0 +1 @@ +h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.info b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.info new file mode 100644 index 0000000..820853f --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.info @@ -0,0 +1 @@ +{"Version":"v2.3.0","Time":"2024-04-04T20:00:10Z","Origin":{"VCS":"git","URL":"https://github.com/cespare/xxhash","Ref":"refs/tags/v2.3.0","Hash":"998dce232f17418a7a5721ecf87ca714025a3243"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.mod b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.mod new file mode 100644 index 0000000..49f6760 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/cespare/xxhash/v2/@v/v2.3.0.mod @@ -0,0 +1,3 @@ +module github.com/cespare/xxhash/v2 + +go 1.11 diff --git a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/list b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/list index 73fba4f..de92ea1 100644 --- a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/list @@ -1,3 +1,3 @@ v1.10.0 v1.13.0 -v1.15.0 +v1.16.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.info b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.info deleted file mode 100644 index 643baea..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.15.0","Time":"2023-03-12T11:25:03Z","Origin":{"VCS":"git","URL":"https://github.com/fatih/color","Ref":"refs/tags/v1.15.0","Hash":"12126ed593697635c525b302836b292b657ea573"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.mod b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.mod deleted file mode 100644 index 4fa49be..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.15.0.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/fatih/color - -go 1.17 - -require ( - github.com/mattn/go-colorable v0.1.13 - github.com/mattn/go-isatty v0.0.17 -) - -require golang.org/x/sys v0.6.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.info b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.info new file mode 100644 index 0000000..9f69498 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.info @@ -0,0 +1 @@ +{"Version":"v1.16.0","Time":"2023-11-06T08:25:55Z","Origin":{"VCS":"git","URL":"https://github.com/fatih/color","Ref":"refs/tags/v1.16.0","Hash":"0f9779ed479afd460f0c2cc5a3d3eb69b9ba188b"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.mod b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.mod new file mode 100644 index 0000000..9959705 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/fatih/color/@v/v1.16.0.mod @@ -0,0 +1,10 @@ +module github.com/fatih/color + +go 1.17 + +require ( + github.com/mattn/go-colorable v0.1.13 + github.com/mattn/go-isatty v0.0.20 +) + +require golang.org/x/sys v0.14.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/list b/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/list deleted file mode 100644 index dbb87b9..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/list +++ /dev/null @@ -1 +0,0 @@ -v8.11.5 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.info b/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.info deleted file mode 100644 index 38f5c02..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v8.11.5","Time":"2022-03-17T13:27:49Z"} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.lock b/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.mod b/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.mod deleted file mode 100644 index d2610c2..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.mod +++ /dev/null @@ -1,20 +0,0 @@ -module github.com/go-redis/redis/v8 - -go 1.17 - -require ( - github.com/cespare/xxhash/v2 v2.1.2 - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f - github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.18.1 -) - -require ( - github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/nxadm/tail v1.4.8 // indirect - golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/text v0.3.6 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.zip b/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.zip deleted file mode 100644 index ac79681..0000000 Binary files a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.ziphash b/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.ziphash deleted file mode 100644 index 17c3a46..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-redis/redis/v8/@v/v8.11.5.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/list b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/list index 35d23a8..fdc860b 100644 --- a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/list @@ -1,2 +1,2 @@ v1.6.0 -v1.7.1 +v1.8.1 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.info b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.info deleted file mode 100644 index 1209183..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.7.1","Time":"2023-04-25T10:02:15Z","Origin":{"VCS":"git","URL":"https://github.com/go-sql-driver/mysql","Ref":"refs/tags/v1.7.1","Hash":"f20b2863636093e5fbf1481b59bdaff3b0fbb779"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.lock b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.mod b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.mod deleted file mode 100644 index 2511104..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/go-sql-driver/mysql - -go 1.13 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.zip b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.zip deleted file mode 100644 index 301fad7..0000000 Binary files a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.ziphash b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.ziphash deleted file mode 100644 index ff656c1..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.7.1.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.info b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.info new file mode 100644 index 0000000..5fe9f39 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.info @@ -0,0 +1 @@ +{"Version":"v1.8.1","Time":"2024-03-26T14:34:07Z","Origin":{"VCS":"git","URL":"https://github.com/go-sql-driver/mysql","Ref":"refs/tags/v1.8.1","Hash":"4395c45fd098a81c5251667cda111f94c693ab14"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.lock b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.mod b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.mod new file mode 100644 index 0000000..4629714 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.mod @@ -0,0 +1,5 @@ +module github.com/go-sql-driver/mysql + +go 1.18 + +require filippo.io/edwards25519 v1.1.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.zip b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.zip new file mode 100644 index 0000000..991ec2f Binary files /dev/null and b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.zip differ diff --git a/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.ziphash b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.ziphash new file mode 100644 index 0000000..b688937 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/go-sql-driver/mysql/@v/v1.8.1.ziphash @@ -0,0 +1 @@ +h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/list b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/list index cd74ac3..3d461ea 100644 --- a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/list @@ -1 +1 @@ -v1.11.0 +v1.11.3 diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.info b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.info deleted file mode 100644 index 499fe61..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.11.0","Time":"2023-04-02T01:50:03Z","Origin":{"VCS":"git","URL":"https://github.com/goccy/go-yaml","Ref":"refs/tags/v1.11.0","Hash":"4052b059bc2ad6cd230a4d8be77e39fa1b1382df"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.lock b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.mod b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.mod deleted file mode 100644 index f6e74c3..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.mod +++ /dev/null @@ -1,20 +0,0 @@ -module github.com/goccy/go-yaml - -go 1.18 - -require ( - github.com/fatih/color v1.10.0 - github.com/go-playground/validator/v10 v10.4.1 - github.com/google/go-cmp v0.5.9 - github.com/mattn/go-colorable v0.1.8 - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 -) - -require ( - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/leodido/go-urn v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/sys v0.6.0 // indirect -) diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.zip b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.zip deleted file mode 100644 index 5ed3d40..0000000 Binary files a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.ziphash b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.ziphash deleted file mode 100644 index 016cc4f..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.info b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.info new file mode 100644 index 0000000..93dd5a8 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.info @@ -0,0 +1 @@ +{"Version":"v1.11.3","Time":"2024-01-26T07:45:04Z","Origin":{"VCS":"git","URL":"https://github.com/goccy/go-yaml","Ref":"refs/tags/v1.11.3","Hash":"31fe1baacec127337140701face2e64a356075fd"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.lock b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.mod b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.mod new file mode 100644 index 0000000..4550ff3 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.mod @@ -0,0 +1,20 @@ +module github.com/goccy/go-yaml + +go 1.19 + +require ( + github.com/fatih/color v1.10.0 + github.com/go-playground/validator/v10 v10.4.1 + github.com/google/go-cmp v0.5.9 + github.com/mattn/go-colorable v0.1.8 + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 +) + +require ( + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/sys v0.6.0 // indirect +) diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.zip b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.zip new file mode 100644 index 0000000..d823d0e Binary files /dev/null and b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.zip differ diff --git a/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.ziphash b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.ziphash new file mode 100644 index 0000000..bf3f752 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/goccy/go-yaml/@v/v1.11.3.ziphash @@ -0,0 +1 @@ +h1:B3W9IdWbvrUu2OYQGwvU1nZtvMQJPBKgBUuweJjLj6I= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/list b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/list index 18fa8e7..b7c0a9b 100644 --- a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/list @@ -1 +1 @@ -v1.3.0 +v1.6.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.info b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.info deleted file mode 100644 index abbd344..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.3.0","Time":"2021-07-12T22:33:52Z"} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.lock b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.mod b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.mod deleted file mode 100644 index fc84cd7..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/google/uuid diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.zip b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.zip deleted file mode 100644 index 63e6022..0000000 Binary files a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.ziphash b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.ziphash deleted file mode 100644 index dc67306..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.3.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.info b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.info new file mode 100644 index 0000000..ef68c97 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.info @@ -0,0 +1 @@ +{"Version":"v1.6.0","Time":"2024-01-23T18:54:04Z","Origin":{"VCS":"git","URL":"https://github.com/google/uuid","Ref":"refs/tags/v1.6.0","Hash":"0f11ee6918f41a04c201eceeadf612a377bc7fbc"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.lock b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.mod b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.mod new file mode 100644 index 0000000..fc84cd7 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.mod @@ -0,0 +1 @@ +module github.com/google/uuid diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.zip b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.zip new file mode 100644 index 0000000..e910ff2 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.zip differ diff --git a/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.ziphash b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.ziphash new file mode 100644 index 0000000..3b6900f --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/google/uuid/@v/v1.6.0.ziphash @@ -0,0 +1 @@ +h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/list b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/list index eefdb82..7ee43f2 100644 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/list @@ -1,4 +1,4 @@ v0.0.12 v0.0.14 v0.0.16 -v0.0.19 +v0.0.20 diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.info b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.info deleted file mode 100644 index 818489d..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.0.19","Time":"2023-03-22T15:51:17Z","Origin":{"VCS":"git","URL":"https://github.com/mattn/go-isatty","Ref":"refs/tags/v0.0.19","Hash":"c067b4f3df49dfc0f376d884e16cfd784ea1874b"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.mod b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.mod deleted file mode 100644 index 057d69d..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.19.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/mattn/go-isatty - -go 1.15 - -require golang.org/x/sys v0.6.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.info b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.info new file mode 100644 index 0000000..091c31c --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.info @@ -0,0 +1 @@ +{"Version":"v0.0.20","Time":"2023-10-17T07:28:21Z","Origin":{"VCS":"git","URL":"https://github.com/mattn/go-isatty","Ref":"refs/tags/v0.0.20","Hash":"a7c02353c47bc4ec6b30dc9628154ae4fe760c11"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.mod b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.mod new file mode 100644 index 0000000..057d69d --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-isatty/@v/v0.0.20.mod @@ -0,0 +1,5 @@ +module github.com/mattn/go-isatty + +go 1.15 + +require golang.org/x/sys v0.6.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/list b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/list index d31391a..2af3357 100644 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/list @@ -1,2 +1,2 @@ v1.14.6 -v1.14.17 +v1.14.22 diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.info b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.info deleted file mode 100644 index 9366971..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.14.17","Time":"2023-05-31T23:32:35Z","Origin":{"VCS":"git","URL":"https://github.com/mattn/go-sqlite3","Ref":"refs/tags/v1.14.17","Hash":"f08f1b6b9ce62b2496d8d64df26c1e278887bc1c"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.lock b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.mod b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.mod deleted file mode 100644 index 89788ab..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/mattn/go-sqlite3 - -go 1.16 - -retract ( - [v2.0.0+incompatible, v2.0.6+incompatible] // Accidental; no major changes or features. -) diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.zip b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.zip deleted file mode 100644 index 8e8aa42..0000000 Binary files a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.ziphash b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.ziphash deleted file mode 100644 index 880bbdd..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.17.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.info b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.info new file mode 100644 index 0000000..f359477 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.info @@ -0,0 +1 @@ +{"Version":"v1.14.22","Time":"2024-02-02T17:00:28Z","Origin":{"VCS":"git","URL":"https://github.com/mattn/go-sqlite3","Ref":"refs/tags/v1.14.22","Hash":"6ee3e6746e6b5a0f4099d0553120ceead9f9fc38"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.lock b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.mod b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.mod new file mode 100644 index 0000000..e342dcc --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.mod @@ -0,0 +1,7 @@ +module github.com/mattn/go-sqlite3 + +go 1.19 + +retract ( + [v2.0.0+incompatible, v2.0.6+incompatible] // Accidental; no major changes or features. +) diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.zip b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.zip new file mode 100644 index 0000000..6a58c47 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.zip differ diff --git a/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.ziphash b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.ziphash new file mode 100644 index 0000000..58cf4fa --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/mattn/go-sqlite3/@v/v1.14.22.ziphash @@ -0,0 +1 @@ +h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/list b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/list new file mode 100644 index 0000000..1890ff6 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/list @@ -0,0 +1 @@ +v9.5.1 diff --git a/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.info b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.info new file mode 100644 index 0000000..3d4ef4a --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.info @@ -0,0 +1 @@ +{"Version":"v9.5.1","Time":"2024-02-20T15:44:29Z","Origin":{"VCS":"git","URL":"https://github.com/redis/go-redis","Ref":"refs/tags/v9.5.1","Hash":"d43a9fa887d9284ba42fcd46d46e97c56b34e132"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.lock b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.mod b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.mod new file mode 100644 index 0000000..6c65f09 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.mod @@ -0,0 +1,10 @@ +module github.com/redis/go-redis/v9 + +go 1.18 + +require ( + github.com/bsm/ginkgo/v2 v2.12.0 + github.com/bsm/gomega v1.27.10 + github.com/cespare/xxhash/v2 v2.2.0 + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f +) diff --git a/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.zip b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.zip new file mode 100644 index 0000000..4ece052 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.zip differ diff --git a/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.ziphash b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.ziphash new file mode 100644 index 0000000..27c5665 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/redis/go-redis/v9/@v/v9.5.1.ziphash @@ -0,0 +1 @@ +h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/list b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/list index b04498b..ef0ecf6 100644 --- a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/list @@ -1,3 +1,3 @@ v0.1.0 v0.2.0 -v0.4.4 +v0.4.7 diff --git a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.info b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.info deleted file mode 100644 index 4ad888a..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.4.4","Time":"2023-02-21T06:53:24Z","Origin":{"VCS":"git","URL":"https://github.com/rivo/uniseg","Ref":"refs/tags/v0.4.4","Hash":"2d50be15fe50b00a9169a11d741f8ee86bada48f"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.mod b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.mod deleted file mode 100644 index b2dc25c..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.4.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/rivo/uniseg - -go 1.18 diff --git a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.info b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.info new file mode 100644 index 0000000..aae6264 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.info @@ -0,0 +1 @@ +{"Version":"v0.4.7","Time":"2024-02-08T13:16:15Z","Origin":{"VCS":"git","URL":"https://github.com/rivo/uniseg","Ref":"refs/tags/v0.4.7","Hash":"03509a98a092b522b2ff0de13e53513d18b3b837"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.mod b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.mod new file mode 100644 index 0000000..b2dc25c --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/rivo/uniseg/@v/v0.4.7.mod @@ -0,0 +1,3 @@ +module github.com/rivo/uniseg + +go 1.18 diff --git a/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/list b/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/list index ae8621b..6b889fd 100644 --- a/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/list +++ b/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/list @@ -2,4 +2,4 @@ v1.7.0 v1.7.1 v1.8.0 v1.8.1 -v1.8.4 +v1.9.0 diff --git a/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.8.4.mod b/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.8.4.mod deleted file mode 100644 index bddefac..0000000 --- a/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.8.4.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/stretchr/testify - -go 1.20 - -require ( - github.com/davecgh/go-spew v1.1.1 - github.com/pmezard/go-difflib v1.0.0 - github.com/stretchr/objx v0.5.0 - gopkg.in/yaml.v3 v3.0.1 -) diff --git a/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.9.0.mod b/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.9.0.mod new file mode 100644 index 0000000..943798e --- /dev/null +++ b/dependencies/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.9.0.mod @@ -0,0 +1,16 @@ +module github.com/stretchr/testify + +// This should match the minimum supported version that is tested in +// .github/workflows/main.yml +go 1.17 + +require ( + github.com/davecgh/go-spew v1.1.1 + github.com/pmezard/go-difflib v1.0.0 + github.com/stretchr/objx v0.5.2 + gopkg.in/yaml.v3 v3.0.1 +) + +// Break dependency cycle with objx. +// See https://github.com/stretchr/objx/pull/140 +exclude github.com/stretchr/testify v1.8.2 diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/list b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/list index bb04940..df40772 100644 --- a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/list +++ b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/list @@ -1 +1 @@ -v1.25.0 +v1.27.0 diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.info b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.info deleted file mode 100644 index ea317d7..0000000 --- a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.25.0","Time":"2023-08-02T05:47:56Z","Origin":{"VCS":"git","URL":"https://github.com/uber-go/zap","Ref":"refs/tags/v1.25.0","Hash":"56468e797f1dbf3905ad7c34b5513928206244bf"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.lock b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.mod b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.mod deleted file mode 100644 index 455dae4..0000000 --- a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.mod +++ /dev/null @@ -1,17 +0,0 @@ -module go.uber.org/zap - -go 1.19 - -require ( - github.com/benbjohnson/clock v1.3.0 - github.com/stretchr/testify v1.8.1 - go.uber.org/goleak v1.2.0 - go.uber.org/multierr v1.10.0 - gopkg.in/yaml.v3 v3.0.1 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect -) diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.zip b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.zip deleted file mode 100644 index d97277c..0000000 Binary files a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.ziphash b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.ziphash deleted file mode 100644 index 31526ee..0000000 --- a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.25.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.info b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.info new file mode 100644 index 0000000..dedb30a --- /dev/null +++ b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.info @@ -0,0 +1 @@ +{"Version":"v1.27.0","Time":"2024-02-20T20:55:06Z","Origin":{"VCS":"git","URL":"https://github.com/uber-go/zap","Ref":"refs/tags/v1.27.0","Hash":"fcf8ee58669e358bbd6460bef5c2ee7a53c0803a"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.lock b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.mod b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.mod new file mode 100644 index 0000000..88575f4 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.mod @@ -0,0 +1,16 @@ +module go.uber.org/zap + +go 1.19 + +require ( + github.com/stretchr/testify v1.8.1 + go.uber.org/goleak v1.3.0 + go.uber.org/multierr v1.10.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect +) diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.zip b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.zip new file mode 100644 index 0000000..02433b4 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.zip differ diff --git a/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.ziphash b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.ziphash new file mode 100644 index 0000000..d264908 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/go.uber.org/zap/@v/v1.27.0.ziphash @@ -0,0 +1 @@ +h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/list b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/list index 3e7e41a..b555f3a 100644 --- a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/list +++ b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/list @@ -1,2 +1,2 @@ v0.0.0-20220613132600-b0d781184e0d -v0.0.0-20230809094429-853ea248256d +v0.0.0-20240409090435-93d18d7e34b8 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.info b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.info deleted file mode 100644 index 7eb1914..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.0.0-20230809094429-853ea248256d","Time":"2023-08-09T09:44:29Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/exp","Hash":"853ea248256d89ff7815cf4ae1ce2efa8bbb6277"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.mod b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.mod deleted file mode 100644 index 798bce9..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20230809094429-853ea248256d.mod +++ /dev/null @@ -1,11 +0,0 @@ -module golang.org/x/exp - -go 1.20 - -require ( - github.com/google/go-cmp v0.5.8 - golang.org/x/mod v0.11.0 - golang.org/x/tools v0.2.0 -) - -require golang.org/x/sys v0.1.0 // indirect diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.info b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.info new file mode 100644 index 0000000..d1a84ab --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.info @@ -0,0 +1 @@ +{"Version":"v0.0.0-20240409090435-93d18d7e34b8","Time":"2024-04-09T09:04:35Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/exp","Hash":"93d18d7e34b8aac3374a4710606eb1702f2d44ff"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.mod b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.mod new file mode 100644 index 0000000..fdf0cae --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/exp/@v/v0.0.0-20240409090435-93d18d7e34b8.mod @@ -0,0 +1,11 @@ +module golang.org/x/exp + +go 1.20 + +require ( + github.com/google/go-cmp v0.5.8 + golang.org/x/mod v0.17.0 + golang.org/x/tools v0.20.0 +) + +require golang.org/x/sync v0.7.0 // indirect diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/list b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/list index 268b033..8b20e48 100644 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/list +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/list @@ -1 +1 @@ -v0.3.0 +v0.7.0 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.info b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.info deleted file mode 100644 index c77bee0..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.3.0","Time":"2023-06-01T20:35:10Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/sync","Ref":"refs/tags/v0.3.0","Hash":"93782cc822b6b554cb7df40332fd010f0473cbc8"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.lock b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.lock deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.mod b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.mod deleted file mode 100644 index 782b734..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/sync - -go 1.17 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.zip b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.zip deleted file mode 100644 index 4e24585..0000000 Binary files a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.zip and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.ziphash b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.ziphash deleted file mode 100644 index 6f70f06..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.3.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.info b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.info new file mode 100644 index 0000000..f3e986e --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.info @@ -0,0 +1 @@ +{"Version":"v0.7.0","Time":"2024-03-04T17:26:02Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/sync","Ref":"refs/tags/v0.7.0","Hash":"14be23e5b48bec28285f8a694875175ecacfddb3"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.lock b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.lock new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.mod b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.mod new file mode 100644 index 0000000..74bd0ac --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.mod @@ -0,0 +1,3 @@ +module golang.org/x/sync + +go 1.18 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.zip b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.zip new file mode 100644 index 0000000..3ee7169 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.zip differ diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.ziphash b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.ziphash new file mode 100644 index 0000000..e3a2e22 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sync/@v/v0.7.0.ziphash @@ -0,0 +1 @@ +h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/list b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/list index d52b9d4..e854994 100644 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/list +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/list @@ -4,7 +4,6 @@ v0.0.0-20210320140829-1e4c9ba3b0c4 v0.0.0-20210514084401-e8d321eab015 v0.0.0-20210630005230-0f9fa26af87c v0.0.0-20211019181941-9d821ace8654 -v0.0.0-20211216021012-1d35b9e2eb4e v0.0.0-20220811171246-fbc7d0a398ab v0.6.0 -v0.11.0 +v0.19.0 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20211216021012-1d35b9e2eb4e.mod b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20211216021012-1d35b9e2eb4e.mod deleted file mode 100644 index 29eb4d2..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20211216021012-1d35b9e2eb4e.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/sys - -go 1.17 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.info b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.info deleted file mode 100644 index 12e4509..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.11.0","Time":"2023-07-26T11:14:25Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/sys","Ref":"refs/tags/v0.11.0","Hash":"104d4017fa052d31a480218d213787543bc352d4"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.mod b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.mod deleted file mode 100644 index 29eb4d2..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.11.0.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/sys - -go 1.17 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.info b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.info new file mode 100644 index 0000000..9fc4699 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.info @@ -0,0 +1 @@ +{"Version":"v0.19.0","Time":"2024-04-04T14:40:38Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/sys","Ref":"refs/tags/v0.19.0","Hash":"cabba82f75d7f55a0657810d02d534745dee5d59"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.mod b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.mod new file mode 100644 index 0000000..9e1e4d5 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/sys/@v/v0.19.0.mod @@ -0,0 +1,3 @@ +module golang.org/x/sys + +go 1.18 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/list b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/list index 44bf687..5f449ba 100644 --- a/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/list +++ b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/list @@ -1,2 +1,3 @@ v0.0.0-20200804184101-5ec99f83aff1 v0.0.0-20220907171357-04be3eba64a2 +v0.0.0-20231012003039-104605ab7028 diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20220907171357-04be3eba64a2.info b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20220907171357-04be3eba64a2.info deleted file mode 100644 index a46d865..0000000 --- a/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20220907171357-04be3eba64a2.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.0.0-20220907171357-04be3eba64a2","Time":"2022-09-07T17:13:57Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/xerrors","Hash":"04be3eba64a22a838cdb17b8dca15a52871c08b4"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.info b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.info new file mode 100644 index 0000000..91f16de --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.info @@ -0,0 +1 @@ +{"Version":"v0.0.0-20231012003039-104605ab7028","Time":"2023-10-12T00:30:39Z","Origin":{"VCS":"git","URL":"https://go.googlesource.com/xerrors","Hash":"104605ab7028f4af38a8aff92ac848a51bd53c5d"}} \ No newline at end of file diff --git a/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.mod b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.mod new file mode 100644 index 0000000..f1a2526 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/golang.org/x/xerrors/@v/v0.0.0-20231012003039-104605ab7028.mod @@ -0,0 +1,3 @@ +module golang.org/x/xerrors + +go 1.18 diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.2.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.2.0 deleted file mode 100644 index 445809b..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.2.0 +++ /dev/null @@ -1,9 +0,0 @@ -14141377 -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= - -go.sum database tree -18952661 -i1oopLcqTfH+RdRDBk5dFQOjO1oY56bBYX+dZONANl0= - -— sum.golang.org Az3grnkF7D4uqOVcpIHhVXugC+wkG8G47Z7oK13FC59I68OHfs/hIOyKJ93X09006pPgTvCO82fU0cmXEq42hOAqfQk= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.3.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.3.0 new file mode 100644 index 0000000..2b2820b --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/cespare/xxhash/v2@v2.3.0 @@ -0,0 +1,9 @@ +24962514 +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= + +go.sum database tree +25096923 +LiqZtBdWKd+Anbu0kjmGaVEF2SsvrZtPQxC1bujqO/M= + +— sum.golang.org Az3grl7E+FU03gK92d4JtmJMyfmCh5d2Hy5U0QjkX/mLaMC+NbEBYW5cKMFreDtFYtLTMBTL2MolRvdDafHn+5XZzQ0= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 index cdf14c4..af5d323 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 @@ -3,7 +3,7 @@ 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= go.sum database tree -18951877 -osZm+4uGCX5SbYJ9yCvDFB2TyttEPMnkPrvTCAVE/+0= +25096469 +gsd683C9t/9nYNjzznzpdVrgZ5UmMt7gS31MWKC9zlQ= -— sum.golang.org Az3gruku2W6npuP+VGmOcLTEzr90e9hAdTK3L46MsSnoK90tXPjTpxpjzFgn0imk23A1ZEwHC/kcjI/P8dmxGURHpQE= +— sum.golang.org Az3grpl7gQbLTidhSfCew38xhvNWp3lnbKVhHMzCuuzPAAGwd8/2XVzG+AX6Hxln/GhiM+PcXHoEHc2Wwr+CaMcaFQ4= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.10.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.10.0 index 548ec8b..c93626b 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.10.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.10.0 @@ -3,7 +3,7 @@ github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= go.sum database tree -18953596 -QSBe88T4pRk6Nd+8Jr2UUqzMBpkTZyUJWUSVP+JRYAA= +25096162 +4AxFS54e3N6of8STnSeoZ1/O8YrlLEZRHKQhdsVyAK0= -— sum.golang.org Az3grtZ6u69dhgtKtOveKztG6bmREd0JQU3svVEBwuzoLk2wHldqnuGd72U/ceVPML9GjNgPxnwJ0Q+nD6zPfVXNqwA= +— sum.golang.org Az3grmRjhvzLCvNhn+CWQMP6P8WB6f3Ycmr5avNvjUsAAJ4IF5CnAsnEIWWkHdtJ6NGb/PDUytxD/EF5YECS0Lk/pg0= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.15.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.15.0 deleted file mode 100644 index d75280b..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.15.0 +++ /dev/null @@ -1,9 +0,0 @@ -16365996 -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= - -go.sum database tree -18953125 -8ZuliMaVO53F1blR6CsRNpNMbdWVORlRDtlYlHCkPG8= - -— sum.golang.org Az3grqn7jughv7yUNWhOB9nmpDegZy62mdk5jVS+cBqpRbe2tj0EZOP5dC/0fOi+NM7GJPoGMI5MrU/7fBAdNOCtOQU= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.16.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.16.0 new file mode 100644 index 0000000..369a561 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/fatih/color@v1.16.0 @@ -0,0 +1,9 @@ +20502185 +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= + +go.sum database tree +25096792 +qg+TuA1IOBOVUg/Ux34NgGzLG9gn1+nX380PrfDq8Po= + +— sum.golang.org Az3groCmffSTw0WOqF3rRZlIu4o/Vvb9T1JTSkKROUPtGIt4W6mpv0Hm9n1l5pgGAUSlwlTJTEQmq0t+h+ESoXwtMg8= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-colorable@v0.1.8 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-colorable@v0.1.8 index b9e92a5..e62b340 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-colorable@v0.1.8 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-colorable@v0.1.8 @@ -3,7 +3,7 @@ github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= go.sum database tree -18952638 -mdX0MUJqYqwGf5MgVR/FR/mc/J4txT/Wh4WYvBWox3o= +25097952 +VBBtlsjLu0ofKP8a6IKydRTMHAF85ZvvI1MxESBrcTw= -— sum.golang.org Az3grujzziW9B3C3dPms3TpPoUW0Bh6uXbToewJAV3NpxJMp9xaFCjfYzGexVL/9b3nhs7c04wou3pCVcfawUUeTjQQ= +— sum.golang.org Az3grhKZhAVI4Gn9Qgj0oDOVPtzWJG+7r9KFy1YRx556tilmEdaTNFr41erNpj7r6maOQ47CKQj6RivpHt3KH023KwM= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.19 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.19 deleted file mode 100644 index 561cde6..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.19 +++ /dev/null @@ -1,9 +0,0 @@ -17579932 -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= - -go.sum database tree -18952034 -i+6Lip+RnoQYhdWNDqamm7qzi1wJ5Ggpm1LZfd3hkX0= - -— sum.golang.org Az3grvC15CdzFvb/sSqZl01F79mAiU0QeJfLv0LK71sZiy52ChQO7IDa7+fG89Klp834sYMSl4B/LNz/NH56q/HJQws= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.20 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.20 new file mode 100644 index 0000000..c0cdcf7 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-isatty@v0.0.20 @@ -0,0 +1,9 @@ +20103885 +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= + +go.sum database tree +25097823 +nAhyziV3Kpeo/+WLiO+o57Kt1eJhQ55AJgW6NnZlnAU= + +— sum.golang.org Az3grngd5bRt3P5fzWmjtwwoxok3++E01ukFT6Vt8u8AdHQXnIRvURD/RjqkEhWJx2l5Pf59PWzZ1WyTjIW2xDlC5Q8= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-runewidth@v0.0.15 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-runewidth@v0.0.15 index bc8a2ed..40226a6 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-runewidth@v0.0.15 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/mattn/go-runewidth@v0.0.15 @@ -3,7 +3,7 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= go.sum database tree -18954122 -ueKaAz+x9Ed0b2h+3sFs/CCKpKmxNi9HlAqT2akr9b4= +25097955 +gkiyFx75xsUmlN2G1BLSj49TRPdf1yMn95CIxt4/C2Y= -— sum.golang.org Az3grhMncUODC4LNDsijagZ6Mipiz47qDssMbbKDPvxYKFQMyIAlekTVZFI8wrR7Z61qNN8JOXY7mmBVLFfvK2PCPwg= +— sum.golang.org Az3grhXF53na7sglMFhGsisjkRmtI1nyPAkN4e89oSAyAOPLLBJpqKzg/Yxcx6vtDOu5fJJfXb1FAuAkqO+wZ0KNCgU= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.4 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.4 deleted file mode 100644 index e49f3b8..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.4 +++ /dev/null @@ -1,9 +0,0 @@ -15724554 -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= - -go.sum database tree -18953900 -tO4FC17UQWSXrRj4U0l7o+kqIi8B4PK5VfyN1s0njAc= - -— sum.golang.org Az3grhhaEHMLzJm4fb4iko2VTpO6Gc+07cJUSx9phxpGospjgQsCF/Iuwm8R+NhEnnMQfChVlC4yx+egTDehgnq8PwU= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.7 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.7 new file mode 100644 index 0000000..66da729 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/rivo/uniseg@v0.4.7 @@ -0,0 +1,9 @@ +22647345 +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= + +go.sum database tree +25097955 +gkiyFx75xsUmlN2G1BLSj49TRPdf1yMn95CIxt4/C2Y= + +— sum.golang.org Az3grhXF53na7sglMFhGsisjkRmtI1nyPAkN4e89oSAyAOPLLBJpqKzg/Yxcx6vtDOu5fJJfXb1FAuAkqO+wZ0KNCgU= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 index 496222a..2245027 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 @@ -3,7 +3,7 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= go.sum database tree -18951892 -TMeeFJOVLBn2tDf5yXoFJ3Eam5gNKUW1nx+J/M4MgsI= +25097855 +JiyVCHPHBTVNoh1EvkOngeZyAB1JkYKswzlp77odRR0= -— sum.golang.org Az3grmjouT6NJ3Yy5kRW7MEIlAg6Xh8p5teDZP7+P7cQUiOmfnlUxDt9Hjy8v3+u6I6frSgwZrmQeluU/26AkeswTQ0= +— sum.golang.org Az3grku2YlSxuGz1pTtwFfdcHDshq2ttt0imaNgIFK5mEJR8p2CMtrwlRoBiHeBR2hiv85pYtaQV56y4tqwlzVkJNAo= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.4.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.4.0 index 38a0532..1421194 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.4.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.4.0 @@ -3,7 +3,7 @@ github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= go.sum database tree -18952661 -i1oopLcqTfH+RdRDBk5dFQOjO1oY56bBYX+dZONANl0= +25097547 +ym1dfy/lKbFR7ghPptVgGUHEWwHfd165Dj7bTW2quKQ= -— sum.golang.org Az3grnkF7D4uqOVcpIHhVXugC+wkG8G47Z7oK13FC59I68OHfs/hIOyKJ93X09006pPgTvCO82fU0cmXEq42hOAqfQk= +— sum.golang.org Az3gruKgyXcy38u+tZ4bZJ5D/pH5d3Beic4hOWwZUeJn6sRMZA6Dm14qcmC2hWbo2EZFB9ib96oJQ/8tsh7KrJGTtAk= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.5.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.5.0 index 55e146d..3206337 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.5.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.5.0 @@ -3,7 +3,7 @@ github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= go.sum database tree -18953324 -FQxwX09tk1KFbnecwXTvLNfFEifulcnh3i48EjeaWJk= +25096394 +CjDi4xe/8kqDqoJky7SySz2x6N40w/9+IH6ut+wKThs= -— sum.golang.org Az3grvy83CHdaPby3LXTrMcEj26m/UpJqgCET1TZLybI8/U6VXMJsUJETtFR/YHFZYy+r2CvcOhjjq8pgRTb/GCMKA0= +— sum.golang.org Az3grob2UOmC32hnfrcDsQ7BMTkiXBJ+vmY4aGFyA3IbDNx/5//lHfwCN9h+8jYX4LvfJlvOeSwXdzI/jU3OJgZarwM= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 index 46aa4a4..ed668b7 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 @@ -3,7 +3,7 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= go.sum database tree -18953957 -7j+LCgWWNrPUxM5U8tqVHxEcCyFK2mxpZ9VT4ynbjbs= +25096150 +D5Bun3mkLTzv48hY/f9reZerrAhlrun6yPQ3Ag94Klg= -— sum.golang.org Az3grjQvZryKSAY6fG7oIEL1ibb6p/dt1NtJ9Y9zDRN+UqW1FSR8InLPpdXzvQPNhh+XSS9sda78HztJCOMKVjq0gAQ= +— sum.golang.org Az3grsKRB0O/KJKj7DdLVjTKsddQ7yehnfgmuc1A62x4cfhvFhyGNMUuAR30l5fLE03BCduxcoC5ttxetjzZDN1NBAo= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.1 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.1 index d2b5435..5a1185b 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.1 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.1 @@ -3,7 +3,7 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= go.sum database tree -18953358 -UZSPg702sdb0P/u4Kp+hw6wDHmU3K8BG/L9DLa6lPcU= +25096746 +AVQK3gq/nPQvGKwGY7c69jOV4yD0yKsEgT61wYKDwWk= -— sum.golang.org Az3grrq91obQbqOhODYepCtelpXP2999TBWZd6049httAnH4tmt+d9fh5a2e1gkvKXtz3eYTR4LKcaOGQ2kfdiZzGg8= +— sum.golang.org Az3grqOVx6kUOAdO9i3/HYF1HoTSSIVLs5QKMTn0/0Z2gFCfhPuw+HIVknzlTnh3CGWpInX28OR+MqWBHVsXDAbnwgg= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.0 index d0aa33e..45eb08d 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.0 @@ -3,7 +3,7 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= go.sum database tree -18952802 -2SdxUnGw6E9CjAEIAP2SDJE8kHQojFB+qQv7tTRfC4o= +25097591 +zNpwnNIrUSMnfy2aJa8aPGGqL7Zm0Wexn2cw6t0cG5s= -— sum.golang.org Az3grr3s+yjQghBbJFV1fx0JzJI4KRXrD3kMsRJn/K8mCwZD90sCRCeJdf+F+tFNnhMZ4k066X37G7eekWc52BgSKQo= +— sum.golang.org Az3grjLITMCR7h0K/bF+VEOPaOfNgpWB7GIK+2vUZOIl7RIAGboH/TFoEP2HsD8gr23ei5SbNZoxTVwctqqOLK09Aww= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.1 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.1 index 7143518..57d6af3 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.1 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.8.1 @@ -3,7 +3,7 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= go.sum database tree -18953327 -lif/1+MdkVyjgTHS0eaZFCAW8RtzuYq5gkxJ0DPiwGo= +25097120 +solVIziE45Rd/gHZ7ykIzHdUXdd9lsiH+ij4PDjE3RA= -— sum.golang.org Az3grvEwnrZTyo3JIyrJEPxu8GyufVXhKa5YBXp4tLywOozeaTn18V32iscgjC6GbX3QAHVrEfBMZF2CsmrLL0yIdgs= +— sum.golang.org Az3grv3LxIRKkPhH1CdfTZ0gK/y+6CGZ5GClnZYdAUNrgm5LG42p2kqBEiYeevfZEQeIyeCU2BwnFxtIenVYY1h3Nwo= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/go.uber.org/multierr@v1.11.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/go.uber.org/multierr@v1.11.0 index 33059df..51b606c 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/go.uber.org/multierr@v1.11.0 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/go.uber.org/multierr@v1.11.0 @@ -3,7 +3,7 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.sum database tree -18953267 -ecsXN9wUchRN5B7oMeSLD3WwbfNuGO0mtXLFjKxu0RY= +25096408 +NXlKTExkyTmJHn7GnJM2EFIakCZE8T8iVMg5ANG/6jU= -— sum.golang.org Az3grh/js6IrmZExK1xpHM62NC/uNL5k/X4i3vtPPBf6FQiE+suOsHHL81jlVhzEalxXg9Fz0+zySA5ZBhkSXqdNhQ4= +— sum.golang.org Az3grvqzuW5vnO8KwgVNuhgHUIAMy5zFuSjDUbsmI13z12zuV3b059+LzzhNw/zYYbJPCTaCje6UTDXaaUX2bzR2OAs= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20230809094429-853ea248256d b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20230809094429-853ea248256d deleted file mode 100644 index baecfbb..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20230809094429-853ea248256d +++ /dev/null @@ -1,9 +0,0 @@ -18951700 -golang.org/x/exp v0.0.0-20230809094429-853ea248256d h1:wu5bD43Ana/nF1ZmaLr3lW/FQeJU8CcI+Ln7yWHViXE= -golang.org/x/exp v0.0.0-20230809094429-853ea248256d/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= - -go.sum database tree -18951965 -iSBRy2WKrv2xtYjXaEJZso0ACyIn9h5CacVEAV1urjQ= - -— sum.golang.org Az3grn1em1e5e2GdxE03ydNK/iCKKOjADiZYW9uiJTsvSVGwMF7jODGHuq/Tv6gYGb+UyyWQGj/jJNDUxPuROQT5Ogo= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20240409090435-93d18d7e34b8 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20240409090435-93d18d7e34b8 new file mode 100644 index 0000000..bff57f3 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/exp@v0.0.0-20240409090435-93d18d7e34b8 @@ -0,0 +1,9 @@ +25042178 +golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 h1:ESSUROHIBHg7USnszlcdmjBEwdMj9VUvU+OPk4yl2mc= +golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= + +go.sum database tree +25097946 +x5iTra47FpybGI4qDCZCOgExMjysxxXU33VJNFewwuM= + +— sum.golang.org Az3grmKWKB2AkHWG0YhLvmUEuBud3WqT8ppZXC32O7comGXwZAIIWVYj6wX57idh/1uqj7B3icB8EIfY9u4c7L5dBgI= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 index 4002bf3..8c53285 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 @@ -3,7 +3,7 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjq golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= go.sum database tree -18953039 -TSIXZlXC24m7Zf9LHUXnb3HLz5GDSAnbevERksAihe0= +25096920 +g+9ykYTIfNS3Fnd2afnY6ppaLZ/B1WeNdoTE2FpTGjk= -— sum.golang.org Az3grrzSdQNsgGGKRyZwwpAyGpLSS3tHxFiZLaZKRZlUf6dAY47V7DjT7Mbi5UJDGXf9Z8FSOfJeA/174CfkPtAMNQY= +— sum.golang.org Az3grrKXYiRLI/9WgzHq8sAVFL3gXKdhHnRnLVSjmK2BnjsxVl4lhZrXINHAytywvZyxW5JlMPgGQAe9Kovf5He9Jg8= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211216021012-1d35b9e2eb4e b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211216021012-1d35b9e2eb4e deleted file mode 100644 index caa8961..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20211216021012-1d35b9e2eb4e +++ /dev/null @@ -1,9 +0,0 @@ -8409401 -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= - -go.sum database tree -18951878 -iDcF9eulYT7JuxzFPIQuPmm8IXdNM+DEC+wY8IbXkhw= - -— sum.golang.org Az3grgqhJSu3GE7mspXQBoNGmM1TWZnfaxjzq1WXRCq0B3BJHCQrF9cVe+nRMLPVb/rhodmmJfmNewQgzI/OAtSpCwg= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.11.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.11.0 deleted file mode 100644 index d2b6140..0000000 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.11.0 +++ /dev/null @@ -1,9 +0,0 @@ -18876659 -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= - -go.sum database tree -18953129 -v3a0zWqBvLVRqbuy1MgsvxdkCJy2r7U+tU5jdhl3m6o= - -— sum.golang.org Az3grr1ZwsT2KZsxZVWYcLWtaL9xiLIfT3IlovSgT28YVq1+tKUDrk+HeteAuEHqbUvff+Oq+BRC7CNUnlBGJGeWdgE= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.19.0 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.19.0 new file mode 100644 index 0000000..4a646e6 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.19.0 @@ -0,0 +1,9 @@ +24955829 +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= + +go.sum database tree +25097945 +Reea3Nv7mPOKJ14wpcfZzIvm2jZZj49S3g2qofBzXWo= + +— sum.golang.org Az3grvi6WI/GBmeMZaXxLLPb4F/FQPdl5xFNhEbvot4VX97HFWfVAsZzX5+NuDrrvZlwmj+17VEq/fqvvLpvWgww6QQ= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 index 4c65bfb..d5deec8 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 @@ -3,7 +3,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= go.sum database tree -18952142 -bdPwON+b+dyqZTvIQjzVuy9ci0D6Jr39323shV3WxIs= +25097431 +hfsuwpM0Cj9aEFchQ1dGwe2nG8889BdVSzipTE2wfHs= -— sum.golang.org Az3grlkT18/nNCfYM2QtBtiaLAGI+Qp8/Wqot8C7ugQn7IlLvcGS6/jYsC+55cihYAULL1b1k9mf75NVjzdYlsb1AQU= +— sum.golang.org Az3grrofD7EPspURXpObK3RVWO9LSmsHJij+cDfcNEQqgH0WCsF+wVPUJkWY36KPs63OW+NBFym0yvIUMh0DCX8zXwM= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20231012003039-104605ab7028 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20231012003039-104605ab7028 new file mode 100644 index 0000000..97f0c72 --- /dev/null +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/xerrors@v0.0.0-20231012003039-104605ab7028 @@ -0,0 +1,9 @@ +19994904 +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= + +go.sum database tree +25097477 +NvhmgMf5o2QD6j1+1PV9HSW7zyQzUzWRan3unHZD8cs= + +— sum.golang.org Az3grmm1EE0nfJA20onEWRWNeKzulVR5B+RnIUw4UZ2PMBR2/6JF9yzfbbDdT6TOkckLOx6+lNGrT1q0bImxJ+ExLgs= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c index 3624e85..40134ac 100644 --- a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c +++ b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c @@ -3,7 +3,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= go.sum database tree -18953231 -oH2nMoG1WPNsOfEyhwdemlb4q1JS+S91WwZG3lEgQzY= +25096498 +Du/7v3jrVRAeW1NFPYSI/sEe65sxK6V5KuElJbxU52I= -— sum.golang.org Az3grl3UEB8MKdFbW2LTxviNtRsC2l79vzfooNkPBTGmjZ7PmElk5qa2Jtd/G2fpGpfVO7j0/1gNCfl4bo+pFoNphw0= +— sum.golang.org Az3grjDrlGDDXaIKF9fq79yW8PBF3bCKT/AIv+7igQF0tEBPNSIK0715duWCIaHOCiGwplQS8T7sj+FE4wefY5aoiQE= diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x032/849 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x032/849 deleted file mode 100644 index 6cd8ecc..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x032/849 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x055/239 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x055/239 deleted file mode 100644 index f888948..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x055/239 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x061/424 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x061/424 deleted file mode 100644 index 7ab3216..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x061/424 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x063/929 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x063/929 deleted file mode 100644 index 4f918e1..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x063/929 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x068/671 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x068/671 deleted file mode 100644 index 4843266..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x068/671 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x073/736 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x073/736 deleted file mode 100644 index e96b4b4..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x073/736 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030 deleted file mode 100644 index f543c3c..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030.p/198 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030.p/198 deleted file mode 100644 index 51d8012..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/030.p/198 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/031 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/031 deleted file mode 100644 index f777b3d..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/031 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/033 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/033 deleted file mode 100644 index bf822e1..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/033 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/034 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/034 deleted file mode 100644 index c57d14a..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/034 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/035 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/035 deleted file mode 100644 index da42410..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/035 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/036 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/036 deleted file mode 100644 index 6bcf7ae..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/036 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037 deleted file mode 100644 index 8bf3865..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037.p/124 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037.p/124 deleted file mode 100644 index 78da791..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/037.p/124 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038 deleted file mode 100644 index 165c292..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038.p/229 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038.p/229 deleted file mode 100644 index 710f537..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/038.p/229 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/039.p/138 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/039.p/138 deleted file mode 100644 index 83f9219..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x074/039.p/138 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/105 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/105 new file mode 100644 index 0000000..ba056e7 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/105 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/530 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/530 new file mode 100644 index 0000000..2374a13 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x078/530 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x080/086 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x080/086 new file mode 100644 index 0000000..95e5d83 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x080/086 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x088/466 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x088/466 new file mode 100644 index 0000000..9ab1677 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x088/466 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/483 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/483 new file mode 100644 index 0000000..158988a Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/483 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/509 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/509 new file mode 100644 index 0000000..35e1bd6 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/509 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/821 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/821 new file mode 100644 index 0000000..5c5d963 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x097/821 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031 new file mode 100644 index 0000000..48cbecb Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031.p/226 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031.p/226 new file mode 100644 index 0000000..c0d5160 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/031.p/226 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/032 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/032 new file mode 100644 index 0000000..a7a12ce Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/032 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/033 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/033 new file mode 100644 index 0000000..bfafc97 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/033 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/034 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/034 new file mode 100644 index 0000000..bb732a8 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/034 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/035 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/035 new file mode 100644 index 0000000..0777f9e Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/035 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/036 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/036 new file mode 100644 index 0000000..fa52dd1 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/036 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/037 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/037 new file mode 100644 index 0000000..34fa5ad Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/037 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/224 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/224 new file mode 100644 index 0000000..d456ccc Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/224 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/227 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/227 new file mode 100644 index 0000000..9a08806 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x098/038.p/227 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/128 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/128 deleted file mode 100644 index dc31fc6..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/128 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/215 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/215 deleted file mode 100644 index 050e930..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/215 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/239 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/239 deleted file mode 100644 index 60e0127..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/239 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/249 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/249 deleted file mode 100644 index f595bb0..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/249 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/268 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/268 deleted file mode 100644 index 3cd096d..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/268 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/288 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/288 deleted file mode 100644 index 1e1c979..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/288 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/46 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/46 deleted file mode 100644 index 9377053..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/46 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/53 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/53 deleted file mode 100644 index ea74a95..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/53 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/54 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/54 deleted file mode 100644 index 6ee97da..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/54 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/55 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/55 deleted file mode 100644 index f228c51..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/289.p/55 and /dev/null differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/305 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/305 new file mode 100644 index 0000000..656e2ab Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/305 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/306 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/306 new file mode 100644 index 0000000..192686f Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/306 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/312 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/312 new file mode 100644 index 0000000..408a95a Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/312 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/345 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/345 new file mode 100644 index 0000000..8a59358 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/345 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/380 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/380 new file mode 100644 index 0000000..4f1d1f5 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/380 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/239 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/239 new file mode 100644 index 0000000..119ec10 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/239 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/246 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/246 new file mode 100644 index 0000000..7102b68 Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/382.p/246 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/126 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/126 new file mode 100644 index 0000000..48bdbdf Binary files /dev/null and b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/126 differ diff --git a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/33 b/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/33 deleted file mode 100644 index 79850c2..0000000 Binary files a/dependencies/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/001.p/33 and /dev/null differ diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/.github/workflows/test.yml b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/.github/workflows/test.yml new file mode 100644 index 0000000..c20f671 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/.github/workflows/test.yml @@ -0,0 +1,17 @@ +name: Go tests +on: [push, pull_request] +jobs: + test: + name: Go ${{ matrix.go }} + runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.20', '1.x' ] + steps: + - uses: actions/setup-go@v2 + with: { go-version: "${{ matrix.go }}" } + - uses: actions/checkout@v2 + - run: go test -short ./... + - run: go test -short -tags purego ./... + - run: GOARCH=arm64 go test -c + - run: GOARCH=arm go test -c diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/LICENSE b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/README.md b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/README.md new file mode 100644 index 0000000..24e2457 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/README.md @@ -0,0 +1,14 @@ +# filippo.io/edwards25519 + +``` +import "filippo.io/edwards25519" +``` + +This library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives. +Read the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo.io/edwards25519). + +The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality. + +Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. + +Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements. diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/doc.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/doc.go new file mode 100644 index 0000000..ab6aaeb --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/doc.go @@ -0,0 +1,20 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package edwards25519 implements group logic for the twisted Edwards curve +// +// -x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2 +// +// This is better known as the Edwards curve equivalent to Curve25519, and is +// the curve used by the Ed25519 signature scheme. +// +// Most users don't need this package, and should instead use crypto/ed25519 for +// signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or +// github.com/gtank/ristretto255 for prime order group logic. +// +// However, developers who do need to interact with low-level edwards25519 +// operations can use this package, which is an extended version of +// crypto/internal/edwards25519 from the standard library repackaged as +// an importable module. +package edwards25519 diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519.go new file mode 100644 index 0000000..a744da2 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519.go @@ -0,0 +1,427 @@ +// Copyright (c) 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "errors" + + "filippo.io/edwards25519/field" +) + +// Point types. + +type projP1xP1 struct { + X, Y, Z, T field.Element +} + +type projP2 struct { + X, Y, Z field.Element +} + +// Point represents a point on the edwards25519 curve. +// +// This type works similarly to math/big.Int, and all arguments and receivers +// are allowed to alias. +// +// The zero value is NOT valid, and it may be used only as a receiver. +type Point struct { + // Make the type not comparable (i.e. used with == or as a map key), as + // equivalent points can be represented by different Go values. + _ incomparable + + // The point is internally represented in extended coordinates (X, Y, Z, T) + // where x = X/Z, y = Y/Z, and xy = T/Z per https://eprint.iacr.org/2008/522. + x, y, z, t field.Element +} + +type incomparable [0]func() + +func checkInitialized(points ...*Point) { + for _, p := range points { + if p.x == (field.Element{}) && p.y == (field.Element{}) { + panic("edwards25519: use of uninitialized Point") + } + } +} + +type projCached struct { + YplusX, YminusX, Z, T2d field.Element +} + +type affineCached struct { + YplusX, YminusX, T2d field.Element +} + +// Constructors. + +func (v *projP2) Zero() *projP2 { + v.X.Zero() + v.Y.One() + v.Z.One() + return v +} + +// identity is the point at infinity. +var identity, _ = new(Point).SetBytes([]byte{ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) + +// NewIdentityPoint returns a new Point set to the identity. +func NewIdentityPoint() *Point { + return new(Point).Set(identity) +} + +// generator is the canonical curve basepoint. See TestGenerator for the +// correspondence of this encoding with the values in RFC 8032. +var generator, _ = new(Point).SetBytes([]byte{ + 0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66}) + +// NewGeneratorPoint returns a new Point set to the canonical generator. +func NewGeneratorPoint() *Point { + return new(Point).Set(generator) +} + +func (v *projCached) Zero() *projCached { + v.YplusX.One() + v.YminusX.One() + v.Z.One() + v.T2d.Zero() + return v +} + +func (v *affineCached) Zero() *affineCached { + v.YplusX.One() + v.YminusX.One() + v.T2d.Zero() + return v +} + +// Assignments. + +// Set sets v = u, and returns v. +func (v *Point) Set(u *Point) *Point { + *v = *u + return v +} + +// Encoding. + +// Bytes returns the canonical 32-byte encoding of v, according to RFC 8032, +// Section 5.1.2. +func (v *Point) Bytes() []byte { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var buf [32]byte + return v.bytes(&buf) +} + +func (v *Point) bytes(buf *[32]byte) []byte { + checkInitialized(v) + + var zInv, x, y field.Element + zInv.Invert(&v.z) // zInv = 1 / Z + x.Multiply(&v.x, &zInv) // x = X / Z + y.Multiply(&v.y, &zInv) // y = Y / Z + + out := copyFieldElement(buf, &y) + out[31] |= byte(x.IsNegative() << 7) + return out +} + +var feOne = new(field.Element).One() + +// SetBytes sets v = x, where x is a 32-byte encoding of v. If x does not +// represent a valid point on the curve, SetBytes returns nil and an error and +// the receiver is unchanged. Otherwise, SetBytes returns v. +// +// Note that SetBytes accepts all non-canonical encodings of valid points. +// That is, it follows decoding rules that match most implementations in +// the ecosystem rather than RFC 8032. +func (v *Point) SetBytes(x []byte) (*Point, error) { + // Specifically, the non-canonical encodings that are accepted are + // 1) the ones where the field element is not reduced (see the + // (*field.Element).SetBytes docs) and + // 2) the ones where the x-coordinate is zero and the sign bit is set. + // + // Read more at https://hdevalence.ca/blog/2020-10-04-its-25519am, + // specifically the "Canonical A, R" section. + + y, err := new(field.Element).SetBytes(x) + if err != nil { + return nil, errors.New("edwards25519: invalid point encoding length") + } + + // -x² + y² = 1 + dx²y² + // x² + dx²y² = x²(dy² + 1) = y² - 1 + // x² = (y² - 1) / (dy² + 1) + + // u = y² - 1 + y2 := new(field.Element).Square(y) + u := new(field.Element).Subtract(y2, feOne) + + // v = dy² + 1 + vv := new(field.Element).Multiply(y2, d) + vv = vv.Add(vv, feOne) + + // x = +√(u/v) + xx, wasSquare := new(field.Element).SqrtRatio(u, vv) + if wasSquare == 0 { + return nil, errors.New("edwards25519: invalid point encoding") + } + + // Select the negative square root if the sign bit is set. + xxNeg := new(field.Element).Negate(xx) + xx = xx.Select(xxNeg, xx, int(x[31]>>7)) + + v.x.Set(xx) + v.y.Set(y) + v.z.One() + v.t.Multiply(xx, y) // xy = T / Z + + return v, nil +} + +func copyFieldElement(buf *[32]byte, v *field.Element) []byte { + copy(buf[:], v.Bytes()) + return buf[:] +} + +// Conversions. + +func (v *projP2) FromP1xP1(p *projP1xP1) *projP2 { + v.X.Multiply(&p.X, &p.T) + v.Y.Multiply(&p.Y, &p.Z) + v.Z.Multiply(&p.Z, &p.T) + return v +} + +func (v *projP2) FromP3(p *Point) *projP2 { + v.X.Set(&p.x) + v.Y.Set(&p.y) + v.Z.Set(&p.z) + return v +} + +func (v *Point) fromP1xP1(p *projP1xP1) *Point { + v.x.Multiply(&p.X, &p.T) + v.y.Multiply(&p.Y, &p.Z) + v.z.Multiply(&p.Z, &p.T) + v.t.Multiply(&p.X, &p.Y) + return v +} + +func (v *Point) fromP2(p *projP2) *Point { + v.x.Multiply(&p.X, &p.Z) + v.y.Multiply(&p.Y, &p.Z) + v.z.Square(&p.Z) + v.t.Multiply(&p.X, &p.Y) + return v +} + +// d is a constant in the curve equation. +var d, _ = new(field.Element).SetBytes([]byte{ + 0xa3, 0x78, 0x59, 0x13, 0xca, 0x4d, 0xeb, 0x75, + 0xab, 0xd8, 0x41, 0x41, 0x4d, 0x0a, 0x70, 0x00, + 0x98, 0xe8, 0x79, 0x77, 0x79, 0x40, 0xc7, 0x8c, + 0x73, 0xfe, 0x6f, 0x2b, 0xee, 0x6c, 0x03, 0x52}) +var d2 = new(field.Element).Add(d, d) + +func (v *projCached) FromP3(p *Point) *projCached { + v.YplusX.Add(&p.y, &p.x) + v.YminusX.Subtract(&p.y, &p.x) + v.Z.Set(&p.z) + v.T2d.Multiply(&p.t, d2) + return v +} + +func (v *affineCached) FromP3(p *Point) *affineCached { + v.YplusX.Add(&p.y, &p.x) + v.YminusX.Subtract(&p.y, &p.x) + v.T2d.Multiply(&p.t, d2) + + var invZ field.Element + invZ.Invert(&p.z) + v.YplusX.Multiply(&v.YplusX, &invZ) + v.YminusX.Multiply(&v.YminusX, &invZ) + v.T2d.Multiply(&v.T2d, &invZ) + return v +} + +// (Re)addition and subtraction. + +// Add sets v = p + q, and returns v. +func (v *Point) Add(p, q *Point) *Point { + checkInitialized(p, q) + qCached := new(projCached).FromP3(q) + result := new(projP1xP1).Add(p, qCached) + return v.fromP1xP1(result) +} + +// Subtract sets v = p - q, and returns v. +func (v *Point) Subtract(p, q *Point) *Point { + checkInitialized(p, q) + qCached := new(projCached).FromP3(q) + result := new(projP1xP1).Sub(p, qCached) + return v.fromP1xP1(result) +} + +func (v *projP1xP1) Add(p *Point, q *projCached) *projP1xP1 { + var YplusX, YminusX, PP, MM, TT2d, ZZ2 field.Element + + YplusX.Add(&p.y, &p.x) + YminusX.Subtract(&p.y, &p.x) + + PP.Multiply(&YplusX, &q.YplusX) + MM.Multiply(&YminusX, &q.YminusX) + TT2d.Multiply(&p.t, &q.T2d) + ZZ2.Multiply(&p.z, &q.Z) + + ZZ2.Add(&ZZ2, &ZZ2) + + v.X.Subtract(&PP, &MM) + v.Y.Add(&PP, &MM) + v.Z.Add(&ZZ2, &TT2d) + v.T.Subtract(&ZZ2, &TT2d) + return v +} + +func (v *projP1xP1) Sub(p *Point, q *projCached) *projP1xP1 { + var YplusX, YminusX, PP, MM, TT2d, ZZ2 field.Element + + YplusX.Add(&p.y, &p.x) + YminusX.Subtract(&p.y, &p.x) + + PP.Multiply(&YplusX, &q.YminusX) // flipped sign + MM.Multiply(&YminusX, &q.YplusX) // flipped sign + TT2d.Multiply(&p.t, &q.T2d) + ZZ2.Multiply(&p.z, &q.Z) + + ZZ2.Add(&ZZ2, &ZZ2) + + v.X.Subtract(&PP, &MM) + v.Y.Add(&PP, &MM) + v.Z.Subtract(&ZZ2, &TT2d) // flipped sign + v.T.Add(&ZZ2, &TT2d) // flipped sign + return v +} + +func (v *projP1xP1) AddAffine(p *Point, q *affineCached) *projP1xP1 { + var YplusX, YminusX, PP, MM, TT2d, Z2 field.Element + + YplusX.Add(&p.y, &p.x) + YminusX.Subtract(&p.y, &p.x) + + PP.Multiply(&YplusX, &q.YplusX) + MM.Multiply(&YminusX, &q.YminusX) + TT2d.Multiply(&p.t, &q.T2d) + + Z2.Add(&p.z, &p.z) + + v.X.Subtract(&PP, &MM) + v.Y.Add(&PP, &MM) + v.Z.Add(&Z2, &TT2d) + v.T.Subtract(&Z2, &TT2d) + return v +} + +func (v *projP1xP1) SubAffine(p *Point, q *affineCached) *projP1xP1 { + var YplusX, YminusX, PP, MM, TT2d, Z2 field.Element + + YplusX.Add(&p.y, &p.x) + YminusX.Subtract(&p.y, &p.x) + + PP.Multiply(&YplusX, &q.YminusX) // flipped sign + MM.Multiply(&YminusX, &q.YplusX) // flipped sign + TT2d.Multiply(&p.t, &q.T2d) + + Z2.Add(&p.z, &p.z) + + v.X.Subtract(&PP, &MM) + v.Y.Add(&PP, &MM) + v.Z.Subtract(&Z2, &TT2d) // flipped sign + v.T.Add(&Z2, &TT2d) // flipped sign + return v +} + +// Doubling. + +func (v *projP1xP1) Double(p *projP2) *projP1xP1 { + var XX, YY, ZZ2, XplusYsq field.Element + + XX.Square(&p.X) + YY.Square(&p.Y) + ZZ2.Square(&p.Z) + ZZ2.Add(&ZZ2, &ZZ2) + XplusYsq.Add(&p.X, &p.Y) + XplusYsq.Square(&XplusYsq) + + v.Y.Add(&YY, &XX) + v.Z.Subtract(&YY, &XX) + + v.X.Subtract(&XplusYsq, &v.Y) + v.T.Subtract(&ZZ2, &v.Z) + return v +} + +// Negation. + +// Negate sets v = -p, and returns v. +func (v *Point) Negate(p *Point) *Point { + checkInitialized(p) + v.x.Negate(&p.x) + v.y.Set(&p.y) + v.z.Set(&p.z) + v.t.Negate(&p.t) + return v +} + +// Equal returns 1 if v is equivalent to u, and 0 otherwise. +func (v *Point) Equal(u *Point) int { + checkInitialized(v, u) + + var t1, t2, t3, t4 field.Element + t1.Multiply(&v.x, &u.z) + t2.Multiply(&u.x, &v.z) + t3.Multiply(&v.y, &u.z) + t4.Multiply(&u.y, &v.z) + + return t1.Equal(&t2) & t3.Equal(&t4) +} + +// Constant-time operations + +// Select sets v to a if cond == 1 and to b if cond == 0. +func (v *projCached) Select(a, b *projCached, cond int) *projCached { + v.YplusX.Select(&a.YplusX, &b.YplusX, cond) + v.YminusX.Select(&a.YminusX, &b.YminusX, cond) + v.Z.Select(&a.Z, &b.Z, cond) + v.T2d.Select(&a.T2d, &b.T2d, cond) + return v +} + +// Select sets v to a if cond == 1 and to b if cond == 0. +func (v *affineCached) Select(a, b *affineCached, cond int) *affineCached { + v.YplusX.Select(&a.YplusX, &b.YplusX, cond) + v.YminusX.Select(&a.YminusX, &b.YminusX, cond) + v.T2d.Select(&a.T2d, &b.T2d, cond) + return v +} + +// CondNeg negates v if cond == 1 and leaves it unchanged if cond == 0. +func (v *projCached) CondNeg(cond int) *projCached { + v.YplusX.Swap(&v.YminusX, cond) + v.T2d.Select(new(field.Element).Negate(&v.T2d), &v.T2d, cond) + return v +} + +// CondNeg negates v if cond == 1 and leaves it unchanged if cond == 0. +func (v *affineCached) CondNeg(cond int) *affineCached { + v.YplusX.Swap(&v.YminusX, cond) + v.T2d.Select(new(field.Element).Negate(&v.T2d), &v.T2d, cond) + return v +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519_test.go new file mode 100644 index 0000000..fe511bd --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/edwards25519_test.go @@ -0,0 +1,311 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "encoding/hex" + "reflect" + "testing" + + "filippo.io/edwards25519/field" +) + +var B = NewGeneratorPoint() +var I = NewIdentityPoint() + +func checkOnCurve(t *testing.T, points ...*Point) { + t.Helper() + for i, p := range points { + var XX, YY, ZZ, ZZZZ field.Element + XX.Square(&p.x) + YY.Square(&p.y) + ZZ.Square(&p.z) + ZZZZ.Square(&ZZ) + // -x² + y² = 1 + dx²y² + // -(X/Z)² + (Y/Z)² = 1 + d(X/Z)²(Y/Z)² + // (-X² + Y²)/Z² = 1 + (dX²Y²)/Z⁴ + // (-X² + Y²)*Z² = Z⁴ + dX²Y² + var lhs, rhs field.Element + lhs.Subtract(&YY, &XX).Multiply(&lhs, &ZZ) + rhs.Multiply(d, &XX).Multiply(&rhs, &YY).Add(&rhs, &ZZZZ) + if lhs.Equal(&rhs) != 1 { + t.Errorf("X, Y, and Z do not specify a point on the curve\nX = %v\nY = %v\nZ = %v", p.x, p.y, p.z) + } + // xy = T/Z + lhs.Multiply(&p.x, &p.y) + rhs.Multiply(&p.z, &p.t) + if lhs.Equal(&rhs) != 1 { + t.Errorf("point %d is not valid\nX = %v\nY = %v\nZ = %v", i, p.x, p.y, p.z) + } + } +} + +func TestGenerator(t *testing.T) { + // These are the coordinates of B from RFC 8032, Section 5.1, converted to + // little endian hex. + x := "1ad5258f602d56c9b2a7259560c72c695cdcd6fd31e2a4c0fe536ecdd3366921" + y := "5866666666666666666666666666666666666666666666666666666666666666" + if got := hex.EncodeToString(B.x.Bytes()); got != x { + t.Errorf("wrong B.x: got %s, expected %s", got, x) + } + if got := hex.EncodeToString(B.y.Bytes()); got != y { + t.Errorf("wrong B.y: got %s, expected %s", got, y) + } + if B.z.Equal(feOne) != 1 { + t.Errorf("wrong B.z: got %v, expected 1", B.z) + } + // Check that t is correct. + checkOnCurve(t, B) +} + +func TestAddSubNegOnBasePoint(t *testing.T) { + checkLhs, checkRhs := &Point{}, &Point{} + + checkLhs.Add(B, B) + tmpP2 := new(projP2).FromP3(B) + tmpP1xP1 := new(projP1xP1).Double(tmpP2) + checkRhs.fromP1xP1(tmpP1xP1) + if checkLhs.Equal(checkRhs) != 1 { + t.Error("B + B != [2]B") + } + checkOnCurve(t, checkLhs, checkRhs) + + checkLhs.Subtract(B, B) + Bneg := new(Point).Negate(B) + checkRhs.Add(B, Bneg) + if checkLhs.Equal(checkRhs) != 1 { + t.Error("B - B != B + (-B)") + } + if I.Equal(checkLhs) != 1 { + t.Error("B - B != 0") + } + if I.Equal(checkRhs) != 1 { + t.Error("B + (-B) != 0") + } + checkOnCurve(t, checkLhs, checkRhs, Bneg) +} + +func TestComparable(t *testing.T) { + if reflect.TypeOf(Point{}).Comparable() { + t.Error("Point is unexpectedly comparable") + } +} + +func TestInvalidEncodings(t *testing.T) { + // An invalid point, that also happens to have y > p. + invalid := "efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f" + p := NewGeneratorPoint() + if out, err := p.SetBytes(decodeHex(invalid)); err == nil { + t.Error("expected error for invalid point") + } else if out != nil { + t.Error("SetBytes did not return nil on an invalid encoding") + } else if p.Equal(B) != 1 { + t.Error("the Point was modified while decoding an invalid encoding") + } + checkOnCurve(t, p) +} + +func TestNonCanonicalPoints(t *testing.T) { + type test struct { + name string + encoding, canonical string + } + tests := []test{ + // Points with x = 0 and the sign bit set. With x = 0 the curve equation + // gives y² = 1, so y = ±1. 1 has two valid encodings. + { + "y=1,sign-", + "0100000000000000000000000000000000000000000000000000000000000080", + "0100000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+1,sign-", + "eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0100000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p-1,sign-", + "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + }, + + // Non-canonical y encodings with values 2²⁵⁵-19 (p) to 2²⁵⁵-1 (p+18). + { + "y=p,sign+", + "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0000000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p,sign-", + "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0000000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+1,sign+", + "eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0100000000000000000000000000000000000000000000000000000000000000", + }, + // "y=p+1,sign-" is already tested above. + // p+2 is not a valid y-coordinate. + { + "y=p+3,sign+", + "f0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0300000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+3,sign-", + "f0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0300000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+4,sign+", + "f1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0400000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+4,sign-", + "f1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0400000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+5,sign+", + "f2ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0500000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+5,sign-", + "f2ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0500000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+6,sign+", + "f3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0600000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+6,sign-", + "f3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0600000000000000000000000000000000000000000000000000000000000080", + }, + // p+7 is not a valid y-coordinate. + // p+8 is not a valid y-coordinate. + { + "y=p+9,sign+", + "f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0900000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+9,sign-", + "f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0900000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+10,sign+", + "f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0a00000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+10,sign-", + "f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0a00000000000000000000000000000000000000000000000000000000000080", + }, + // p+11 is not a valid y-coordinate. + // p+12 is not a valid y-coordinate. + // p+13 is not a valid y-coordinate. + { + "y=p+14,sign+", + "fbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0e00000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+14,sign-", + "fbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0e00000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+15,sign+", + "fcffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0f00000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+15,sign-", + "fcffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0f00000000000000000000000000000000000000000000000000000000000080", + }, + { + "y=p+16,sign+", + "fdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "1000000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+16,sign-", + "fdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "1000000000000000000000000000000000000000000000000000000000000080", + }, + // p+17 is not a valid y-coordinate. + { + "y=p+18,sign+", + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "1200000000000000000000000000000000000000000000000000000000000000", + }, + { + "y=p+18,sign-", + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "1200000000000000000000000000000000000000000000000000000000000080", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + p1, err := new(Point).SetBytes(decodeHex(tt.encoding)) + if err != nil { + t.Fatalf("error decoding non-canonical point: %v", err) + } + p2, err := new(Point).SetBytes(decodeHex(tt.canonical)) + if err != nil { + t.Fatalf("error decoding canonical point: %v", err) + } + if p1.Equal(p2) != 1 { + t.Errorf("equivalent points are not equal: %v, %v", p1, p2) + } + if encoding := hex.EncodeToString(p1.Bytes()); encoding != tt.canonical { + t.Errorf("re-encoding does not match canonical; got %q, expected %q", encoding, tt.canonical) + } + checkOnCurve(t, p1, p2) + }) + } +} + +var testAllocationsSink byte + +func TestAllocations(t *testing.T) { + if allocs := testing.AllocsPerRun(100, func() { + p := NewIdentityPoint() + p.Add(p, NewGeneratorPoint()) + s := NewScalar() + testAllocationsSink ^= s.Bytes()[0] + testAllocationsSink ^= p.Bytes()[0] + }); allocs > 0 { + t.Errorf("expected zero allocations, got %0.1v", allocs) + } +} + +func decodeHex(s string) []byte { + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + return b +} + +func BenchmarkEncodingDecoding(b *testing.B) { + p := new(Point).Set(dalekScalarBasepoint) + for i := 0; i < b.N; i++ { + buf := p.Bytes() + _, err := p.SetBytes(buf) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra.go new file mode 100644 index 0000000..d152d68 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra.go @@ -0,0 +1,349 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +// This file contains additional functionality that is not included in the +// upstream crypto/internal/edwards25519 package. + +import ( + "errors" + + "filippo.io/edwards25519/field" +) + +// ExtendedCoordinates returns v in extended coordinates (X:Y:Z:T) where +// x = X/Z, y = Y/Z, and xy = T/Z as in https://eprint.iacr.org/2008/522. +func (v *Point) ExtendedCoordinates() (X, Y, Z, T *field.Element) { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. Don't change the style without making + // sure it doesn't increase the inliner cost. + var e [4]field.Element + X, Y, Z, T = v.extendedCoordinates(&e) + return +} + +func (v *Point) extendedCoordinates(e *[4]field.Element) (X, Y, Z, T *field.Element) { + checkInitialized(v) + X = e[0].Set(&v.x) + Y = e[1].Set(&v.y) + Z = e[2].Set(&v.z) + T = e[3].Set(&v.t) + return +} + +// SetExtendedCoordinates sets v = (X:Y:Z:T) in extended coordinates where +// x = X/Z, y = Y/Z, and xy = T/Z as in https://eprint.iacr.org/2008/522. +// +// If the coordinates are invalid or don't represent a valid point on the curve, +// SetExtendedCoordinates returns nil and an error and the receiver is +// unchanged. Otherwise, SetExtendedCoordinates returns v. +func (v *Point) SetExtendedCoordinates(X, Y, Z, T *field.Element) (*Point, error) { + if !isOnCurve(X, Y, Z, T) { + return nil, errors.New("edwards25519: invalid point coordinates") + } + v.x.Set(X) + v.y.Set(Y) + v.z.Set(Z) + v.t.Set(T) + return v, nil +} + +func isOnCurve(X, Y, Z, T *field.Element) bool { + var lhs, rhs field.Element + XX := new(field.Element).Square(X) + YY := new(field.Element).Square(Y) + ZZ := new(field.Element).Square(Z) + TT := new(field.Element).Square(T) + // -x² + y² = 1 + dx²y² + // -(X/Z)² + (Y/Z)² = 1 + d(T/Z)² + // -X² + Y² = Z² + dT² + lhs.Subtract(YY, XX) + rhs.Multiply(d, TT).Add(&rhs, ZZ) + if lhs.Equal(&rhs) != 1 { + return false + } + // xy = T/Z + // XY/Z² = T/Z + // XY = TZ + lhs.Multiply(X, Y) + rhs.Multiply(T, Z) + return lhs.Equal(&rhs) == 1 +} + +// BytesMontgomery converts v to a point on the birationally-equivalent +// Curve25519 Montgomery curve, and returns its canonical 32 bytes encoding +// according to RFC 7748. +// +// Note that BytesMontgomery only encodes the u-coordinate, so v and -v encode +// to the same value. If v is the identity point, BytesMontgomery returns 32 +// zero bytes, analogously to the X25519 function. +// +// The lack of an inverse operation (such as SetMontgomeryBytes) is deliberate: +// while every valid edwards25519 point has a unique u-coordinate Montgomery +// encoding, X25519 accepts inputs on the quadratic twist, which don't correspond +// to any edwards25519 point, and every other X25519 input corresponds to two +// edwards25519 points. +func (v *Point) BytesMontgomery() []byte { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var buf [32]byte + return v.bytesMontgomery(&buf) +} + +func (v *Point) bytesMontgomery(buf *[32]byte) []byte { + checkInitialized(v) + + // RFC 7748, Section 4.1 provides the bilinear map to calculate the + // Montgomery u-coordinate + // + // u = (1 + y) / (1 - y) + // + // where y = Y / Z. + + var y, recip, u field.Element + + y.Multiply(&v.y, y.Invert(&v.z)) // y = Y / Z + recip.Invert(recip.Subtract(feOne, &y)) // r = 1/(1 - y) + u.Multiply(u.Add(feOne, &y), &recip) // u = (1 + y)*r + + return copyFieldElement(buf, &u) +} + +// MultByCofactor sets v = 8 * p, and returns v. +func (v *Point) MultByCofactor(p *Point) *Point { + checkInitialized(p) + result := projP1xP1{} + pp := (&projP2{}).FromP3(p) + result.Double(pp) + pp.FromP1xP1(&result) + result.Double(pp) + pp.FromP1xP1(&result) + result.Double(pp) + return v.fromP1xP1(&result) +} + +// Given k > 0, set s = s**(2*i). +func (s *Scalar) pow2k(k int) { + for i := 0; i < k; i++ { + s.Multiply(s, s) + } +} + +// Invert sets s to the inverse of a nonzero scalar v, and returns s. +// +// If t is zero, Invert returns zero. +func (s *Scalar) Invert(t *Scalar) *Scalar { + // Uses a hardcoded sliding window of width 4. + var table [8]Scalar + var tt Scalar + tt.Multiply(t, t) + table[0] = *t + for i := 0; i < 7; i++ { + table[i+1].Multiply(&table[i], &tt) + } + // Now table = [t**1, t**3, t**5, t**7, t**9, t**11, t**13, t**15] + // so t**k = t[k/2] for odd k + + // To compute the sliding window digits, use the following Sage script: + + // sage: import itertools + // sage: def sliding_window(w,k): + // ....: digits = [] + // ....: while k > 0: + // ....: if k % 2 == 1: + // ....: kmod = k % (2**w) + // ....: digits.append(kmod) + // ....: k = k - kmod + // ....: else: + // ....: digits.append(0) + // ....: k = k // 2 + // ....: return digits + + // Now we can compute s roughly as follows: + + // sage: s = 1 + // sage: for coeff in reversed(sliding_window(4,l-2)): + // ....: s = s*s + // ....: if coeff > 0 : + // ....: s = s*t**coeff + + // This works on one bit at a time, with many runs of zeros. + // The digits can be collapsed into [(count, coeff)] as follows: + + // sage: [(len(list(group)),d) for d,group in itertools.groupby(sliding_window(4,l-2))] + + // Entries of the form (k, 0) turn into pow2k(k) + // Entries of the form (1, coeff) turn into a squaring and then a table lookup. + // We can fold the squaring into the previous pow2k(k) as pow2k(k+1). + + *s = table[1/2] + s.pow2k(127 + 1) + s.Multiply(s, &table[1/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[9/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[11/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[13/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[15/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[7/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[15/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[5/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[1/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[15/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[15/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[7/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[3/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[11/2]) + s.pow2k(5 + 1) + s.Multiply(s, &table[11/2]) + s.pow2k(9 + 1) + s.Multiply(s, &table[9/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[3/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[3/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[3/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[9/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[7/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[3/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[13/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[7/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[9/2]) + s.pow2k(3 + 1) + s.Multiply(s, &table[15/2]) + s.pow2k(4 + 1) + s.Multiply(s, &table[11/2]) + + return s +} + +// MultiScalarMult sets v = sum(scalars[i] * points[i]), and returns v. +// +// Execution time depends only on the lengths of the two slices, which must match. +func (v *Point) MultiScalarMult(scalars []*Scalar, points []*Point) *Point { + if len(scalars) != len(points) { + panic("edwards25519: called MultiScalarMult with different size inputs") + } + checkInitialized(points...) + + // Proceed as in the single-base case, but share doublings + // between each point in the multiscalar equation. + + // Build lookup tables for each point + tables := make([]projLookupTable, len(points)) + for i := range tables { + tables[i].FromP3(points[i]) + } + // Compute signed radix-16 digits for each scalar + digits := make([][64]int8, len(scalars)) + for i := range digits { + digits[i] = scalars[i].signedRadix16() + } + + // Unwrap first loop iteration to save computing 16*identity + multiple := &projCached{} + tmp1 := &projP1xP1{} + tmp2 := &projP2{} + // Lookup-and-add the appropriate multiple of each input point + for j := range tables { + tables[j].SelectInto(multiple, digits[j][63]) + tmp1.Add(v, multiple) // tmp1 = v + x_(j,63)*Q in P1xP1 coords + v.fromP1xP1(tmp1) // update v + } + tmp2.FromP3(v) // set up tmp2 = v in P2 coords for next iteration + for i := 62; i >= 0; i-- { + tmp1.Double(tmp2) // tmp1 = 2*(prev) in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 2*(prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 4*(prev) in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 4*(prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 8*(prev) in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 8*(prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 16*(prev) in P1xP1 coords + v.fromP1xP1(tmp1) // v = 16*(prev) in P3 coords + // Lookup-and-add the appropriate multiple of each input point + for j := range tables { + tables[j].SelectInto(multiple, digits[j][i]) + tmp1.Add(v, multiple) // tmp1 = v + x_(j,i)*Q in P1xP1 coords + v.fromP1xP1(tmp1) // update v + } + tmp2.FromP3(v) // set up tmp2 = v in P2 coords for next iteration + } + return v +} + +// VarTimeMultiScalarMult sets v = sum(scalars[i] * points[i]), and returns v. +// +// Execution time depends on the inputs. +func (v *Point) VarTimeMultiScalarMult(scalars []*Scalar, points []*Point) *Point { + if len(scalars) != len(points) { + panic("edwards25519: called VarTimeMultiScalarMult with different size inputs") + } + checkInitialized(points...) + + // Generalize double-base NAF computation to arbitrary sizes. + // Here all the points are dynamic, so we only use the smaller + // tables. + + // Build lookup tables for each point + tables := make([]nafLookupTable5, len(points)) + for i := range tables { + tables[i].FromP3(points[i]) + } + // Compute a NAF for each scalar + nafs := make([][256]int8, len(scalars)) + for i := range nafs { + nafs[i] = scalars[i].nonAdjacentForm(5) + } + + multiple := &projCached{} + tmp1 := &projP1xP1{} + tmp2 := &projP2{} + tmp2.Zero() + + // Move from high to low bits, doubling the accumulator + // at each iteration and checking whether there is a nonzero + // coefficient to look up a multiple of. + // + // Skip trying to find the first nonzero coefficent, because + // searching might be more work than a few extra doublings. + for i := 255; i >= 0; i-- { + tmp1.Double(tmp2) + + for j := range nafs { + if nafs[j][i] > 0 { + v.fromP1xP1(tmp1) + tables[j].SelectInto(multiple, nafs[j][i]) + tmp1.Add(v, multiple) + } else if nafs[j][i] < 0 { + v.fromP1xP1(tmp1) + tables[j].SelectInto(multiple, -nafs[j][i]) + tmp1.Sub(v, multiple) + } + } + + tmp2.FromP1xP1(tmp1) + } + + v.fromP2(tmp2) + return v +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra_test.go new file mode 100644 index 0000000..6fb832a --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/extra_test.go @@ -0,0 +1,220 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "crypto/rand" + "encoding/hex" + "testing" + "testing/quick" +) + +// TestBytesMontgomery tests the SetBytesWithClamping+BytesMontgomery path +// equivalence to curve25519.X25519 for basepoint scalar multiplications. +// +// Note that you can't actually implement X25519 with this package because +// there is no SetBytesMontgomery, and it would not be possible to implement +// it properly: points on the twist would get rejected, and the Scalar returned +// by SetBytesWithClamping does not preserve its cofactor-clearing properties. +// +// Disabled to avoid the golang.org/x/crypto module dependency. +/* func TestBytesMontgomery(t *testing.T) { + f := func(scalar [32]byte) bool { + s := NewScalar().SetBytesWithClamping(scalar[:]) + p := (&Point{}).ScalarBaseMult(s) + got := p.BytesMontgomery() + want, _ := curve25519.X25519(scalar[:], curve25519.Basepoint) + return bytes.Equal(got, want) + } + if err := quick.Check(f, nil); err != nil { + t.Error(err) + } +} */ + +func TestBytesMontgomerySodium(t *testing.T) { + // Generated with libsodium.js 1.0.18 + // crypto_sign_keypair().publicKey + publicKey := "3bf918ffc2c955dc895bf145f566fb96623c1cadbe040091175764b5fde322c0" + p, err := (&Point{}).SetBytes(decodeHex(publicKey)) + if err != nil { + t.Fatal(err) + } + // crypto_sign_ed25519_pk_to_curve25519(publicKey) + want := "efc6c9d0738e9ea18d738ad4a2653631558931b0f1fde4dd58c436d19686dc28" + if got := hex.EncodeToString(p.BytesMontgomery()); got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +func TestBytesMontgomeryInfinity(t *testing.T) { + p := NewIdentityPoint() + want := "0000000000000000000000000000000000000000000000000000000000000000" + if got := hex.EncodeToString(p.BytesMontgomery()); got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +func TestMultByCofactor(t *testing.T) { + lowOrderBytes := "26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85" + lowOrder, err := (&Point{}).SetBytes(decodeHex(lowOrderBytes)) + if err != nil { + t.Fatal(err) + } + + if p := (&Point{}).MultByCofactor(lowOrder); p.Equal(NewIdentityPoint()) != 1 { + t.Errorf("expected low order point * cofactor to be the identity") + } + + f := func(scalar [64]byte) bool { + s, _ := NewScalar().SetUniformBytes(scalar[:]) + p := (&Point{}).ScalarBaseMult(s) + p8 := (&Point{}).MultByCofactor(p) + checkOnCurve(t, p8) + + // 8 * p == (8 * s) * B + reprEight := [32]byte{8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + scEight, _ := (&Scalar{}).SetCanonicalBytes(reprEight[:]) + s.Multiply(s, scEight) + pp := (&Point{}).ScalarBaseMult(s) + if p8.Equal(pp) != 1 { + return false + } + + // 8 * p == 8 * (lowOrder + p) + pp.Add(p, lowOrder) + pp.MultByCofactor(pp) + if p8.Equal(pp) != 1 { + return false + } + + // 8 * p == p + p + p + p + p + p + p + p + pp.Set(NewIdentityPoint()) + for i := 0; i < 8; i++ { + pp.Add(pp, p) + } + return p8.Equal(pp) == 1 + } + if err := quick.Check(f, nil); err != nil { + t.Error(err) + } +} + +func TestScalarInvert(t *testing.T) { + invertWorks := func(xInv Scalar, x notZeroScalar) bool { + xInv.Invert((*Scalar)(&x)) + var check Scalar + check.Multiply((*Scalar)(&x), &xInv) + + return check.Equal(scOne) == 1 && isReduced(xInv.Bytes()) + } + + if err := quick.Check(invertWorks, quickCheckConfig(32)); err != nil { + t.Error(err) + } + + randomScalar := *dalekScalar + randomInverse := NewScalar().Invert(&randomScalar) + var check Scalar + check.Multiply(&randomScalar, randomInverse) + + if check.Equal(scOne) == 0 || !isReduced(randomInverse.Bytes()) { + t.Error("inversion did not work") + } + + zero := NewScalar() + if xx := NewScalar().Invert(zero); xx.Equal(zero) != 1 { + t.Errorf("inverting zero did not return zero") + } +} + +func TestMultiScalarMultMatchesBaseMult(t *testing.T) { + multiScalarMultMatchesBaseMult := func(x, y, z Scalar) bool { + var p, q1, q2, q3, check Point + + p.MultiScalarMult([]*Scalar{&x, &y, &z}, []*Point{B, B, B}) + + q1.ScalarBaseMult(&x) + q2.ScalarBaseMult(&y) + q3.ScalarBaseMult(&z) + check.Add(&q1, &q2).Add(&check, &q3) + + checkOnCurve(t, &p, &check, &q1, &q2, &q3) + return p.Equal(&check) == 1 + } + + if err := quick.Check(multiScalarMultMatchesBaseMult, quickCheckConfig(32)); err != nil { + t.Error(err) + } +} + +func TestVarTimeMultiScalarMultMatchesBaseMult(t *testing.T) { + varTimeMultiScalarMultMatchesBaseMult := func(x, y, z Scalar) bool { + var p, q1, q2, q3, check Point + + p.VarTimeMultiScalarMult([]*Scalar{&x, &y, &z}, []*Point{B, B, B}) + + q1.ScalarBaseMult(&x) + q2.ScalarBaseMult(&y) + q3.ScalarBaseMult(&z) + check.Add(&q1, &q2).Add(&check, &q3) + + checkOnCurve(t, &p, &check, &q1, &q2, &q3) + return p.Equal(&check) == 1 + } + + if err := quick.Check(varTimeMultiScalarMultMatchesBaseMult, quickCheckConfig(32)); err != nil { + t.Error(err) + } +} + +func BenchmarkMultiScalarMultSize8(t *testing.B) { + var p Point + x := dalekScalar + + for i := 0; i < t.N; i++ { + p.MultiScalarMult([]*Scalar{x, x, x, x, x, x, x, x}, + []*Point{B, B, B, B, B, B, B, B}) + } +} + +func BenchmarkScalarAddition(b *testing.B) { + var rnd [128]byte + rand.Read(rnd[:]) + s1, _ := (&Scalar{}).SetUniformBytes(rnd[0:64]) + s2, _ := (&Scalar{}).SetUniformBytes(rnd[64:128]) + t := &Scalar{} + + b.ResetTimer() + + for i := 0; i < b.N; i++ { + t.Add(s1, s2) + } +} + +func BenchmarkScalarMultiplication(b *testing.B) { + var rnd [128]byte + rand.Read(rnd[:]) + s1, _ := (&Scalar{}).SetUniformBytes(rnd[0:64]) + s2, _ := (&Scalar{}).SetUniformBytes(rnd[64:128]) + t := &Scalar{} + + b.ResetTimer() + + for i := 0; i < b.N; i++ { + t.Multiply(s1, s2) + } +} + +func BenchmarkScalarInversion(b *testing.B) { + var rnd [64]byte + rand.Read(rnd[:]) + s1, _ := (&Scalar{}).SetUniformBytes(rnd[0:64]) + + b.ResetTimer() + + for i := 0; i < b.N; i++ { + s1.Invert(s1) + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe.go new file mode 100644 index 0000000..5518ef2 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe.go @@ -0,0 +1,420 @@ +// Copyright (c) 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package field implements fast arithmetic modulo 2^255-19. +package field + +import ( + "crypto/subtle" + "encoding/binary" + "errors" + "math/bits" +) + +// Element represents an element of the field GF(2^255-19). Note that this +// is not a cryptographically secure group, and should only be used to interact +// with edwards25519.Point coordinates. +// +// This type works similarly to math/big.Int, and all arguments and receivers +// are allowed to alias. +// +// The zero value is a valid zero element. +type Element struct { + // An element t represents the integer + // t.l0 + t.l1*2^51 + t.l2*2^102 + t.l3*2^153 + t.l4*2^204 + // + // Between operations, all limbs are expected to be lower than 2^52. + l0 uint64 + l1 uint64 + l2 uint64 + l3 uint64 + l4 uint64 +} + +const maskLow51Bits uint64 = (1 << 51) - 1 + +var feZero = &Element{0, 0, 0, 0, 0} + +// Zero sets v = 0, and returns v. +func (v *Element) Zero() *Element { + *v = *feZero + return v +} + +var feOne = &Element{1, 0, 0, 0, 0} + +// One sets v = 1, and returns v. +func (v *Element) One() *Element { + *v = *feOne + return v +} + +// reduce reduces v modulo 2^255 - 19 and returns it. +func (v *Element) reduce() *Element { + v.carryPropagate() + + // After the light reduction we now have a field element representation + // v < 2^255 + 2^13 * 19, but need v < 2^255 - 19. + + // If v >= 2^255 - 19, then v + 19 >= 2^255, which would overflow 2^255 - 1, + // generating a carry. That is, c will be 0 if v < 2^255 - 19, and 1 otherwise. + c := (v.l0 + 19) >> 51 + c = (v.l1 + c) >> 51 + c = (v.l2 + c) >> 51 + c = (v.l3 + c) >> 51 + c = (v.l4 + c) >> 51 + + // If v < 2^255 - 19 and c = 0, this will be a no-op. Otherwise, it's + // effectively applying the reduction identity to the carry. + v.l0 += 19 * c + + v.l1 += v.l0 >> 51 + v.l0 = v.l0 & maskLow51Bits + v.l2 += v.l1 >> 51 + v.l1 = v.l1 & maskLow51Bits + v.l3 += v.l2 >> 51 + v.l2 = v.l2 & maskLow51Bits + v.l4 += v.l3 >> 51 + v.l3 = v.l3 & maskLow51Bits + // no additional carry + v.l4 = v.l4 & maskLow51Bits + + return v +} + +// Add sets v = a + b, and returns v. +func (v *Element) Add(a, b *Element) *Element { + v.l0 = a.l0 + b.l0 + v.l1 = a.l1 + b.l1 + v.l2 = a.l2 + b.l2 + v.l3 = a.l3 + b.l3 + v.l4 = a.l4 + b.l4 + // Using the generic implementation here is actually faster than the + // assembly. Probably because the body of this function is so simple that + // the compiler can figure out better optimizations by inlining the carry + // propagation. + return v.carryPropagateGeneric() +} + +// Subtract sets v = a - b, and returns v. +func (v *Element) Subtract(a, b *Element) *Element { + // We first add 2 * p, to guarantee the subtraction won't underflow, and + // then subtract b (which can be up to 2^255 + 2^13 * 19). + v.l0 = (a.l0 + 0xFFFFFFFFFFFDA) - b.l0 + v.l1 = (a.l1 + 0xFFFFFFFFFFFFE) - b.l1 + v.l2 = (a.l2 + 0xFFFFFFFFFFFFE) - b.l2 + v.l3 = (a.l3 + 0xFFFFFFFFFFFFE) - b.l3 + v.l4 = (a.l4 + 0xFFFFFFFFFFFFE) - b.l4 + return v.carryPropagate() +} + +// Negate sets v = -a, and returns v. +func (v *Element) Negate(a *Element) *Element { + return v.Subtract(feZero, a) +} + +// Invert sets v = 1/z mod p, and returns v. +// +// If z == 0, Invert returns v = 0. +func (v *Element) Invert(z *Element) *Element { + // Inversion is implemented as exponentiation with exponent p − 2. It uses the + // same sequence of 255 squarings and 11 multiplications as [Curve25519]. + var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t Element + + z2.Square(z) // 2 + t.Square(&z2) // 4 + t.Square(&t) // 8 + z9.Multiply(&t, z) // 9 + z11.Multiply(&z9, &z2) // 11 + t.Square(&z11) // 22 + z2_5_0.Multiply(&t, &z9) // 31 = 2^5 - 2^0 + + t.Square(&z2_5_0) // 2^6 - 2^1 + for i := 0; i < 4; i++ { + t.Square(&t) // 2^10 - 2^5 + } + z2_10_0.Multiply(&t, &z2_5_0) // 2^10 - 2^0 + + t.Square(&z2_10_0) // 2^11 - 2^1 + for i := 0; i < 9; i++ { + t.Square(&t) // 2^20 - 2^10 + } + z2_20_0.Multiply(&t, &z2_10_0) // 2^20 - 2^0 + + t.Square(&z2_20_0) // 2^21 - 2^1 + for i := 0; i < 19; i++ { + t.Square(&t) // 2^40 - 2^20 + } + t.Multiply(&t, &z2_20_0) // 2^40 - 2^0 + + t.Square(&t) // 2^41 - 2^1 + for i := 0; i < 9; i++ { + t.Square(&t) // 2^50 - 2^10 + } + z2_50_0.Multiply(&t, &z2_10_0) // 2^50 - 2^0 + + t.Square(&z2_50_0) // 2^51 - 2^1 + for i := 0; i < 49; i++ { + t.Square(&t) // 2^100 - 2^50 + } + z2_100_0.Multiply(&t, &z2_50_0) // 2^100 - 2^0 + + t.Square(&z2_100_0) // 2^101 - 2^1 + for i := 0; i < 99; i++ { + t.Square(&t) // 2^200 - 2^100 + } + t.Multiply(&t, &z2_100_0) // 2^200 - 2^0 + + t.Square(&t) // 2^201 - 2^1 + for i := 0; i < 49; i++ { + t.Square(&t) // 2^250 - 2^50 + } + t.Multiply(&t, &z2_50_0) // 2^250 - 2^0 + + t.Square(&t) // 2^251 - 2^1 + t.Square(&t) // 2^252 - 2^2 + t.Square(&t) // 2^253 - 2^3 + t.Square(&t) // 2^254 - 2^4 + t.Square(&t) // 2^255 - 2^5 + + return v.Multiply(&t, &z11) // 2^255 - 21 +} + +// Set sets v = a, and returns v. +func (v *Element) Set(a *Element) *Element { + *v = *a + return v +} + +// SetBytes sets v to x, where x is a 32-byte little-endian encoding. If x is +// not of the right length, SetBytes returns nil and an error, and the +// receiver is unchanged. +// +// Consistent with RFC 7748, the most significant bit (the high bit of the +// last byte) is ignored, and non-canonical values (2^255-19 through 2^255-1) +// are accepted. Note that this is laxer than specified by RFC 8032, but +// consistent with most Ed25519 implementations. +func (v *Element) SetBytes(x []byte) (*Element, error) { + if len(x) != 32 { + return nil, errors.New("edwards25519: invalid field element input size") + } + + // Bits 0:51 (bytes 0:8, bits 0:64, shift 0, mask 51). + v.l0 = binary.LittleEndian.Uint64(x[0:8]) + v.l0 &= maskLow51Bits + // Bits 51:102 (bytes 6:14, bits 48:112, shift 3, mask 51). + v.l1 = binary.LittleEndian.Uint64(x[6:14]) >> 3 + v.l1 &= maskLow51Bits + // Bits 102:153 (bytes 12:20, bits 96:160, shift 6, mask 51). + v.l2 = binary.LittleEndian.Uint64(x[12:20]) >> 6 + v.l2 &= maskLow51Bits + // Bits 153:204 (bytes 19:27, bits 152:216, shift 1, mask 51). + v.l3 = binary.LittleEndian.Uint64(x[19:27]) >> 1 + v.l3 &= maskLow51Bits + // Bits 204:255 (bytes 24:32, bits 192:256, shift 12, mask 51). + // Note: not bytes 25:33, shift 4, to avoid overread. + v.l4 = binary.LittleEndian.Uint64(x[24:32]) >> 12 + v.l4 &= maskLow51Bits + + return v, nil +} + +// Bytes returns the canonical 32-byte little-endian encoding of v. +func (v *Element) Bytes() []byte { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var out [32]byte + return v.bytes(&out) +} + +func (v *Element) bytes(out *[32]byte) []byte { + t := *v + t.reduce() + + var buf [8]byte + for i, l := range [5]uint64{t.l0, t.l1, t.l2, t.l3, t.l4} { + bitsOffset := i * 51 + binary.LittleEndian.PutUint64(buf[:], l<= len(out) { + break + } + out[off] |= bb + } + } + + return out[:] +} + +// Equal returns 1 if v and u are equal, and 0 otherwise. +func (v *Element) Equal(u *Element) int { + sa, sv := u.Bytes(), v.Bytes() + return subtle.ConstantTimeCompare(sa, sv) +} + +// mask64Bits returns 0xffffffff if cond is 1, and 0 otherwise. +func mask64Bits(cond int) uint64 { return ^(uint64(cond) - 1) } + +// Select sets v to a if cond == 1, and to b if cond == 0. +func (v *Element) Select(a, b *Element, cond int) *Element { + m := mask64Bits(cond) + v.l0 = (m & a.l0) | (^m & b.l0) + v.l1 = (m & a.l1) | (^m & b.l1) + v.l2 = (m & a.l2) | (^m & b.l2) + v.l3 = (m & a.l3) | (^m & b.l3) + v.l4 = (m & a.l4) | (^m & b.l4) + return v +} + +// Swap swaps v and u if cond == 1 or leaves them unchanged if cond == 0, and returns v. +func (v *Element) Swap(u *Element, cond int) { + m := mask64Bits(cond) + t := m & (v.l0 ^ u.l0) + v.l0 ^= t + u.l0 ^= t + t = m & (v.l1 ^ u.l1) + v.l1 ^= t + u.l1 ^= t + t = m & (v.l2 ^ u.l2) + v.l2 ^= t + u.l2 ^= t + t = m & (v.l3 ^ u.l3) + v.l3 ^= t + u.l3 ^= t + t = m & (v.l4 ^ u.l4) + v.l4 ^= t + u.l4 ^= t +} + +// IsNegative returns 1 if v is negative, and 0 otherwise. +func (v *Element) IsNegative() int { + return int(v.Bytes()[0] & 1) +} + +// Absolute sets v to |u|, and returns v. +func (v *Element) Absolute(u *Element) *Element { + return v.Select(new(Element).Negate(u), u, u.IsNegative()) +} + +// Multiply sets v = x * y, and returns v. +func (v *Element) Multiply(x, y *Element) *Element { + feMul(v, x, y) + return v +} + +// Square sets v = x * x, and returns v. +func (v *Element) Square(x *Element) *Element { + feSquare(v, x) + return v +} + +// Mult32 sets v = x * y, and returns v. +func (v *Element) Mult32(x *Element, y uint32) *Element { + x0lo, x0hi := mul51(x.l0, y) + x1lo, x1hi := mul51(x.l1, y) + x2lo, x2hi := mul51(x.l2, y) + x3lo, x3hi := mul51(x.l3, y) + x4lo, x4hi := mul51(x.l4, y) + v.l0 = x0lo + 19*x4hi // carried over per the reduction identity + v.l1 = x1lo + x0hi + v.l2 = x2lo + x1hi + v.l3 = x3lo + x2hi + v.l4 = x4lo + x3hi + // The hi portions are going to be only 32 bits, plus any previous excess, + // so we can skip the carry propagation. + return v +} + +// mul51 returns lo + hi * 2⁵¹ = a * b. +func mul51(a uint64, b uint32) (lo uint64, hi uint64) { + mh, ml := bits.Mul64(a, uint64(b)) + lo = ml & maskLow51Bits + hi = (mh << 13) | (ml >> 51) + return +} + +// Pow22523 set v = x^((p-5)/8), and returns v. (p-5)/8 is 2^252-3. +func (v *Element) Pow22523(x *Element) *Element { + var t0, t1, t2 Element + + t0.Square(x) // x^2 + t1.Square(&t0) // x^4 + t1.Square(&t1) // x^8 + t1.Multiply(x, &t1) // x^9 + t0.Multiply(&t0, &t1) // x^11 + t0.Square(&t0) // x^22 + t0.Multiply(&t1, &t0) // x^31 + t1.Square(&t0) // x^62 + for i := 1; i < 5; i++ { // x^992 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // x^1023 -> 1023 = 2^10 - 1 + t1.Square(&t0) // 2^11 - 2 + for i := 1; i < 10; i++ { // 2^20 - 2^10 + t1.Square(&t1) + } + t1.Multiply(&t1, &t0) // 2^20 - 1 + t2.Square(&t1) // 2^21 - 2 + for i := 1; i < 20; i++ { // 2^40 - 2^20 + t2.Square(&t2) + } + t1.Multiply(&t2, &t1) // 2^40 - 1 + t1.Square(&t1) // 2^41 - 2 + for i := 1; i < 10; i++ { // 2^50 - 2^10 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // 2^50 - 1 + t1.Square(&t0) // 2^51 - 2 + for i := 1; i < 50; i++ { // 2^100 - 2^50 + t1.Square(&t1) + } + t1.Multiply(&t1, &t0) // 2^100 - 1 + t2.Square(&t1) // 2^101 - 2 + for i := 1; i < 100; i++ { // 2^200 - 2^100 + t2.Square(&t2) + } + t1.Multiply(&t2, &t1) // 2^200 - 1 + t1.Square(&t1) // 2^201 - 2 + for i := 1; i < 50; i++ { // 2^250 - 2^50 + t1.Square(&t1) + } + t0.Multiply(&t1, &t0) // 2^250 - 1 + t0.Square(&t0) // 2^251 - 2 + t0.Square(&t0) // 2^252 - 4 + return v.Multiply(&t0, x) // 2^252 - 3 -> x^(2^252-3) +} + +// sqrtM1 is 2^((p-1)/4), which squared is equal to -1 by Euler's Criterion. +var sqrtM1 = &Element{1718705420411056, 234908883556509, + 2233514472574048, 2117202627021982, 765476049583133} + +// SqrtRatio sets r to the non-negative square root of the ratio of u and v. +// +// If u/v is square, SqrtRatio returns r and 1. If u/v is not square, SqrtRatio +// sets r according to Section 4.3 of draft-irtf-cfrg-ristretto255-decaf448-00, +// and returns r and 0. +func (r *Element) SqrtRatio(u, v *Element) (R *Element, wasSquare int) { + t0 := new(Element) + + // r = (u * v3) * (u * v7)^((p-5)/8) + v2 := new(Element).Square(v) + uv3 := new(Element).Multiply(u, t0.Multiply(v2, v)) + uv7 := new(Element).Multiply(uv3, t0.Square(v2)) + rr := new(Element).Multiply(uv3, t0.Pow22523(uv7)) + + check := new(Element).Multiply(v, t0.Square(rr)) // check = v * r^2 + + uNeg := new(Element).Negate(u) + correctSignSqrt := check.Equal(u) + flippedSignSqrt := check.Equal(uNeg) + flippedSignSqrtI := check.Equal(t0.Multiply(uNeg, sqrtM1)) + + rPrime := new(Element).Multiply(rr, sqrtM1) // r_prime = SQRT_M1 * r + // r = CT_SELECT(r_prime IF flipped_sign_sqrt | flipped_sign_sqrt_i ELSE r) + rr.Select(rPrime, rr, flippedSignSqrt|flippedSignSqrtI) + + r.Absolute(rr) // Choose the nonnegative square root. + return r, correctSignSqrt | flippedSignSqrt +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_alias_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_alias_test.go new file mode 100644 index 0000000..0c81239 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_alias_test.go @@ -0,0 +1,140 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import ( + "testing" + "testing/quick" +) + +func checkAliasingOneArg(f func(v, x *Element) *Element) func(v, x Element) bool { + return func(v, x Element) bool { + x1, v1 := x, x + + // Calculate a reference f(x) without aliasing. + if out := f(&v, &x); out != &v && isInBounds(out) { + return false + } + + // Test aliasing the argument and the receiver. + if out := f(&v1, &v1); out != &v1 || v1 != v { + return false + } + + // Ensure the arguments was not modified. + return x == x1 + } +} + +func checkAliasingTwoArgs(f func(v, x, y *Element) *Element) func(v, x, y Element) bool { + return func(v, x, y Element) bool { + x1, y1, v1 := x, y, Element{} + + // Calculate a reference f(x, y) without aliasing. + if out := f(&v, &x, &y); out != &v && isInBounds(out) { + return false + } + + // Test aliasing the first argument and the receiver. + v1 = x + if out := f(&v1, &v1, &y); out != &v1 || v1 != v { + return false + } + // Test aliasing the second argument and the receiver. + v1 = y + if out := f(&v1, &x, &v1); out != &v1 || v1 != v { + return false + } + + // Calculate a reference f(x, x) without aliasing. + if out := f(&v, &x, &x); out != &v { + return false + } + + // Test aliasing the first argument and the receiver. + v1 = x + if out := f(&v1, &v1, &x); out != &v1 || v1 != v { + return false + } + // Test aliasing the second argument and the receiver. + v1 = x + if out := f(&v1, &x, &v1); out != &v1 || v1 != v { + return false + } + // Test aliasing both arguments and the receiver. + v1 = x + if out := f(&v1, &v1, &v1); out != &v1 || v1 != v { + return false + } + + // Ensure the arguments were not modified. + return x == x1 && y == y1 + } +} + +// TestAliasing checks that receivers and arguments can alias each other without +// leading to incorrect results. That is, it ensures that it's safe to write +// +// v.Invert(v) +// +// or +// +// v.Add(v, v) +// +// without any of the inputs getting clobbered by the output being written. +func TestAliasing(t *testing.T) { + type target struct { + name string + oneArgF func(v, x *Element) *Element + twoArgsF func(v, x, y *Element) *Element + } + for _, tt := range []target{ + {name: "Absolute", oneArgF: (*Element).Absolute}, + {name: "Invert", oneArgF: (*Element).Invert}, + {name: "Negate", oneArgF: (*Element).Negate}, + {name: "Set", oneArgF: (*Element).Set}, + {name: "Square", oneArgF: (*Element).Square}, + {name: "Pow22523", oneArgF: (*Element).Pow22523}, + { + name: "Mult32", + oneArgF: func(v, x *Element) *Element { + return v.Mult32(x, 0xffffffff) + }, + }, + {name: "Multiply", twoArgsF: (*Element).Multiply}, + {name: "Add", twoArgsF: (*Element).Add}, + {name: "Subtract", twoArgsF: (*Element).Subtract}, + { + name: "SqrtRatio", + twoArgsF: func(v, x, y *Element) *Element { + r, _ := v.SqrtRatio(x, y) + return r + }, + }, + { + name: "Select0", + twoArgsF: func(v, x, y *Element) *Element { + return v.Select(x, y, 0) + }, + }, + { + name: "Select1", + twoArgsF: func(v, x, y *Element) *Element { + return v.Select(x, y, 1) + }, + }, + } { + var err error + switch { + case tt.oneArgF != nil: + err = quick.Check(checkAliasingOneArg(tt.oneArgF), quickCheckConfig(256)) + case tt.twoArgsF != nil: + err = quick.Check(checkAliasingTwoArgs(tt.twoArgsF), quickCheckConfig(256)) + } + if err != nil { + t.Errorf("%v: %v", tt.name, err) + } + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.go new file mode 100644 index 0000000..edcf163 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.go @@ -0,0 +1,16 @@ +// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. + +//go:build amd64 && gc && !purego +// +build amd64,gc,!purego + +package field + +// feMul sets out = a * b. It works like feMulGeneric. +// +//go:noescape +func feMul(out *Element, a *Element, b *Element) + +// feSquare sets out = a * a. It works like feSquareGeneric. +// +//go:noescape +func feSquare(out *Element, a *Element) diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.s b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.s new file mode 100644 index 0000000..293f013 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64.s @@ -0,0 +1,379 @@ +// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. + +//go:build amd64 && gc && !purego +// +build amd64,gc,!purego + +#include "textflag.h" + +// func feMul(out *Element, a *Element, b *Element) +TEXT ·feMul(SB), NOSPLIT, $0-24 + MOVQ a+8(FP), CX + MOVQ b+16(FP), BX + + // r0 = a0×b0 + MOVQ (CX), AX + MULQ (BX) + MOVQ AX, DI + MOVQ DX, SI + + // r0 += 19×a1×b4 + MOVQ 8(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a2×b3 + MOVQ 16(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a3×b2 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 16(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r0 += 19×a4×b1 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 8(BX) + ADDQ AX, DI + ADCQ DX, SI + + // r1 = a0×b1 + MOVQ (CX), AX + MULQ 8(BX) + MOVQ AX, R9 + MOVQ DX, R8 + + // r1 += a1×b0 + MOVQ 8(CX), AX + MULQ (BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a2×b4 + MOVQ 16(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a3×b3 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r1 += 19×a4×b2 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 16(BX) + ADDQ AX, R9 + ADCQ DX, R8 + + // r2 = a0×b2 + MOVQ (CX), AX + MULQ 16(BX) + MOVQ AX, R11 + MOVQ DX, R10 + + // r2 += a1×b1 + MOVQ 8(CX), AX + MULQ 8(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += a2×b0 + MOVQ 16(CX), AX + MULQ (BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += 19×a3×b4 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r2 += 19×a4×b3 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(BX) + ADDQ AX, R11 + ADCQ DX, R10 + + // r3 = a0×b3 + MOVQ (CX), AX + MULQ 24(BX) + MOVQ AX, R13 + MOVQ DX, R12 + + // r3 += a1×b2 + MOVQ 8(CX), AX + MULQ 16(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += a2×b1 + MOVQ 16(CX), AX + MULQ 8(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += a3×b0 + MOVQ 24(CX), AX + MULQ (BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r3 += 19×a4×b4 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(BX) + ADDQ AX, R13 + ADCQ DX, R12 + + // r4 = a0×b4 + MOVQ (CX), AX + MULQ 32(BX) + MOVQ AX, R15 + MOVQ DX, R14 + + // r4 += a1×b3 + MOVQ 8(CX), AX + MULQ 24(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a2×b2 + MOVQ 16(CX), AX + MULQ 16(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a3×b1 + MOVQ 24(CX), AX + MULQ 8(BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // r4 += a4×b0 + MOVQ 32(CX), AX + MULQ (BX) + ADDQ AX, R15 + ADCQ DX, R14 + + // First reduction chain + MOVQ $0x0007ffffffffffff, AX + SHLQ $0x0d, DI, SI + SHLQ $0x0d, R9, R8 + SHLQ $0x0d, R11, R10 + SHLQ $0x0d, R13, R12 + SHLQ $0x0d, R15, R14 + ANDQ AX, DI + IMUL3Q $0x13, R14, R14 + ADDQ R14, DI + ANDQ AX, R9 + ADDQ SI, R9 + ANDQ AX, R11 + ADDQ R8, R11 + ANDQ AX, R13 + ADDQ R10, R13 + ANDQ AX, R15 + ADDQ R12, R15 + + // Second reduction chain (carryPropagate) + MOVQ DI, SI + SHRQ $0x33, SI + MOVQ R9, R8 + SHRQ $0x33, R8 + MOVQ R11, R10 + SHRQ $0x33, R10 + MOVQ R13, R12 + SHRQ $0x33, R12 + MOVQ R15, R14 + SHRQ $0x33, R14 + ANDQ AX, DI + IMUL3Q $0x13, R14, R14 + ADDQ R14, DI + ANDQ AX, R9 + ADDQ SI, R9 + ANDQ AX, R11 + ADDQ R8, R11 + ANDQ AX, R13 + ADDQ R10, R13 + ANDQ AX, R15 + ADDQ R12, R15 + + // Store output + MOVQ out+0(FP), AX + MOVQ DI, (AX) + MOVQ R9, 8(AX) + MOVQ R11, 16(AX) + MOVQ R13, 24(AX) + MOVQ R15, 32(AX) + RET + +// func feSquare(out *Element, a *Element) +TEXT ·feSquare(SB), NOSPLIT, $0-16 + MOVQ a+8(FP), CX + + // r0 = l0×l0 + MOVQ (CX), AX + MULQ (CX) + MOVQ AX, SI + MOVQ DX, BX + + // r0 += 38×l1×l4 + MOVQ 8(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, SI + ADCQ DX, BX + + // r0 += 38×l2×l3 + MOVQ 16(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 24(CX) + ADDQ AX, SI + ADCQ DX, BX + + // r1 = 2×l0×l1 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 8(CX) + MOVQ AX, R8 + MOVQ DX, DI + + // r1 += 38×l2×l4 + MOVQ 16(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, R8 + ADCQ DX, DI + + // r1 += 19×l3×l3 + MOVQ 24(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 24(CX) + ADDQ AX, R8 + ADCQ DX, DI + + // r2 = 2×l0×l2 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 16(CX) + MOVQ AX, R10 + MOVQ DX, R9 + + // r2 += l1×l1 + MOVQ 8(CX), AX + MULQ 8(CX) + ADDQ AX, R10 + ADCQ DX, R9 + + // r2 += 38×l3×l4 + MOVQ 24(CX), AX + IMUL3Q $0x26, AX, AX + MULQ 32(CX) + ADDQ AX, R10 + ADCQ DX, R9 + + // r3 = 2×l0×l3 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 24(CX) + MOVQ AX, R12 + MOVQ DX, R11 + + // r3 += 2×l1×l2 + MOVQ 8(CX), AX + IMUL3Q $0x02, AX, AX + MULQ 16(CX) + ADDQ AX, R12 + ADCQ DX, R11 + + // r3 += 19×l4×l4 + MOVQ 32(CX), AX + IMUL3Q $0x13, AX, AX + MULQ 32(CX) + ADDQ AX, R12 + ADCQ DX, R11 + + // r4 = 2×l0×l4 + MOVQ (CX), AX + SHLQ $0x01, AX + MULQ 32(CX) + MOVQ AX, R14 + MOVQ DX, R13 + + // r4 += 2×l1×l3 + MOVQ 8(CX), AX + IMUL3Q $0x02, AX, AX + MULQ 24(CX) + ADDQ AX, R14 + ADCQ DX, R13 + + // r4 += l2×l2 + MOVQ 16(CX), AX + MULQ 16(CX) + ADDQ AX, R14 + ADCQ DX, R13 + + // First reduction chain + MOVQ $0x0007ffffffffffff, AX + SHLQ $0x0d, SI, BX + SHLQ $0x0d, R8, DI + SHLQ $0x0d, R10, R9 + SHLQ $0x0d, R12, R11 + SHLQ $0x0d, R14, R13 + ANDQ AX, SI + IMUL3Q $0x13, R13, R13 + ADDQ R13, SI + ANDQ AX, R8 + ADDQ BX, R8 + ANDQ AX, R10 + ADDQ DI, R10 + ANDQ AX, R12 + ADDQ R9, R12 + ANDQ AX, R14 + ADDQ R11, R14 + + // Second reduction chain (carryPropagate) + MOVQ SI, BX + SHRQ $0x33, BX + MOVQ R8, DI + SHRQ $0x33, DI + MOVQ R10, R9 + SHRQ $0x33, R9 + MOVQ R12, R11 + SHRQ $0x33, R11 + MOVQ R14, R13 + SHRQ $0x33, R13 + ANDQ AX, SI + IMUL3Q $0x13, R13, R13 + ADDQ R13, SI + ANDQ AX, R8 + ADDQ BX, R8 + ANDQ AX, R10 + ADDQ DI, R10 + ANDQ AX, R12 + ADDQ R9, R12 + ANDQ AX, R14 + ADDQ R11, R14 + + // Store output + MOVQ out+0(FP), AX + MOVQ SI, (AX) + MOVQ R8, 8(AX) + MOVQ R10, 16(AX) + MOVQ R12, 24(AX) + MOVQ R14, 32(AX) + RET diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64_noasm.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64_noasm.go new file mode 100644 index 0000000..ddb6c9b --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_amd64_noasm.go @@ -0,0 +1,12 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !amd64 || !gc || purego +// +build !amd64 !gc purego + +package field + +func feMul(v, x, y *Element) { feMulGeneric(v, x, y) } + +func feSquare(v, x *Element) { feSquareGeneric(v, x) } diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.go new file mode 100644 index 0000000..af459ef --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.go @@ -0,0 +1,16 @@ +// Copyright (c) 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build arm64 && gc && !purego +// +build arm64,gc,!purego + +package field + +//go:noescape +func carryPropagate(v *Element) + +func (v *Element) carryPropagate() *Element { + carryPropagate(v) + return v +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.s b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.s new file mode 100644 index 0000000..3126a43 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64.s @@ -0,0 +1,42 @@ +// Copyright (c) 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build arm64 && gc && !purego + +#include "textflag.h" + +// carryPropagate works exactly like carryPropagateGeneric and uses the +// same AND, ADD, and LSR+MADD instructions emitted by the compiler, but +// avoids loading R0-R4 twice and uses LDP and STP. +// +// See https://golang.org/issues/43145 for the main compiler issue. +// +// func carryPropagate(v *Element) +TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 + MOVD v+0(FP), R20 + + LDP 0(R20), (R0, R1) + LDP 16(R20), (R2, R3) + MOVD 32(R20), R4 + + AND $0x7ffffffffffff, R0, R10 + AND $0x7ffffffffffff, R1, R11 + AND $0x7ffffffffffff, R2, R12 + AND $0x7ffffffffffff, R3, R13 + AND $0x7ffffffffffff, R4, R14 + + ADD R0>>51, R11, R11 + ADD R1>>51, R12, R12 + ADD R2>>51, R13, R13 + ADD R3>>51, R14, R14 + // R4>>51 * 19 + R10 -> R10 + LSR $51, R4, R21 + MOVD $19, R22 + MADD R22, R10, R21, R10 + + STP (R10, R11), 0(R20) + STP (R12, R13), 16(R20) + MOVD R14, 32(R20) + + RET diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64_noasm.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64_noasm.go new file mode 100644 index 0000000..234a5b2 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_arm64_noasm.go @@ -0,0 +1,12 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !arm64 || !gc || purego +// +build !arm64 !gc purego + +package field + +func (v *Element) carryPropagate() *Element { + return v.carryPropagateGeneric() +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_bench_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_bench_test.go new file mode 100644 index 0000000..84fdf05 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_bench_test.go @@ -0,0 +1,49 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import "testing" + +func BenchmarkAdd(b *testing.B) { + x := new(Element).One() + y := new(Element).Add(x, x) + b.ResetTimer() + for i := 0; i < b.N; i++ { + x.Add(x, y) + } +} + +func BenchmarkMultiply(b *testing.B) { + x := new(Element).One() + y := new(Element).Add(x, x) + b.ResetTimer() + for i := 0; i < b.N; i++ { + x.Multiply(x, y) + } +} + +func BenchmarkSquare(b *testing.B) { + x := new(Element).Add(feOne, feOne) + b.ResetTimer() + for i := 0; i < b.N; i++ { + x.Square(x) + } +} + +func BenchmarkInvert(b *testing.B) { + x := new(Element).Add(feOne, feOne) + b.ResetTimer() + for i := 0; i < b.N; i++ { + x.Invert(x) + } +} + +func BenchmarkMult32(b *testing.B) { + x := new(Element).One() + b.ResetTimer() + for i := 0; i < b.N; i++ { + x.Mult32(x, 0xaa42aa42) + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra.go new file mode 100644 index 0000000..1ef503b --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra.go @@ -0,0 +1,50 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import "errors" + +// This file contains additional functionality that is not included in the +// upstream crypto/ed25519/edwards25519/field package. + +// SetWideBytes sets v to x, where x is a 64-byte little-endian encoding, which +// is reduced modulo the field order. If x is not of the right length, +// SetWideBytes returns nil and an error, and the receiver is unchanged. +// +// SetWideBytes is not necessary to select a uniformly distributed value, and is +// only provided for compatibility: SetBytes can be used instead as the chance +// of bias is less than 2⁻²⁵⁰. +func (v *Element) SetWideBytes(x []byte) (*Element, error) { + if len(x) != 64 { + return nil, errors.New("edwards25519: invalid SetWideBytes input size") + } + + // Split the 64 bytes into two elements, and extract the most significant + // bit of each, which is ignored by SetBytes. + lo, _ := new(Element).SetBytes(x[:32]) + loMSB := uint64(x[31] >> 7) + hi, _ := new(Element).SetBytes(x[32:]) + hiMSB := uint64(x[63] >> 7) + + // The output we want is + // + // v = lo + loMSB * 2²⁵⁵ + hi * 2²⁵⁶ + hiMSB * 2⁵¹¹ + // + // which applying the reduction identity comes out to + // + // v = lo + loMSB * 19 + hi * 2 * 19 + hiMSB * 2 * 19² + // + // l0 will be the sum of a 52 bits value (lo.l0), plus a 5 bits value + // (loMSB * 19), a 6 bits value (hi.l0 * 2 * 19), and a 10 bits value + // (hiMSB * 2 * 19²), so it fits in a uint64. + + v.l0 = lo.l0 + loMSB*19 + hi.l0*2*19 + hiMSB*2*19*19 + v.l1 = lo.l1 + hi.l1*2*19 + v.l2 = lo.l2 + hi.l2*2*19 + v.l3 = lo.l3 + hi.l3*2*19 + v.l4 = lo.l4 + hi.l4*2*19 + + return v.carryPropagate(), nil +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra_test.go new file mode 100644 index 0000000..7d8bea0 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_extra_test.go @@ -0,0 +1,37 @@ +// Copyright (c) 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import ( + "math/big" + "testing" + "testing/quick" +) + +var bigP = new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 255), big.NewInt(19)) + +func TestSetWideBytes(t *testing.T) { + f1 := func(in [64]byte, fe Element) bool { + fe1 := new(Element).Set(&fe) + + if out, err := fe.SetWideBytes([]byte{42}); err == nil || out != nil || + fe.Equal(fe1) != 1 { + return false + } + + if out, err := fe.SetWideBytes(in[:]); err != nil || out != &fe { + return false + } + + b := new(big.Int).SetBytes(swapEndianness(in[:])) + fe1.fromBig(b.Mod(b, bigP)) + + return fe.Equal(fe1) == 1 && isInBounds(&fe) && isInBounds(fe1) + } + if err := quick.Check(f1, nil); err != nil { + t.Error(err) + } + +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_generic.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_generic.go new file mode 100644 index 0000000..86f5fd9 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_generic.go @@ -0,0 +1,266 @@ +// Copyright (c) 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import "math/bits" + +// uint128 holds a 128-bit number as two 64-bit limbs, for use with the +// bits.Mul64 and bits.Add64 intrinsics. +type uint128 struct { + lo, hi uint64 +} + +// mul64 returns a * b. +func mul64(a, b uint64) uint128 { + hi, lo := bits.Mul64(a, b) + return uint128{lo, hi} +} + +// addMul64 returns v + a * b. +func addMul64(v uint128, a, b uint64) uint128 { + hi, lo := bits.Mul64(a, b) + lo, c := bits.Add64(lo, v.lo, 0) + hi, _ = bits.Add64(hi, v.hi, c) + return uint128{lo, hi} +} + +// shiftRightBy51 returns a >> 51. a is assumed to be at most 115 bits. +func shiftRightBy51(a uint128) uint64 { + return (a.hi << (64 - 51)) | (a.lo >> 51) +} + +func feMulGeneric(v, a, b *Element) { + a0 := a.l0 + a1 := a.l1 + a2 := a.l2 + a3 := a.l3 + a4 := a.l4 + + b0 := b.l0 + b1 := b.l1 + b2 := b.l2 + b3 := b.l3 + b4 := b.l4 + + // Limb multiplication works like pen-and-paper columnar multiplication, but + // with 51-bit limbs instead of digits. + // + // a4 a3 a2 a1 a0 x + // b4 b3 b2 b1 b0 = + // ------------------------ + // a4b0 a3b0 a2b0 a1b0 a0b0 + + // a4b1 a3b1 a2b1 a1b1 a0b1 + + // a4b2 a3b2 a2b2 a1b2 a0b2 + + // a4b3 a3b3 a2b3 a1b3 a0b3 + + // a4b4 a3b4 a2b4 a1b4 a0b4 = + // ---------------------------------------------- + // r8 r7 r6 r5 r4 r3 r2 r1 r0 + // + // We can then use the reduction identity (a * 2²⁵⁵ + b = a * 19 + b) to + // reduce the limbs that would overflow 255 bits. r5 * 2²⁵⁵ becomes 19 * r5, + // r6 * 2³⁰⁶ becomes 19 * r6 * 2⁵¹, etc. + // + // Reduction can be carried out simultaneously to multiplication. For + // example, we do not compute r5: whenever the result of a multiplication + // belongs to r5, like a1b4, we multiply it by 19 and add the result to r0. + // + // a4b0 a3b0 a2b0 a1b0 a0b0 + + // a3b1 a2b1 a1b1 a0b1 19×a4b1 + + // a2b2 a1b2 a0b2 19×a4b2 19×a3b2 + + // a1b3 a0b3 19×a4b3 19×a3b3 19×a2b3 + + // a0b4 19×a4b4 19×a3b4 19×a2b4 19×a1b4 = + // -------------------------------------- + // r4 r3 r2 r1 r0 + // + // Finally we add up the columns into wide, overlapping limbs. + + a1_19 := a1 * 19 + a2_19 := a2 * 19 + a3_19 := a3 * 19 + a4_19 := a4 * 19 + + // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) + r0 := mul64(a0, b0) + r0 = addMul64(r0, a1_19, b4) + r0 = addMul64(r0, a2_19, b3) + r0 = addMul64(r0, a3_19, b2) + r0 = addMul64(r0, a4_19, b1) + + // r1 = a0×b1 + a1×b0 + 19×(a2×b4 + a3×b3 + a4×b2) + r1 := mul64(a0, b1) + r1 = addMul64(r1, a1, b0) + r1 = addMul64(r1, a2_19, b4) + r1 = addMul64(r1, a3_19, b3) + r1 = addMul64(r1, a4_19, b2) + + // r2 = a0×b2 + a1×b1 + a2×b0 + 19×(a3×b4 + a4×b3) + r2 := mul64(a0, b2) + r2 = addMul64(r2, a1, b1) + r2 = addMul64(r2, a2, b0) + r2 = addMul64(r2, a3_19, b4) + r2 = addMul64(r2, a4_19, b3) + + // r3 = a0×b3 + a1×b2 + a2×b1 + a3×b0 + 19×a4×b4 + r3 := mul64(a0, b3) + r3 = addMul64(r3, a1, b2) + r3 = addMul64(r3, a2, b1) + r3 = addMul64(r3, a3, b0) + r3 = addMul64(r3, a4_19, b4) + + // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 + r4 := mul64(a0, b4) + r4 = addMul64(r4, a1, b3) + r4 = addMul64(r4, a2, b2) + r4 = addMul64(r4, a3, b1) + r4 = addMul64(r4, a4, b0) + + // After the multiplication, we need to reduce (carry) the five coefficients + // to obtain a result with limbs that are at most slightly larger than 2⁵¹, + // to respect the Element invariant. + // + // Overall, the reduction works the same as carryPropagate, except with + // wider inputs: we take the carry for each coefficient by shifting it right + // by 51, and add it to the limb above it. The top carry is multiplied by 19 + // according to the reduction identity and added to the lowest limb. + // + // The largest coefficient (r0) will be at most 111 bits, which guarantees + // that all carries are at most 111 - 51 = 60 bits, which fits in a uint64. + // + // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) + // r0 < 2⁵²×2⁵² + 19×(2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵²) + // r0 < (1 + 19 × 4) × 2⁵² × 2⁵² + // r0 < 2⁷ × 2⁵² × 2⁵² + // r0 < 2¹¹¹ + // + // Moreover, the top coefficient (r4) is at most 107 bits, so c4 is at most + // 56 bits, and c4 * 19 is at most 61 bits, which again fits in a uint64 and + // allows us to easily apply the reduction identity. + // + // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 + // r4 < 5 × 2⁵² × 2⁵² + // r4 < 2¹⁰⁷ + // + + c0 := shiftRightBy51(r0) + c1 := shiftRightBy51(r1) + c2 := shiftRightBy51(r2) + c3 := shiftRightBy51(r3) + c4 := shiftRightBy51(r4) + + rr0 := r0.lo&maskLow51Bits + c4*19 + rr1 := r1.lo&maskLow51Bits + c0 + rr2 := r2.lo&maskLow51Bits + c1 + rr3 := r3.lo&maskLow51Bits + c2 + rr4 := r4.lo&maskLow51Bits + c3 + + // Now all coefficients fit into 64-bit registers but are still too large to + // be passed around as an Element. We therefore do one last carry chain, + // where the carries will be small enough to fit in the wiggle room above 2⁵¹. + *v = Element{rr0, rr1, rr2, rr3, rr4} + v.carryPropagate() +} + +func feSquareGeneric(v, a *Element) { + l0 := a.l0 + l1 := a.l1 + l2 := a.l2 + l3 := a.l3 + l4 := a.l4 + + // Squaring works precisely like multiplication above, but thanks to its + // symmetry we get to group a few terms together. + // + // l4 l3 l2 l1 l0 x + // l4 l3 l2 l1 l0 = + // ------------------------ + // l4l0 l3l0 l2l0 l1l0 l0l0 + + // l4l1 l3l1 l2l1 l1l1 l0l1 + + // l4l2 l3l2 l2l2 l1l2 l0l2 + + // l4l3 l3l3 l2l3 l1l3 l0l3 + + // l4l4 l3l4 l2l4 l1l4 l0l4 = + // ---------------------------------------------- + // r8 r7 r6 r5 r4 r3 r2 r1 r0 + // + // l4l0 l3l0 l2l0 l1l0 l0l0 + + // l3l1 l2l1 l1l1 l0l1 19×l4l1 + + // l2l2 l1l2 l0l2 19×l4l2 19×l3l2 + + // l1l3 l0l3 19×l4l3 19×l3l3 19×l2l3 + + // l0l4 19×l4l4 19×l3l4 19×l2l4 19×l1l4 = + // -------------------------------------- + // r4 r3 r2 r1 r0 + // + // With precomputed 2×, 19×, and 2×19× terms, we can compute each limb with + // only three Mul64 and four Add64, instead of five and eight. + + l0_2 := l0 * 2 + l1_2 := l1 * 2 + + l1_38 := l1 * 38 + l2_38 := l2 * 38 + l3_38 := l3 * 38 + + l3_19 := l3 * 19 + l4_19 := l4 * 19 + + // r0 = l0×l0 + 19×(l1×l4 + l2×l3 + l3×l2 + l4×l1) = l0×l0 + 19×2×(l1×l4 + l2×l3) + r0 := mul64(l0, l0) + r0 = addMul64(r0, l1_38, l4) + r0 = addMul64(r0, l2_38, l3) + + // r1 = l0×l1 + l1×l0 + 19×(l2×l4 + l3×l3 + l4×l2) = 2×l0×l1 + 19×2×l2×l4 + 19×l3×l3 + r1 := mul64(l0_2, l1) + r1 = addMul64(r1, l2_38, l4) + r1 = addMul64(r1, l3_19, l3) + + // r2 = l0×l2 + l1×l1 + l2×l0 + 19×(l3×l4 + l4×l3) = 2×l0×l2 + l1×l1 + 19×2×l3×l4 + r2 := mul64(l0_2, l2) + r2 = addMul64(r2, l1, l1) + r2 = addMul64(r2, l3_38, l4) + + // r3 = l0×l3 + l1×l2 + l2×l1 + l3×l0 + 19×l4×l4 = 2×l0×l3 + 2×l1×l2 + 19×l4×l4 + r3 := mul64(l0_2, l3) + r3 = addMul64(r3, l1_2, l2) + r3 = addMul64(r3, l4_19, l4) + + // r4 = l0×l4 + l1×l3 + l2×l2 + l3×l1 + l4×l0 = 2×l0×l4 + 2×l1×l3 + l2×l2 + r4 := mul64(l0_2, l4) + r4 = addMul64(r4, l1_2, l3) + r4 = addMul64(r4, l2, l2) + + c0 := shiftRightBy51(r0) + c1 := shiftRightBy51(r1) + c2 := shiftRightBy51(r2) + c3 := shiftRightBy51(r3) + c4 := shiftRightBy51(r4) + + rr0 := r0.lo&maskLow51Bits + c4*19 + rr1 := r1.lo&maskLow51Bits + c0 + rr2 := r2.lo&maskLow51Bits + c1 + rr3 := r3.lo&maskLow51Bits + c2 + rr4 := r4.lo&maskLow51Bits + c3 + + *v = Element{rr0, rr1, rr2, rr3, rr4} + v.carryPropagate() +} + +// carryPropagateGeneric brings the limbs below 52 bits by applying the reduction +// identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry. +func (v *Element) carryPropagateGeneric() *Element { + c0 := v.l0 >> 51 + c1 := v.l1 >> 51 + c2 := v.l2 >> 51 + c3 := v.l3 >> 51 + c4 := v.l4 >> 51 + + // c4 is at most 64 - 51 = 13 bits, so c4*19 is at most 18 bits, and + // the final l0 will be at most 52 bits. Similarly for the rest. + v.l0 = v.l0&maskLow51Bits + c4*19 + v.l1 = v.l1&maskLow51Bits + c0 + v.l2 = v.l2&maskLow51Bits + c1 + v.l3 = v.l3&maskLow51Bits + c2 + v.l4 = v.l4&maskLow51Bits + c3 + + return v +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_test.go new file mode 100644 index 0000000..a24fbfe --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/field/fe_test.go @@ -0,0 +1,566 @@ +// Copyright (c) 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package field + +import ( + "bytes" + "crypto/rand" + "encoding/hex" + "io" + "math/big" + "math/bits" + mathrand "math/rand" + "reflect" + "testing" + "testing/quick" +) + +func (v Element) String() string { + return hex.EncodeToString(v.Bytes()) +} + +// quickCheckConfig returns a quick.Config that scales the max count by the +// given factor if the -short flag is not set. +func quickCheckConfig(slowScale int) *quick.Config { + cfg := new(quick.Config) + if !testing.Short() { + cfg.MaxCountScale = float64(slowScale) + } + return cfg +} + +func generateFieldElement(rand *mathrand.Rand) Element { + const maskLow52Bits = (1 << 52) - 1 + return Element{ + rand.Uint64() & maskLow52Bits, + rand.Uint64() & maskLow52Bits, + rand.Uint64() & maskLow52Bits, + rand.Uint64() & maskLow52Bits, + rand.Uint64() & maskLow52Bits, + } +} + +// weirdLimbs can be combined to generate a range of edge-case field elements. +// 0 and -1 are intentionally more weighted, as they combine well. +var ( + weirdLimbs51 = []uint64{ + 0, 0, 0, 0, + 1, + 19 - 1, + 19, + 0x2aaaaaaaaaaaa, + 0x5555555555555, + (1 << 51) - 20, + (1 << 51) - 19, + (1 << 51) - 1, (1 << 51) - 1, + (1 << 51) - 1, (1 << 51) - 1, + } + weirdLimbs52 = []uint64{ + 0, 0, 0, 0, 0, 0, + 1, + 19 - 1, + 19, + 0x2aaaaaaaaaaaa, + 0x5555555555555, + (1 << 51) - 20, + (1 << 51) - 19, + (1 << 51) - 1, (1 << 51) - 1, + (1 << 51) - 1, (1 << 51) - 1, + (1 << 51) - 1, (1 << 51) - 1, + 1 << 51, + (1 << 51) + 1, + (1 << 52) - 19, + (1 << 52) - 1, + } +) + +func generateWeirdFieldElement(rand *mathrand.Rand) Element { + return Element{ + weirdLimbs52[rand.Intn(len(weirdLimbs52))], + weirdLimbs51[rand.Intn(len(weirdLimbs51))], + weirdLimbs51[rand.Intn(len(weirdLimbs51))], + weirdLimbs51[rand.Intn(len(weirdLimbs51))], + weirdLimbs51[rand.Intn(len(weirdLimbs51))], + } +} + +func (Element) Generate(rand *mathrand.Rand, size int) reflect.Value { + if rand.Intn(2) == 0 { + return reflect.ValueOf(generateWeirdFieldElement(rand)) + } + return reflect.ValueOf(generateFieldElement(rand)) +} + +// isInBounds returns whether the element is within the expected bit size bounds +// after a light reduction. +func isInBounds(x *Element) bool { + return bits.Len64(x.l0) <= 52 && + bits.Len64(x.l1) <= 52 && + bits.Len64(x.l2) <= 52 && + bits.Len64(x.l3) <= 52 && + bits.Len64(x.l4) <= 52 +} + +func TestMultiplyDistributesOverAdd(t *testing.T) { + multiplyDistributesOverAdd := func(x, y, z Element) bool { + // Compute t1 = (x+y)*z + t1 := new(Element) + t1.Add(&x, &y) + t1.Multiply(t1, &z) + + // Compute t2 = x*z + y*z + t2 := new(Element) + t3 := new(Element) + t2.Multiply(&x, &z) + t3.Multiply(&y, &z) + t2.Add(t2, t3) + + return t1.Equal(t2) == 1 && isInBounds(t1) && isInBounds(t2) + } + + if err := quick.Check(multiplyDistributesOverAdd, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func TestMul64to128(t *testing.T) { + a := uint64(5) + b := uint64(5) + r := mul64(a, b) + if r.lo != 0x19 || r.hi != 0 { + t.Errorf("lo-range wide mult failed, got %d + %d*(2**64)", r.lo, r.hi) + } + + a = uint64(18014398509481983) // 2^54 - 1 + b = uint64(18014398509481983) // 2^54 - 1 + r = mul64(a, b) + if r.lo != 0xff80000000000001 || r.hi != 0xfffffffffff { + t.Errorf("hi-range wide mult failed, got %d + %d*(2**64)", r.lo, r.hi) + } + + a = uint64(1125899906842661) + b = uint64(2097155) + r = mul64(a, b) + r = addMul64(r, a, b) + r = addMul64(r, a, b) + r = addMul64(r, a, b) + r = addMul64(r, a, b) + if r.lo != 16888498990613035 || r.hi != 640 { + t.Errorf("wrong answer: %d + %d*(2**64)", r.lo, r.hi) + } +} + +func TestSetBytesRoundTrip(t *testing.T) { + f1 := func(in [32]byte, fe Element) bool { + fe.SetBytes(in[:]) + + // Mask the most significant bit as it's ignored by SetBytes. (Now + // instead of earlier so we check the masking in SetBytes is working.) + in[len(in)-1] &= (1 << 7) - 1 + + return bytes.Equal(in[:], fe.Bytes()) && isInBounds(&fe) + } + if err := quick.Check(f1, nil); err != nil { + t.Errorf("failed bytes->FE->bytes round-trip: %v", err) + } + + f2 := func(fe, r Element) bool { + r.SetBytes(fe.Bytes()) + + // Intentionally not using Equal not to go through Bytes again. + // Calling reduce because both Generate and SetBytes can produce + // non-canonical representations. + fe.reduce() + r.reduce() + return fe == r + } + if err := quick.Check(f2, nil); err != nil { + t.Errorf("failed FE->bytes->FE round-trip: %v", err) + } + + // Check some fixed vectors from dalek + type feRTTest struct { + fe Element + b []byte + } + var tests = []feRTTest{ + { + fe: Element{358744748052810, 1691584618240980, 977650209285361, 1429865912637724, 560044844278676}, + b: []byte{74, 209, 69, 197, 70, 70, 161, 222, 56, 226, 229, 19, 112, 60, 25, 92, 187, 74, 222, 56, 50, 153, 51, 233, 40, 74, 57, 6, 160, 185, 213, 31}, + }, + { + fe: Element{84926274344903, 473620666599931, 365590438845504, 1028470286882429, 2146499180330972}, + b: []byte{199, 23, 106, 112, 61, 77, 216, 79, 186, 60, 11, 118, 13, 16, 103, 15, 42, 32, 83, 250, 44, 57, 204, 198, 78, 199, 253, 119, 146, 172, 3, 122}, + }, + } + + for _, tt := range tests { + b := tt.fe.Bytes() + fe, _ := new(Element).SetBytes(tt.b) + if !bytes.Equal(b, tt.b) || fe.Equal(&tt.fe) != 1 { + t.Errorf("Failed fixed roundtrip: %v", tt) + } + } +} + +func swapEndianness(buf []byte) []byte { + for i := 0; i < len(buf)/2; i++ { + buf[i], buf[len(buf)-i-1] = buf[len(buf)-i-1], buf[i] + } + return buf +} + +func TestBytesBigEquivalence(t *testing.T) { + f1 := func(in [32]byte, fe, fe1 Element) bool { + fe.SetBytes(in[:]) + + in[len(in)-1] &= (1 << 7) - 1 // mask the most significant bit + b := new(big.Int).SetBytes(swapEndianness(in[:])) + fe1.fromBig(b) + + if fe != fe1 { + return false + } + + buf := make([]byte, 32) + buf = swapEndianness(fe1.toBig().FillBytes(buf)) + + return bytes.Equal(fe.Bytes(), buf) && isInBounds(&fe) && isInBounds(&fe1) + } + if err := quick.Check(f1, nil); err != nil { + t.Error(err) + } +} + +// fromBig sets v = n, and returns v. The bit length of n must not exceed 256. +func (v *Element) fromBig(n *big.Int) *Element { + if n.BitLen() > 32*8 { + panic("edwards25519: invalid field element input size") + } + + buf := make([]byte, 0, 32) + for _, word := range n.Bits() { + for i := 0; i < bits.UintSize; i += 8 { + if len(buf) >= cap(buf) { + break + } + buf = append(buf, byte(word)) + word >>= 8 + } + } + + v.SetBytes(buf[:32]) + return v +} + +func (v *Element) fromDecimal(s string) *Element { + n, ok := new(big.Int).SetString(s, 10) + if !ok { + panic("not a valid decimal: " + s) + } + return v.fromBig(n) +} + +// toBig returns v as a big.Int. +func (v *Element) toBig() *big.Int { + buf := v.Bytes() + + words := make([]big.Word, 32*8/bits.UintSize) + for n := range words { + for i := 0; i < bits.UintSize; i += 8 { + if len(buf) == 0 { + break + } + words[n] |= big.Word(buf[0]) << big.Word(i) + buf = buf[1:] + } + } + + return new(big.Int).SetBits(words) +} + +func TestDecimalConstants(t *testing.T) { + sqrtM1String := "19681161376707505956807079304988542015446066515923890162744021073123829784752" + if exp := new(Element).fromDecimal(sqrtM1String); sqrtM1.Equal(exp) != 1 { + t.Errorf("sqrtM1 is %v, expected %v", sqrtM1, exp) + } + // d is in the parent package, and we don't want to expose d or fromDecimal. + // dString := "37095705934669439343138083508754565189542113879843219016388785533085940283555" + // if exp := new(Element).fromDecimal(dString); d.Equal(exp) != 1 { + // t.Errorf("d is %v, expected %v", d, exp) + // } +} + +func TestSetBytesRoundTripEdgeCases(t *testing.T) { + // TODO: values close to 0, close to 2^255-19, between 2^255-19 and 2^255-1, + // and between 2^255 and 2^256-1. Test both the documented SetBytes + // behavior, and that Bytes reduces them. +} + +// Tests self-consistency between Multiply and Square. +func TestConsistency(t *testing.T) { + var x Element + var x2, x2sq Element + + x = Element{1, 1, 1, 1, 1} + x2.Multiply(&x, &x) + x2sq.Square(&x) + + if x2 != x2sq { + t.Fatalf("all ones failed\nmul: %x\nsqr: %x\n", x2, x2sq) + } + + var bytes [32]byte + + _, err := io.ReadFull(rand.Reader, bytes[:]) + if err != nil { + t.Fatal(err) + } + x.SetBytes(bytes[:]) + + x2.Multiply(&x, &x) + x2sq.Square(&x) + + if x2 != x2sq { + t.Fatalf("all ones failed\nmul: %x\nsqr: %x\n", x2, x2sq) + } +} + +func TestEqual(t *testing.T) { + x := Element{1, 1, 1, 1, 1} + y := Element{5, 4, 3, 2, 1} + + eq := x.Equal(&x) + if eq != 1 { + t.Errorf("wrong about equality") + } + + eq = x.Equal(&y) + if eq != 0 { + t.Errorf("wrong about inequality") + } +} + +func TestInvert(t *testing.T) { + x := Element{1, 1, 1, 1, 1} + one := Element{1, 0, 0, 0, 0} + var xinv, r Element + + xinv.Invert(&x) + r.Multiply(&x, &xinv) + r.reduce() + + if one != r { + t.Errorf("inversion identity failed, got: %x", r) + } + + var bytes [32]byte + + _, err := io.ReadFull(rand.Reader, bytes[:]) + if err != nil { + t.Fatal(err) + } + x.SetBytes(bytes[:]) + + xinv.Invert(&x) + r.Multiply(&x, &xinv) + r.reduce() + + if one != r { + t.Errorf("random inversion identity failed, got: %x for field element %x", r, x) + } + + zero := Element{} + x.Set(&zero) + if xx := xinv.Invert(&x); xx != &xinv { + t.Errorf("inverting zero did not return the receiver") + } else if xinv.Equal(&zero) != 1 { + t.Errorf("inverting zero did not return zero") + } +} + +func TestSelectSwap(t *testing.T) { + a := Element{358744748052810, 1691584618240980, 977650209285361, 1429865912637724, 560044844278676} + b := Element{84926274344903, 473620666599931, 365590438845504, 1028470286882429, 2146499180330972} + + var c, d Element + + c.Select(&a, &b, 1) + d.Select(&a, &b, 0) + + if c.Equal(&a) != 1 || d.Equal(&b) != 1 { + t.Errorf("Select failed") + } + + c.Swap(&d, 0) + + if c.Equal(&a) != 1 || d.Equal(&b) != 1 { + t.Errorf("Swap failed") + } + + c.Swap(&d, 1) + + if c.Equal(&b) != 1 || d.Equal(&a) != 1 { + t.Errorf("Swap failed") + } +} + +func TestMult32(t *testing.T) { + mult32EquivalentToMul := func(x Element, y uint32) bool { + t1 := new(Element) + for i := 0; i < 100; i++ { + t1.Mult32(&x, y) + } + + ty := new(Element) + ty.l0 = uint64(y) + + t2 := new(Element) + for i := 0; i < 100; i++ { + t2.Multiply(&x, ty) + } + + return t1.Equal(t2) == 1 && isInBounds(t1) && isInBounds(t2) + } + + if err := quick.Check(mult32EquivalentToMul, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func TestSqrtRatio(t *testing.T) { + // From draft-irtf-cfrg-ristretto255-decaf448-00, Appendix A.4. + type test struct { + u, v string + wasSquare int + r string + } + var tests = []test{ + // If u is 0, the function is defined to return (0, TRUE), even if v + // is zero. Note that where used in this package, the denominator v + // is never zero. + { + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000000", + 1, "0000000000000000000000000000000000000000000000000000000000000000", + }, + // 0/1 == 0² + { + "0000000000000000000000000000000000000000000000000000000000000000", + "0100000000000000000000000000000000000000000000000000000000000000", + 1, "0000000000000000000000000000000000000000000000000000000000000000", + }, + // If u is non-zero and v is zero, defined to return (0, FALSE). + { + "0100000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000000", + 0, "0000000000000000000000000000000000000000000000000000000000000000", + }, + // 2/1 is not square in this field. + { + "0200000000000000000000000000000000000000000000000000000000000000", + "0100000000000000000000000000000000000000000000000000000000000000", + 0, "3c5ff1b5d8e4113b871bd052f9e7bcd0582804c266ffb2d4f4203eb07fdb7c54", + }, + // 4/1 == 2² + { + "0400000000000000000000000000000000000000000000000000000000000000", + "0100000000000000000000000000000000000000000000000000000000000000", + 1, "0200000000000000000000000000000000000000000000000000000000000000", + }, + // 1/4 == (2⁻¹)² == (2^(p-2))² per Euler's theorem + { + "0100000000000000000000000000000000000000000000000000000000000000", + "0400000000000000000000000000000000000000000000000000000000000000", + 1, "f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + }, + } + + for i, tt := range tests { + u, _ := new(Element).SetBytes(decodeHex(tt.u)) + v, _ := new(Element).SetBytes(decodeHex(tt.v)) + want, _ := new(Element).SetBytes(decodeHex(tt.r)) + got, wasSquare := new(Element).SqrtRatio(u, v) + if got.Equal(want) == 0 || wasSquare != tt.wasSquare { + t.Errorf("%d: got (%v, %v), want (%v, %v)", i, got, wasSquare, want, tt.wasSquare) + } + } +} + +func TestCarryPropagate(t *testing.T) { + asmLikeGeneric := func(a [5]uint64) bool { + t1 := &Element{a[0], a[1], a[2], a[3], a[4]} + t2 := &Element{a[0], a[1], a[2], a[3], a[4]} + + t1.carryPropagate() + t2.carryPropagateGeneric() + + if *t1 != *t2 { + t.Logf("got: %#v,\nexpected: %#v", t1, t2) + } + + return *t1 == *t2 && isInBounds(t2) + } + + if err := quick.Check(asmLikeGeneric, quickCheckConfig(1024)); err != nil { + t.Error(err) + } + + if !asmLikeGeneric([5]uint64{0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}) { + t.Errorf("failed for {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}") + } +} + +func TestFeSquare(t *testing.T) { + asmLikeGeneric := func(a Element) bool { + t1 := a + t2 := a + + feSquareGeneric(&t1, &t1) + feSquare(&t2, &t2) + + if t1 != t2 { + t.Logf("got: %#v,\nexpected: %#v", t1, t2) + } + + return t1 == t2 && isInBounds(&t2) + } + + if err := quick.Check(asmLikeGeneric, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func TestFeMul(t *testing.T) { + asmLikeGeneric := func(a, b Element) bool { + a1 := a + a2 := a + b1 := b + b2 := b + + feMulGeneric(&a1, &a1, &b1) + feMul(&a2, &a2, &b2) + + if a1 != a2 || b1 != b2 { + t.Logf("got: %#v,\nexpected: %#v", a1, a2) + t.Logf("got: %#v,\nexpected: %#v", b1, b2) + } + + return a1 == a2 && isInBounds(&a2) && + b1 == b2 && isInBounds(&b2) + } + + if err := quick.Check(asmLikeGeneric, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func decodeHex(s string) []byte { + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + return b +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/go.mod b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/go.mod new file mode 100644 index 0000000..78e04e9 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/go.mod @@ -0,0 +1,3 @@ +module filippo.io/edwards25519 + +go 1.20 diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar.go new file mode 100644 index 0000000..3fd1653 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar.go @@ -0,0 +1,343 @@ +// Copyright (c) 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "encoding/binary" + "errors" +) + +// A Scalar is an integer modulo +// +// l = 2^252 + 27742317777372353535851937790883648493 +// +// which is the prime order of the edwards25519 group. +// +// This type works similarly to math/big.Int, and all arguments and +// receivers are allowed to alias. +// +// The zero value is a valid zero element. +type Scalar struct { + // s is the scalar in the Montgomery domain, in the format of the + // fiat-crypto implementation. + s fiatScalarMontgomeryDomainFieldElement +} + +// The field implementation in scalar_fiat.go is generated by the fiat-crypto +// project (https://github.com/mit-plv/fiat-crypto) at version v0.0.9 (23d2dbc) +// from a formally verified model. +// +// fiat-crypto code comes under the following license. +// +// Copyright (c) 2015-2020 The fiat-crypto Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// THIS SOFTWARE IS PROVIDED BY the fiat-crypto authors "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, +// Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +// NewScalar returns a new zero Scalar. +func NewScalar() *Scalar { + return &Scalar{} +} + +// MultiplyAdd sets s = x * y + z mod l, and returns s. It is equivalent to +// using Multiply and then Add. +func (s *Scalar) MultiplyAdd(x, y, z *Scalar) *Scalar { + // Make a copy of z in case it aliases s. + zCopy := new(Scalar).Set(z) + return s.Multiply(x, y).Add(s, zCopy) +} + +// Add sets s = x + y mod l, and returns s. +func (s *Scalar) Add(x, y *Scalar) *Scalar { + // s = 1 * x + y mod l + fiatScalarAdd(&s.s, &x.s, &y.s) + return s +} + +// Subtract sets s = x - y mod l, and returns s. +func (s *Scalar) Subtract(x, y *Scalar) *Scalar { + // s = -1 * y + x mod l + fiatScalarSub(&s.s, &x.s, &y.s) + return s +} + +// Negate sets s = -x mod l, and returns s. +func (s *Scalar) Negate(x *Scalar) *Scalar { + // s = -1 * x + 0 mod l + fiatScalarOpp(&s.s, &x.s) + return s +} + +// Multiply sets s = x * y mod l, and returns s. +func (s *Scalar) Multiply(x, y *Scalar) *Scalar { + // s = x * y + 0 mod l + fiatScalarMul(&s.s, &x.s, &y.s) + return s +} + +// Set sets s = x, and returns s. +func (s *Scalar) Set(x *Scalar) *Scalar { + *s = *x + return s +} + +// SetUniformBytes sets s = x mod l, where x is a 64-byte little-endian integer. +// If x is not of the right length, SetUniformBytes returns nil and an error, +// and the receiver is unchanged. +// +// SetUniformBytes can be used to set s to a uniformly distributed value given +// 64 uniformly distributed random bytes. +func (s *Scalar) SetUniformBytes(x []byte) (*Scalar, error) { + if len(x) != 64 { + return nil, errors.New("edwards25519: invalid SetUniformBytes input length") + } + + // We have a value x of 512 bits, but our fiatScalarFromBytes function + // expects an input lower than l, which is a little over 252 bits. + // + // Instead of writing a reduction function that operates on wider inputs, we + // can interpret x as the sum of three shorter values a, b, and c. + // + // x = a + b * 2^168 + c * 2^336 mod l + // + // We then precompute 2^168 and 2^336 modulo l, and perform the reduction + // with two multiplications and two additions. + + s.setShortBytes(x[:21]) + t := new(Scalar).setShortBytes(x[21:42]) + s.Add(s, t.Multiply(t, scalarTwo168)) + t.setShortBytes(x[42:]) + s.Add(s, t.Multiply(t, scalarTwo336)) + + return s, nil +} + +// scalarTwo168 and scalarTwo336 are 2^168 and 2^336 modulo l, encoded as a +// fiatScalarMontgomeryDomainFieldElement, which is a little-endian 4-limb value +// in the 2^256 Montgomery domain. +var scalarTwo168 = &Scalar{s: [4]uint64{0x5b8ab432eac74798, 0x38afddd6de59d5d7, + 0xa2c131b399411b7c, 0x6329a7ed9ce5a30}} +var scalarTwo336 = &Scalar{s: [4]uint64{0xbd3d108e2b35ecc5, 0x5c3a3718bdf9c90b, + 0x63aa97a331b4f2ee, 0x3d217f5be65cb5c}} + +// setShortBytes sets s = x mod l, where x is a little-endian integer shorter +// than 32 bytes. +func (s *Scalar) setShortBytes(x []byte) *Scalar { + if len(x) >= 32 { + panic("edwards25519: internal error: setShortBytes called with a long string") + } + var buf [32]byte + copy(buf[:], x) + fiatScalarFromBytes((*[4]uint64)(&s.s), &buf) + fiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s)) + return s +} + +// SetCanonicalBytes sets s = x, where x is a 32-byte little-endian encoding of +// s, and returns s. If x is not a canonical encoding of s, SetCanonicalBytes +// returns nil and an error, and the receiver is unchanged. +func (s *Scalar) SetCanonicalBytes(x []byte) (*Scalar, error) { + if len(x) != 32 { + return nil, errors.New("invalid scalar length") + } + if !isReduced(x) { + return nil, errors.New("invalid scalar encoding") + } + + fiatScalarFromBytes((*[4]uint64)(&s.s), (*[32]byte)(x)) + fiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s)) + + return s, nil +} + +// scalarMinusOneBytes is l - 1 in little endian. +var scalarMinusOneBytes = [32]byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16} + +// isReduced returns whether the given scalar in 32-byte little endian encoded +// form is reduced modulo l. +func isReduced(s []byte) bool { + if len(s) != 32 { + return false + } + + for i := len(s) - 1; i >= 0; i-- { + switch { + case s[i] > scalarMinusOneBytes[i]: + return false + case s[i] < scalarMinusOneBytes[i]: + return true + } + } + return true +} + +// SetBytesWithClamping applies the buffer pruning described in RFC 8032, +// Section 5.1.5 (also known as clamping) and sets s to the result. The input +// must be 32 bytes, and it is not modified. If x is not of the right length, +// SetBytesWithClamping returns nil and an error, and the receiver is unchanged. +// +// Note that since Scalar values are always reduced modulo the prime order of +// the curve, the resulting value will not preserve any of the cofactor-clearing +// properties that clamping is meant to provide. It will however work as +// expected as long as it is applied to points on the prime order subgroup, like +// in Ed25519. In fact, it is lost to history why RFC 8032 adopted the +// irrelevant RFC 7748 clamping, but it is now required for compatibility. +func (s *Scalar) SetBytesWithClamping(x []byte) (*Scalar, error) { + // The description above omits the purpose of the high bits of the clamping + // for brevity, but those are also lost to reductions, and are also + // irrelevant to edwards25519 as they protect against a specific + // implementation bug that was once observed in a generic Montgomery ladder. + if len(x) != 32 { + return nil, errors.New("edwards25519: invalid SetBytesWithClamping input length") + } + + // We need to use the wide reduction from SetUniformBytes, since clamping + // sets the 2^254 bit, making the value higher than the order. + var wideBytes [64]byte + copy(wideBytes[:], x[:]) + wideBytes[0] &= 248 + wideBytes[31] &= 63 + wideBytes[31] |= 64 + return s.SetUniformBytes(wideBytes[:]) +} + +// Bytes returns the canonical 32-byte little-endian encoding of s. +func (s *Scalar) Bytes() []byte { + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var encoded [32]byte + return s.bytes(&encoded) +} + +func (s *Scalar) bytes(out *[32]byte) []byte { + var ss fiatScalarNonMontgomeryDomainFieldElement + fiatScalarFromMontgomery(&ss, &s.s) + fiatScalarToBytes(out, (*[4]uint64)(&ss)) + return out[:] +} + +// Equal returns 1 if s and t are equal, and 0 otherwise. +func (s *Scalar) Equal(t *Scalar) int { + var diff fiatScalarMontgomeryDomainFieldElement + fiatScalarSub(&diff, &s.s, &t.s) + var nonzero uint64 + fiatScalarNonzero(&nonzero, (*[4]uint64)(&diff)) + nonzero |= nonzero >> 32 + nonzero |= nonzero >> 16 + nonzero |= nonzero >> 8 + nonzero |= nonzero >> 4 + nonzero |= nonzero >> 2 + nonzero |= nonzero >> 1 + return int(^nonzero) & 1 +} + +// nonAdjacentForm computes a width-w non-adjacent form for this scalar. +// +// w must be between 2 and 8, or nonAdjacentForm will panic. +func (s *Scalar) nonAdjacentForm(w uint) [256]int8 { + // This implementation is adapted from the one + // in curve25519-dalek and is documented there: + // https://github.com/dalek-cryptography/curve25519-dalek/blob/f630041af28e9a405255f98a8a93adca18e4315b/src/scalar.rs#L800-L871 + b := s.Bytes() + if b[31] > 127 { + panic("scalar has high bit set illegally") + } + if w < 2 { + panic("w must be at least 2 by the definition of NAF") + } else if w > 8 { + panic("NAF digits must fit in int8") + } + + var naf [256]int8 + var digits [5]uint64 + + for i := 0; i < 4; i++ { + digits[i] = binary.LittleEndian.Uint64(b[i*8:]) + } + + width := uint64(1 << w) + windowMask := uint64(width - 1) + + pos := uint(0) + carry := uint64(0) + for pos < 256 { + indexU64 := pos / 64 + indexBit := pos % 64 + var bitBuf uint64 + if indexBit < 64-w { + // This window's bits are contained in a single u64 + bitBuf = digits[indexU64] >> indexBit + } else { + // Combine the current 64 bits with bits from the next 64 + bitBuf = (digits[indexU64] >> indexBit) | (digits[1+indexU64] << (64 - indexBit)) + } + + // Add carry into the current window + window := carry + (bitBuf & windowMask) + + if window&1 == 0 { + // If the window value is even, preserve the carry and continue. + // Why is the carry preserved? + // If carry == 0 and window & 1 == 0, + // then the next carry should be 0 + // If carry == 1 and window & 1 == 0, + // then bit_buf & 1 == 1 so the next carry should be 1 + pos += 1 + continue + } + + if window < width/2 { + carry = 0 + naf[pos] = int8(window) + } else { + carry = 1 + naf[pos] = int8(window) - int8(width) + } + + pos += w + } + return naf +} + +func (s *Scalar) signedRadix16() [64]int8 { + b := s.Bytes() + if b[31] > 127 { + panic("scalar has high bit set illegally") + } + + var digits [64]int8 + + // Compute unsigned radix-16 digits: + for i := 0; i < 32; i++ { + digits[2*i] = int8(b[i] & 15) + digits[2*i+1] = int8((b[i] >> 4) & 15) + } + + // Recenter coefficients: + for i := 0; i < 63; i++ { + carry := (digits[i] + 8) >> 4 + digits[i] -= carry << 4 + digits[i+1] += carry + } + + return digits +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_alias_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_alias_test.go new file mode 100644 index 0000000..1bca1b0 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_alias_test.go @@ -0,0 +1,111 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "testing" + "testing/quick" +) + +func TestScalarAliasing(t *testing.T) { + checkAliasingOneArg := func(f func(v, x *Scalar) *Scalar, v, x Scalar) bool { + x1, v1 := x, x + + // Calculate a reference f(x) without aliasing. + if out := f(&v, &x); out != &v || !isReduced(out.Bytes()) { + return false + } + + // Test aliasing the argument and the receiver. + if out := f(&v1, &v1); out != &v1 || v1 != v || !isReduced(out.Bytes()) { + return false + } + + // Ensure the arguments was not modified. + return x == x1 + } + + checkAliasingTwoArgs := func(f func(v, x, y *Scalar) *Scalar, v, x, y Scalar) bool { + x1, y1, v1 := x, y, Scalar{} + + // Calculate a reference f(x, y) without aliasing. + if out := f(&v, &x, &y); out != &v || !isReduced(out.Bytes()) { + return false + } + + // Test aliasing the first argument and the receiver. + v1 = x + if out := f(&v1, &v1, &y); out != &v1 || v1 != v || !isReduced(out.Bytes()) { + return false + } + // Test aliasing the second argument and the receiver. + v1 = y + if out := f(&v1, &x, &v1); out != &v1 || v1 != v || !isReduced(out.Bytes()) { + return false + } + + // Calculate a reference f(x, x) without aliasing. + if out := f(&v, &x, &x); out != &v || !isReduced(out.Bytes()) { + return false + } + + // Test aliasing the first argument and the receiver. + v1 = x + if out := f(&v1, &v1, &x); out != &v1 || v1 != v || !isReduced(out.Bytes()) { + return false + } + // Test aliasing the second argument and the receiver. + v1 = x + if out := f(&v1, &x, &v1); out != &v1 || v1 != v || !isReduced(out.Bytes()) { + return false + } + // Test aliasing both arguments and the receiver. + v1 = x + if out := f(&v1, &v1, &v1); out != &v1 || v1 != v || !isReduced(out.Bytes()) { + return false + } + + // Ensure the arguments were not modified. + return x == x1 && y == y1 + } + + for name, f := range map[string]interface{}{ + "Negate": func(v, x Scalar) bool { + return checkAliasingOneArg((*Scalar).Negate, v, x) + }, + "Invert": func(v, x Scalar) bool { + return checkAliasingOneArg((*Scalar).Invert, v, x) + }, + "Multiply": func(v, x, y Scalar) bool { + return checkAliasingTwoArgs((*Scalar).Multiply, v, x, y) + }, + "Add": func(v, x, y Scalar) bool { + return checkAliasingTwoArgs((*Scalar).Add, v, x, y) + }, + "Subtract": func(v, x, y Scalar) bool { + return checkAliasingTwoArgs((*Scalar).Subtract, v, x, y) + }, + "MultiplyAdd1": func(v, x, y, fixed Scalar) bool { + return checkAliasingTwoArgs(func(v, x, y *Scalar) *Scalar { + return v.MultiplyAdd(&fixed, x, y) + }, v, x, y) + }, + "MultiplyAdd2": func(v, x, y, fixed Scalar) bool { + return checkAliasingTwoArgs(func(v, x, y *Scalar) *Scalar { + return v.MultiplyAdd(x, &fixed, y) + }, v, x, y) + }, + "MultiplyAdd3": func(v, x, y, fixed Scalar) bool { + return checkAliasingTwoArgs(func(v, x, y *Scalar) *Scalar { + return v.MultiplyAdd(x, y, &fixed) + }, v, x, y) + }, + } { + err := quick.Check(f, quickCheckConfig(32)) + if err != nil { + t.Errorf("%v: %v", name, err) + } + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_fiat.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_fiat.go new file mode 100644 index 0000000..2e5782b --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_fiat.go @@ -0,0 +1,1147 @@ +// Code generated by Fiat Cryptography. DO NOT EDIT. +// +// Autogenerated: word_by_word_montgomery --lang Go --cmovznz-by-mul --relax-primitive-carry-to-bitwidth 32,64 --public-function-case camelCase --public-type-case camelCase --private-function-case camelCase --private-type-case camelCase --doc-text-before-function-name '' --doc-newline-before-package-declaration --doc-prepend-header 'Code generated by Fiat Cryptography. DO NOT EDIT.' --package-name edwards25519 Scalar 64 '2^252 + 27742317777372353535851937790883648493' mul add sub opp nonzero from_montgomery to_montgomery to_bytes from_bytes +// +// curve description: Scalar +// +// machine_wordsize = 64 (from "64") +// +// requested operations: mul, add, sub, opp, nonzero, from_montgomery, to_montgomery, to_bytes, from_bytes +// +// m = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed (from "2^252 + 27742317777372353535851937790883648493") +// +// +// +// NOTE: In addition to the bounds specified above each function, all +// +// functions synthesized for this Montgomery arithmetic require the +// +// input to be strictly less than the prime modulus (m), and also +// +// require the input to be in the unique saturated representation. +// +// All functions also ensure that these two properties are true of +// +// return values. +// +// +// +// Computed values: +// +// eval z = z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) +// +// bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) +// +// twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) in +// +// if x1 & (2^256-1) < 2^255 then x1 & (2^256-1) else (x1 & (2^256-1)) - 2^256 + +package edwards25519 + +import "math/bits" + +type fiatScalarUint1 uint64 // We use uint64 instead of a more narrow type for performance reasons; see https://github.com/mit-plv/fiat-crypto/pull/1006#issuecomment-892625927 +type fiatScalarInt1 int64 // We use uint64 instead of a more narrow type for performance reasons; see https://github.com/mit-plv/fiat-crypto/pull/1006#issuecomment-892625927 + +// The type fiatScalarMontgomeryDomainFieldElement is a field element in the Montgomery domain. +// +// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] +type fiatScalarMontgomeryDomainFieldElement [4]uint64 + +// The type fiatScalarNonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain. +// +// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] +type fiatScalarNonMontgomeryDomainFieldElement [4]uint64 + +// fiatScalarCmovznzU64 is a single-word conditional move. +// +// Postconditions: +// +// out1 = (if arg1 = 0 then arg2 else arg3) +// +// Input Bounds: +// +// arg1: [0x0 ~> 0x1] +// arg2: [0x0 ~> 0xffffffffffffffff] +// arg3: [0x0 ~> 0xffffffffffffffff] +// +// Output Bounds: +// +// out1: [0x0 ~> 0xffffffffffffffff] +func fiatScalarCmovznzU64(out1 *uint64, arg1 fiatScalarUint1, arg2 uint64, arg3 uint64) { + x1 := (uint64(arg1) * 0xffffffffffffffff) + x2 := ((x1 & arg3) | ((^x1) & arg2)) + *out1 = x2 +} + +// fiatScalarMul multiplies two field elements in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// 0 ≤ eval arg2 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m +// 0 ≤ eval out1 < m +func fiatScalarMul(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) { + x1 := arg1[1] + x2 := arg1[2] + x3 := arg1[3] + x4 := arg1[0] + var x5 uint64 + var x6 uint64 + x6, x5 = bits.Mul64(x4, arg2[3]) + var x7 uint64 + var x8 uint64 + x8, x7 = bits.Mul64(x4, arg2[2]) + var x9 uint64 + var x10 uint64 + x10, x9 = bits.Mul64(x4, arg2[1]) + var x11 uint64 + var x12 uint64 + x12, x11 = bits.Mul64(x4, arg2[0]) + var x13 uint64 + var x14 uint64 + x13, x14 = bits.Add64(x12, x9, uint64(0x0)) + var x15 uint64 + var x16 uint64 + x15, x16 = bits.Add64(x10, x7, uint64(fiatScalarUint1(x14))) + var x17 uint64 + var x18 uint64 + x17, x18 = bits.Add64(x8, x5, uint64(fiatScalarUint1(x16))) + x19 := (uint64(fiatScalarUint1(x18)) + x6) + var x20 uint64 + _, x20 = bits.Mul64(x11, 0xd2b51da312547e1b) + var x22 uint64 + var x23 uint64 + x23, x22 = bits.Mul64(x20, 0x1000000000000000) + var x24 uint64 + var x25 uint64 + x25, x24 = bits.Mul64(x20, 0x14def9dea2f79cd6) + var x26 uint64 + var x27 uint64 + x27, x26 = bits.Mul64(x20, 0x5812631a5cf5d3ed) + var x28 uint64 + var x29 uint64 + x28, x29 = bits.Add64(x27, x24, uint64(0x0)) + x30 := (uint64(fiatScalarUint1(x29)) + x25) + var x32 uint64 + _, x32 = bits.Add64(x11, x26, uint64(0x0)) + var x33 uint64 + var x34 uint64 + x33, x34 = bits.Add64(x13, x28, uint64(fiatScalarUint1(x32))) + var x35 uint64 + var x36 uint64 + x35, x36 = bits.Add64(x15, x30, uint64(fiatScalarUint1(x34))) + var x37 uint64 + var x38 uint64 + x37, x38 = bits.Add64(x17, x22, uint64(fiatScalarUint1(x36))) + var x39 uint64 + var x40 uint64 + x39, x40 = bits.Add64(x19, x23, uint64(fiatScalarUint1(x38))) + var x41 uint64 + var x42 uint64 + x42, x41 = bits.Mul64(x1, arg2[3]) + var x43 uint64 + var x44 uint64 + x44, x43 = bits.Mul64(x1, arg2[2]) + var x45 uint64 + var x46 uint64 + x46, x45 = bits.Mul64(x1, arg2[1]) + var x47 uint64 + var x48 uint64 + x48, x47 = bits.Mul64(x1, arg2[0]) + var x49 uint64 + var x50 uint64 + x49, x50 = bits.Add64(x48, x45, uint64(0x0)) + var x51 uint64 + var x52 uint64 + x51, x52 = bits.Add64(x46, x43, uint64(fiatScalarUint1(x50))) + var x53 uint64 + var x54 uint64 + x53, x54 = bits.Add64(x44, x41, uint64(fiatScalarUint1(x52))) + x55 := (uint64(fiatScalarUint1(x54)) + x42) + var x56 uint64 + var x57 uint64 + x56, x57 = bits.Add64(x33, x47, uint64(0x0)) + var x58 uint64 + var x59 uint64 + x58, x59 = bits.Add64(x35, x49, uint64(fiatScalarUint1(x57))) + var x60 uint64 + var x61 uint64 + x60, x61 = bits.Add64(x37, x51, uint64(fiatScalarUint1(x59))) + var x62 uint64 + var x63 uint64 + x62, x63 = bits.Add64(x39, x53, uint64(fiatScalarUint1(x61))) + var x64 uint64 + var x65 uint64 + x64, x65 = bits.Add64(uint64(fiatScalarUint1(x40)), x55, uint64(fiatScalarUint1(x63))) + var x66 uint64 + _, x66 = bits.Mul64(x56, 0xd2b51da312547e1b) + var x68 uint64 + var x69 uint64 + x69, x68 = bits.Mul64(x66, 0x1000000000000000) + var x70 uint64 + var x71 uint64 + x71, x70 = bits.Mul64(x66, 0x14def9dea2f79cd6) + var x72 uint64 + var x73 uint64 + x73, x72 = bits.Mul64(x66, 0x5812631a5cf5d3ed) + var x74 uint64 + var x75 uint64 + x74, x75 = bits.Add64(x73, x70, uint64(0x0)) + x76 := (uint64(fiatScalarUint1(x75)) + x71) + var x78 uint64 + _, x78 = bits.Add64(x56, x72, uint64(0x0)) + var x79 uint64 + var x80 uint64 + x79, x80 = bits.Add64(x58, x74, uint64(fiatScalarUint1(x78))) + var x81 uint64 + var x82 uint64 + x81, x82 = bits.Add64(x60, x76, uint64(fiatScalarUint1(x80))) + var x83 uint64 + var x84 uint64 + x83, x84 = bits.Add64(x62, x68, uint64(fiatScalarUint1(x82))) + var x85 uint64 + var x86 uint64 + x85, x86 = bits.Add64(x64, x69, uint64(fiatScalarUint1(x84))) + x87 := (uint64(fiatScalarUint1(x86)) + uint64(fiatScalarUint1(x65))) + var x88 uint64 + var x89 uint64 + x89, x88 = bits.Mul64(x2, arg2[3]) + var x90 uint64 + var x91 uint64 + x91, x90 = bits.Mul64(x2, arg2[2]) + var x92 uint64 + var x93 uint64 + x93, x92 = bits.Mul64(x2, arg2[1]) + var x94 uint64 + var x95 uint64 + x95, x94 = bits.Mul64(x2, arg2[0]) + var x96 uint64 + var x97 uint64 + x96, x97 = bits.Add64(x95, x92, uint64(0x0)) + var x98 uint64 + var x99 uint64 + x98, x99 = bits.Add64(x93, x90, uint64(fiatScalarUint1(x97))) + var x100 uint64 + var x101 uint64 + x100, x101 = bits.Add64(x91, x88, uint64(fiatScalarUint1(x99))) + x102 := (uint64(fiatScalarUint1(x101)) + x89) + var x103 uint64 + var x104 uint64 + x103, x104 = bits.Add64(x79, x94, uint64(0x0)) + var x105 uint64 + var x106 uint64 + x105, x106 = bits.Add64(x81, x96, uint64(fiatScalarUint1(x104))) + var x107 uint64 + var x108 uint64 + x107, x108 = bits.Add64(x83, x98, uint64(fiatScalarUint1(x106))) + var x109 uint64 + var x110 uint64 + x109, x110 = bits.Add64(x85, x100, uint64(fiatScalarUint1(x108))) + var x111 uint64 + var x112 uint64 + x111, x112 = bits.Add64(x87, x102, uint64(fiatScalarUint1(x110))) + var x113 uint64 + _, x113 = bits.Mul64(x103, 0xd2b51da312547e1b) + var x115 uint64 + var x116 uint64 + x116, x115 = bits.Mul64(x113, 0x1000000000000000) + var x117 uint64 + var x118 uint64 + x118, x117 = bits.Mul64(x113, 0x14def9dea2f79cd6) + var x119 uint64 + var x120 uint64 + x120, x119 = bits.Mul64(x113, 0x5812631a5cf5d3ed) + var x121 uint64 + var x122 uint64 + x121, x122 = bits.Add64(x120, x117, uint64(0x0)) + x123 := (uint64(fiatScalarUint1(x122)) + x118) + var x125 uint64 + _, x125 = bits.Add64(x103, x119, uint64(0x0)) + var x126 uint64 + var x127 uint64 + x126, x127 = bits.Add64(x105, x121, uint64(fiatScalarUint1(x125))) + var x128 uint64 + var x129 uint64 + x128, x129 = bits.Add64(x107, x123, uint64(fiatScalarUint1(x127))) + var x130 uint64 + var x131 uint64 + x130, x131 = bits.Add64(x109, x115, uint64(fiatScalarUint1(x129))) + var x132 uint64 + var x133 uint64 + x132, x133 = bits.Add64(x111, x116, uint64(fiatScalarUint1(x131))) + x134 := (uint64(fiatScalarUint1(x133)) + uint64(fiatScalarUint1(x112))) + var x135 uint64 + var x136 uint64 + x136, x135 = bits.Mul64(x3, arg2[3]) + var x137 uint64 + var x138 uint64 + x138, x137 = bits.Mul64(x3, arg2[2]) + var x139 uint64 + var x140 uint64 + x140, x139 = bits.Mul64(x3, arg2[1]) + var x141 uint64 + var x142 uint64 + x142, x141 = bits.Mul64(x3, arg2[0]) + var x143 uint64 + var x144 uint64 + x143, x144 = bits.Add64(x142, x139, uint64(0x0)) + var x145 uint64 + var x146 uint64 + x145, x146 = bits.Add64(x140, x137, uint64(fiatScalarUint1(x144))) + var x147 uint64 + var x148 uint64 + x147, x148 = bits.Add64(x138, x135, uint64(fiatScalarUint1(x146))) + x149 := (uint64(fiatScalarUint1(x148)) + x136) + var x150 uint64 + var x151 uint64 + x150, x151 = bits.Add64(x126, x141, uint64(0x0)) + var x152 uint64 + var x153 uint64 + x152, x153 = bits.Add64(x128, x143, uint64(fiatScalarUint1(x151))) + var x154 uint64 + var x155 uint64 + x154, x155 = bits.Add64(x130, x145, uint64(fiatScalarUint1(x153))) + var x156 uint64 + var x157 uint64 + x156, x157 = bits.Add64(x132, x147, uint64(fiatScalarUint1(x155))) + var x158 uint64 + var x159 uint64 + x158, x159 = bits.Add64(x134, x149, uint64(fiatScalarUint1(x157))) + var x160 uint64 + _, x160 = bits.Mul64(x150, 0xd2b51da312547e1b) + var x162 uint64 + var x163 uint64 + x163, x162 = bits.Mul64(x160, 0x1000000000000000) + var x164 uint64 + var x165 uint64 + x165, x164 = bits.Mul64(x160, 0x14def9dea2f79cd6) + var x166 uint64 + var x167 uint64 + x167, x166 = bits.Mul64(x160, 0x5812631a5cf5d3ed) + var x168 uint64 + var x169 uint64 + x168, x169 = bits.Add64(x167, x164, uint64(0x0)) + x170 := (uint64(fiatScalarUint1(x169)) + x165) + var x172 uint64 + _, x172 = bits.Add64(x150, x166, uint64(0x0)) + var x173 uint64 + var x174 uint64 + x173, x174 = bits.Add64(x152, x168, uint64(fiatScalarUint1(x172))) + var x175 uint64 + var x176 uint64 + x175, x176 = bits.Add64(x154, x170, uint64(fiatScalarUint1(x174))) + var x177 uint64 + var x178 uint64 + x177, x178 = bits.Add64(x156, x162, uint64(fiatScalarUint1(x176))) + var x179 uint64 + var x180 uint64 + x179, x180 = bits.Add64(x158, x163, uint64(fiatScalarUint1(x178))) + x181 := (uint64(fiatScalarUint1(x180)) + uint64(fiatScalarUint1(x159))) + var x182 uint64 + var x183 uint64 + x182, x183 = bits.Sub64(x173, 0x5812631a5cf5d3ed, uint64(0x0)) + var x184 uint64 + var x185 uint64 + x184, x185 = bits.Sub64(x175, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x183))) + var x186 uint64 + var x187 uint64 + x186, x187 = bits.Sub64(x177, uint64(0x0), uint64(fiatScalarUint1(x185))) + var x188 uint64 + var x189 uint64 + x188, x189 = bits.Sub64(x179, 0x1000000000000000, uint64(fiatScalarUint1(x187))) + var x191 uint64 + _, x191 = bits.Sub64(x181, uint64(0x0), uint64(fiatScalarUint1(x189))) + var x192 uint64 + fiatScalarCmovznzU64(&x192, fiatScalarUint1(x191), x182, x173) + var x193 uint64 + fiatScalarCmovznzU64(&x193, fiatScalarUint1(x191), x184, x175) + var x194 uint64 + fiatScalarCmovznzU64(&x194, fiatScalarUint1(x191), x186, x177) + var x195 uint64 + fiatScalarCmovznzU64(&x195, fiatScalarUint1(x191), x188, x179) + out1[0] = x192 + out1[1] = x193 + out1[2] = x194 + out1[3] = x195 +} + +// fiatScalarAdd adds two field elements in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// 0 ≤ eval arg2 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m +// 0 ≤ eval out1 < m +func fiatScalarAdd(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) { + var x1 uint64 + var x2 uint64 + x1, x2 = bits.Add64(arg1[0], arg2[0], uint64(0x0)) + var x3 uint64 + var x4 uint64 + x3, x4 = bits.Add64(arg1[1], arg2[1], uint64(fiatScalarUint1(x2))) + var x5 uint64 + var x6 uint64 + x5, x6 = bits.Add64(arg1[2], arg2[2], uint64(fiatScalarUint1(x4))) + var x7 uint64 + var x8 uint64 + x7, x8 = bits.Add64(arg1[3], arg2[3], uint64(fiatScalarUint1(x6))) + var x9 uint64 + var x10 uint64 + x9, x10 = bits.Sub64(x1, 0x5812631a5cf5d3ed, uint64(0x0)) + var x11 uint64 + var x12 uint64 + x11, x12 = bits.Sub64(x3, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x10))) + var x13 uint64 + var x14 uint64 + x13, x14 = bits.Sub64(x5, uint64(0x0), uint64(fiatScalarUint1(x12))) + var x15 uint64 + var x16 uint64 + x15, x16 = bits.Sub64(x7, 0x1000000000000000, uint64(fiatScalarUint1(x14))) + var x18 uint64 + _, x18 = bits.Sub64(uint64(fiatScalarUint1(x8)), uint64(0x0), uint64(fiatScalarUint1(x16))) + var x19 uint64 + fiatScalarCmovznzU64(&x19, fiatScalarUint1(x18), x9, x1) + var x20 uint64 + fiatScalarCmovznzU64(&x20, fiatScalarUint1(x18), x11, x3) + var x21 uint64 + fiatScalarCmovznzU64(&x21, fiatScalarUint1(x18), x13, x5) + var x22 uint64 + fiatScalarCmovznzU64(&x22, fiatScalarUint1(x18), x15, x7) + out1[0] = x19 + out1[1] = x20 + out1[2] = x21 + out1[3] = x22 +} + +// fiatScalarSub subtracts two field elements in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// 0 ≤ eval arg2 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m +// 0 ≤ eval out1 < m +func fiatScalarSub(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) { + var x1 uint64 + var x2 uint64 + x1, x2 = bits.Sub64(arg1[0], arg2[0], uint64(0x0)) + var x3 uint64 + var x4 uint64 + x3, x4 = bits.Sub64(arg1[1], arg2[1], uint64(fiatScalarUint1(x2))) + var x5 uint64 + var x6 uint64 + x5, x6 = bits.Sub64(arg1[2], arg2[2], uint64(fiatScalarUint1(x4))) + var x7 uint64 + var x8 uint64 + x7, x8 = bits.Sub64(arg1[3], arg2[3], uint64(fiatScalarUint1(x6))) + var x9 uint64 + fiatScalarCmovznzU64(&x9, fiatScalarUint1(x8), uint64(0x0), 0xffffffffffffffff) + var x10 uint64 + var x11 uint64 + x10, x11 = bits.Add64(x1, (x9 & 0x5812631a5cf5d3ed), uint64(0x0)) + var x12 uint64 + var x13 uint64 + x12, x13 = bits.Add64(x3, (x9 & 0x14def9dea2f79cd6), uint64(fiatScalarUint1(x11))) + var x14 uint64 + var x15 uint64 + x14, x15 = bits.Add64(x5, uint64(0x0), uint64(fiatScalarUint1(x13))) + var x16 uint64 + x16, _ = bits.Add64(x7, (x9 & 0x1000000000000000), uint64(fiatScalarUint1(x15))) + out1[0] = x10 + out1[1] = x12 + out1[2] = x14 + out1[3] = x16 +} + +// fiatScalarOpp negates a field element in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = -eval (from_montgomery arg1) mod m +// 0 ≤ eval out1 < m +func fiatScalarOpp(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement) { + var x1 uint64 + var x2 uint64 + x1, x2 = bits.Sub64(uint64(0x0), arg1[0], uint64(0x0)) + var x3 uint64 + var x4 uint64 + x3, x4 = bits.Sub64(uint64(0x0), arg1[1], uint64(fiatScalarUint1(x2))) + var x5 uint64 + var x6 uint64 + x5, x6 = bits.Sub64(uint64(0x0), arg1[2], uint64(fiatScalarUint1(x4))) + var x7 uint64 + var x8 uint64 + x7, x8 = bits.Sub64(uint64(0x0), arg1[3], uint64(fiatScalarUint1(x6))) + var x9 uint64 + fiatScalarCmovznzU64(&x9, fiatScalarUint1(x8), uint64(0x0), 0xffffffffffffffff) + var x10 uint64 + var x11 uint64 + x10, x11 = bits.Add64(x1, (x9 & 0x5812631a5cf5d3ed), uint64(0x0)) + var x12 uint64 + var x13 uint64 + x12, x13 = bits.Add64(x3, (x9 & 0x14def9dea2f79cd6), uint64(fiatScalarUint1(x11))) + var x14 uint64 + var x15 uint64 + x14, x15 = bits.Add64(x5, uint64(0x0), uint64(fiatScalarUint1(x13))) + var x16 uint64 + x16, _ = bits.Add64(x7, (x9 & 0x1000000000000000), uint64(fiatScalarUint1(x15))) + out1[0] = x10 + out1[1] = x12 + out1[2] = x14 + out1[3] = x16 +} + +// fiatScalarNonzero outputs a single non-zero word if the input is non-zero and zero otherwise. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// out1 = 0 ↔ eval (from_montgomery arg1) mod m = 0 +// +// Input Bounds: +// +// arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] +// +// Output Bounds: +// +// out1: [0x0 ~> 0xffffffffffffffff] +func fiatScalarNonzero(out1 *uint64, arg1 *[4]uint64) { + x1 := (arg1[0] | (arg1[1] | (arg1[2] | arg1[3]))) + *out1 = x1 +} + +// fiatScalarFromMontgomery translates a field element out of the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m +// 0 ≤ eval out1 < m +func fiatScalarFromMontgomery(out1 *fiatScalarNonMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement) { + x1 := arg1[0] + var x2 uint64 + _, x2 = bits.Mul64(x1, 0xd2b51da312547e1b) + var x4 uint64 + var x5 uint64 + x5, x4 = bits.Mul64(x2, 0x1000000000000000) + var x6 uint64 + var x7 uint64 + x7, x6 = bits.Mul64(x2, 0x14def9dea2f79cd6) + var x8 uint64 + var x9 uint64 + x9, x8 = bits.Mul64(x2, 0x5812631a5cf5d3ed) + var x10 uint64 + var x11 uint64 + x10, x11 = bits.Add64(x9, x6, uint64(0x0)) + var x13 uint64 + _, x13 = bits.Add64(x1, x8, uint64(0x0)) + var x14 uint64 + var x15 uint64 + x14, x15 = bits.Add64(uint64(0x0), x10, uint64(fiatScalarUint1(x13))) + var x16 uint64 + var x17 uint64 + x16, x17 = bits.Add64(x14, arg1[1], uint64(0x0)) + var x18 uint64 + _, x18 = bits.Mul64(x16, 0xd2b51da312547e1b) + var x20 uint64 + var x21 uint64 + x21, x20 = bits.Mul64(x18, 0x1000000000000000) + var x22 uint64 + var x23 uint64 + x23, x22 = bits.Mul64(x18, 0x14def9dea2f79cd6) + var x24 uint64 + var x25 uint64 + x25, x24 = bits.Mul64(x18, 0x5812631a5cf5d3ed) + var x26 uint64 + var x27 uint64 + x26, x27 = bits.Add64(x25, x22, uint64(0x0)) + var x29 uint64 + _, x29 = bits.Add64(x16, x24, uint64(0x0)) + var x30 uint64 + var x31 uint64 + x30, x31 = bits.Add64((uint64(fiatScalarUint1(x17)) + (uint64(fiatScalarUint1(x15)) + (uint64(fiatScalarUint1(x11)) + x7))), x26, uint64(fiatScalarUint1(x29))) + var x32 uint64 + var x33 uint64 + x32, x33 = bits.Add64(x4, (uint64(fiatScalarUint1(x27)) + x23), uint64(fiatScalarUint1(x31))) + var x34 uint64 + var x35 uint64 + x34, x35 = bits.Add64(x5, x20, uint64(fiatScalarUint1(x33))) + var x36 uint64 + var x37 uint64 + x36, x37 = bits.Add64(x30, arg1[2], uint64(0x0)) + var x38 uint64 + var x39 uint64 + x38, x39 = bits.Add64(x32, uint64(0x0), uint64(fiatScalarUint1(x37))) + var x40 uint64 + var x41 uint64 + x40, x41 = bits.Add64(x34, uint64(0x0), uint64(fiatScalarUint1(x39))) + var x42 uint64 + _, x42 = bits.Mul64(x36, 0xd2b51da312547e1b) + var x44 uint64 + var x45 uint64 + x45, x44 = bits.Mul64(x42, 0x1000000000000000) + var x46 uint64 + var x47 uint64 + x47, x46 = bits.Mul64(x42, 0x14def9dea2f79cd6) + var x48 uint64 + var x49 uint64 + x49, x48 = bits.Mul64(x42, 0x5812631a5cf5d3ed) + var x50 uint64 + var x51 uint64 + x50, x51 = bits.Add64(x49, x46, uint64(0x0)) + var x53 uint64 + _, x53 = bits.Add64(x36, x48, uint64(0x0)) + var x54 uint64 + var x55 uint64 + x54, x55 = bits.Add64(x38, x50, uint64(fiatScalarUint1(x53))) + var x56 uint64 + var x57 uint64 + x56, x57 = bits.Add64(x40, (uint64(fiatScalarUint1(x51)) + x47), uint64(fiatScalarUint1(x55))) + var x58 uint64 + var x59 uint64 + x58, x59 = bits.Add64((uint64(fiatScalarUint1(x41)) + (uint64(fiatScalarUint1(x35)) + x21)), x44, uint64(fiatScalarUint1(x57))) + var x60 uint64 + var x61 uint64 + x60, x61 = bits.Add64(x54, arg1[3], uint64(0x0)) + var x62 uint64 + var x63 uint64 + x62, x63 = bits.Add64(x56, uint64(0x0), uint64(fiatScalarUint1(x61))) + var x64 uint64 + var x65 uint64 + x64, x65 = bits.Add64(x58, uint64(0x0), uint64(fiatScalarUint1(x63))) + var x66 uint64 + _, x66 = bits.Mul64(x60, 0xd2b51da312547e1b) + var x68 uint64 + var x69 uint64 + x69, x68 = bits.Mul64(x66, 0x1000000000000000) + var x70 uint64 + var x71 uint64 + x71, x70 = bits.Mul64(x66, 0x14def9dea2f79cd6) + var x72 uint64 + var x73 uint64 + x73, x72 = bits.Mul64(x66, 0x5812631a5cf5d3ed) + var x74 uint64 + var x75 uint64 + x74, x75 = bits.Add64(x73, x70, uint64(0x0)) + var x77 uint64 + _, x77 = bits.Add64(x60, x72, uint64(0x0)) + var x78 uint64 + var x79 uint64 + x78, x79 = bits.Add64(x62, x74, uint64(fiatScalarUint1(x77))) + var x80 uint64 + var x81 uint64 + x80, x81 = bits.Add64(x64, (uint64(fiatScalarUint1(x75)) + x71), uint64(fiatScalarUint1(x79))) + var x82 uint64 + var x83 uint64 + x82, x83 = bits.Add64((uint64(fiatScalarUint1(x65)) + (uint64(fiatScalarUint1(x59)) + x45)), x68, uint64(fiatScalarUint1(x81))) + x84 := (uint64(fiatScalarUint1(x83)) + x69) + var x85 uint64 + var x86 uint64 + x85, x86 = bits.Sub64(x78, 0x5812631a5cf5d3ed, uint64(0x0)) + var x87 uint64 + var x88 uint64 + x87, x88 = bits.Sub64(x80, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x86))) + var x89 uint64 + var x90 uint64 + x89, x90 = bits.Sub64(x82, uint64(0x0), uint64(fiatScalarUint1(x88))) + var x91 uint64 + var x92 uint64 + x91, x92 = bits.Sub64(x84, 0x1000000000000000, uint64(fiatScalarUint1(x90))) + var x94 uint64 + _, x94 = bits.Sub64(uint64(0x0), uint64(0x0), uint64(fiatScalarUint1(x92))) + var x95 uint64 + fiatScalarCmovznzU64(&x95, fiatScalarUint1(x94), x85, x78) + var x96 uint64 + fiatScalarCmovznzU64(&x96, fiatScalarUint1(x94), x87, x80) + var x97 uint64 + fiatScalarCmovznzU64(&x97, fiatScalarUint1(x94), x89, x82) + var x98 uint64 + fiatScalarCmovznzU64(&x98, fiatScalarUint1(x94), x91, x84) + out1[0] = x95 + out1[1] = x96 + out1[2] = x97 + out1[3] = x98 +} + +// fiatScalarToMontgomery translates a field element into the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = eval arg1 mod m +// 0 ≤ eval out1 < m +func fiatScalarToMontgomery(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarNonMontgomeryDomainFieldElement) { + x1 := arg1[1] + x2 := arg1[2] + x3 := arg1[3] + x4 := arg1[0] + var x5 uint64 + var x6 uint64 + x6, x5 = bits.Mul64(x4, 0x399411b7c309a3d) + var x7 uint64 + var x8 uint64 + x8, x7 = bits.Mul64(x4, 0xceec73d217f5be65) + var x9 uint64 + var x10 uint64 + x10, x9 = bits.Mul64(x4, 0xd00e1ba768859347) + var x11 uint64 + var x12 uint64 + x12, x11 = bits.Mul64(x4, 0xa40611e3449c0f01) + var x13 uint64 + var x14 uint64 + x13, x14 = bits.Add64(x12, x9, uint64(0x0)) + var x15 uint64 + var x16 uint64 + x15, x16 = bits.Add64(x10, x7, uint64(fiatScalarUint1(x14))) + var x17 uint64 + var x18 uint64 + x17, x18 = bits.Add64(x8, x5, uint64(fiatScalarUint1(x16))) + var x19 uint64 + _, x19 = bits.Mul64(x11, 0xd2b51da312547e1b) + var x21 uint64 + var x22 uint64 + x22, x21 = bits.Mul64(x19, 0x1000000000000000) + var x23 uint64 + var x24 uint64 + x24, x23 = bits.Mul64(x19, 0x14def9dea2f79cd6) + var x25 uint64 + var x26 uint64 + x26, x25 = bits.Mul64(x19, 0x5812631a5cf5d3ed) + var x27 uint64 + var x28 uint64 + x27, x28 = bits.Add64(x26, x23, uint64(0x0)) + var x30 uint64 + _, x30 = bits.Add64(x11, x25, uint64(0x0)) + var x31 uint64 + var x32 uint64 + x31, x32 = bits.Add64(x13, x27, uint64(fiatScalarUint1(x30))) + var x33 uint64 + var x34 uint64 + x33, x34 = bits.Add64(x15, (uint64(fiatScalarUint1(x28)) + x24), uint64(fiatScalarUint1(x32))) + var x35 uint64 + var x36 uint64 + x35, x36 = bits.Add64(x17, x21, uint64(fiatScalarUint1(x34))) + var x37 uint64 + var x38 uint64 + x38, x37 = bits.Mul64(x1, 0x399411b7c309a3d) + var x39 uint64 + var x40 uint64 + x40, x39 = bits.Mul64(x1, 0xceec73d217f5be65) + var x41 uint64 + var x42 uint64 + x42, x41 = bits.Mul64(x1, 0xd00e1ba768859347) + var x43 uint64 + var x44 uint64 + x44, x43 = bits.Mul64(x1, 0xa40611e3449c0f01) + var x45 uint64 + var x46 uint64 + x45, x46 = bits.Add64(x44, x41, uint64(0x0)) + var x47 uint64 + var x48 uint64 + x47, x48 = bits.Add64(x42, x39, uint64(fiatScalarUint1(x46))) + var x49 uint64 + var x50 uint64 + x49, x50 = bits.Add64(x40, x37, uint64(fiatScalarUint1(x48))) + var x51 uint64 + var x52 uint64 + x51, x52 = bits.Add64(x31, x43, uint64(0x0)) + var x53 uint64 + var x54 uint64 + x53, x54 = bits.Add64(x33, x45, uint64(fiatScalarUint1(x52))) + var x55 uint64 + var x56 uint64 + x55, x56 = bits.Add64(x35, x47, uint64(fiatScalarUint1(x54))) + var x57 uint64 + var x58 uint64 + x57, x58 = bits.Add64(((uint64(fiatScalarUint1(x36)) + (uint64(fiatScalarUint1(x18)) + x6)) + x22), x49, uint64(fiatScalarUint1(x56))) + var x59 uint64 + _, x59 = bits.Mul64(x51, 0xd2b51da312547e1b) + var x61 uint64 + var x62 uint64 + x62, x61 = bits.Mul64(x59, 0x1000000000000000) + var x63 uint64 + var x64 uint64 + x64, x63 = bits.Mul64(x59, 0x14def9dea2f79cd6) + var x65 uint64 + var x66 uint64 + x66, x65 = bits.Mul64(x59, 0x5812631a5cf5d3ed) + var x67 uint64 + var x68 uint64 + x67, x68 = bits.Add64(x66, x63, uint64(0x0)) + var x70 uint64 + _, x70 = bits.Add64(x51, x65, uint64(0x0)) + var x71 uint64 + var x72 uint64 + x71, x72 = bits.Add64(x53, x67, uint64(fiatScalarUint1(x70))) + var x73 uint64 + var x74 uint64 + x73, x74 = bits.Add64(x55, (uint64(fiatScalarUint1(x68)) + x64), uint64(fiatScalarUint1(x72))) + var x75 uint64 + var x76 uint64 + x75, x76 = bits.Add64(x57, x61, uint64(fiatScalarUint1(x74))) + var x77 uint64 + var x78 uint64 + x78, x77 = bits.Mul64(x2, 0x399411b7c309a3d) + var x79 uint64 + var x80 uint64 + x80, x79 = bits.Mul64(x2, 0xceec73d217f5be65) + var x81 uint64 + var x82 uint64 + x82, x81 = bits.Mul64(x2, 0xd00e1ba768859347) + var x83 uint64 + var x84 uint64 + x84, x83 = bits.Mul64(x2, 0xa40611e3449c0f01) + var x85 uint64 + var x86 uint64 + x85, x86 = bits.Add64(x84, x81, uint64(0x0)) + var x87 uint64 + var x88 uint64 + x87, x88 = bits.Add64(x82, x79, uint64(fiatScalarUint1(x86))) + var x89 uint64 + var x90 uint64 + x89, x90 = bits.Add64(x80, x77, uint64(fiatScalarUint1(x88))) + var x91 uint64 + var x92 uint64 + x91, x92 = bits.Add64(x71, x83, uint64(0x0)) + var x93 uint64 + var x94 uint64 + x93, x94 = bits.Add64(x73, x85, uint64(fiatScalarUint1(x92))) + var x95 uint64 + var x96 uint64 + x95, x96 = bits.Add64(x75, x87, uint64(fiatScalarUint1(x94))) + var x97 uint64 + var x98 uint64 + x97, x98 = bits.Add64(((uint64(fiatScalarUint1(x76)) + (uint64(fiatScalarUint1(x58)) + (uint64(fiatScalarUint1(x50)) + x38))) + x62), x89, uint64(fiatScalarUint1(x96))) + var x99 uint64 + _, x99 = bits.Mul64(x91, 0xd2b51da312547e1b) + var x101 uint64 + var x102 uint64 + x102, x101 = bits.Mul64(x99, 0x1000000000000000) + var x103 uint64 + var x104 uint64 + x104, x103 = bits.Mul64(x99, 0x14def9dea2f79cd6) + var x105 uint64 + var x106 uint64 + x106, x105 = bits.Mul64(x99, 0x5812631a5cf5d3ed) + var x107 uint64 + var x108 uint64 + x107, x108 = bits.Add64(x106, x103, uint64(0x0)) + var x110 uint64 + _, x110 = bits.Add64(x91, x105, uint64(0x0)) + var x111 uint64 + var x112 uint64 + x111, x112 = bits.Add64(x93, x107, uint64(fiatScalarUint1(x110))) + var x113 uint64 + var x114 uint64 + x113, x114 = bits.Add64(x95, (uint64(fiatScalarUint1(x108)) + x104), uint64(fiatScalarUint1(x112))) + var x115 uint64 + var x116 uint64 + x115, x116 = bits.Add64(x97, x101, uint64(fiatScalarUint1(x114))) + var x117 uint64 + var x118 uint64 + x118, x117 = bits.Mul64(x3, 0x399411b7c309a3d) + var x119 uint64 + var x120 uint64 + x120, x119 = bits.Mul64(x3, 0xceec73d217f5be65) + var x121 uint64 + var x122 uint64 + x122, x121 = bits.Mul64(x3, 0xd00e1ba768859347) + var x123 uint64 + var x124 uint64 + x124, x123 = bits.Mul64(x3, 0xa40611e3449c0f01) + var x125 uint64 + var x126 uint64 + x125, x126 = bits.Add64(x124, x121, uint64(0x0)) + var x127 uint64 + var x128 uint64 + x127, x128 = bits.Add64(x122, x119, uint64(fiatScalarUint1(x126))) + var x129 uint64 + var x130 uint64 + x129, x130 = bits.Add64(x120, x117, uint64(fiatScalarUint1(x128))) + var x131 uint64 + var x132 uint64 + x131, x132 = bits.Add64(x111, x123, uint64(0x0)) + var x133 uint64 + var x134 uint64 + x133, x134 = bits.Add64(x113, x125, uint64(fiatScalarUint1(x132))) + var x135 uint64 + var x136 uint64 + x135, x136 = bits.Add64(x115, x127, uint64(fiatScalarUint1(x134))) + var x137 uint64 + var x138 uint64 + x137, x138 = bits.Add64(((uint64(fiatScalarUint1(x116)) + (uint64(fiatScalarUint1(x98)) + (uint64(fiatScalarUint1(x90)) + x78))) + x102), x129, uint64(fiatScalarUint1(x136))) + var x139 uint64 + _, x139 = bits.Mul64(x131, 0xd2b51da312547e1b) + var x141 uint64 + var x142 uint64 + x142, x141 = bits.Mul64(x139, 0x1000000000000000) + var x143 uint64 + var x144 uint64 + x144, x143 = bits.Mul64(x139, 0x14def9dea2f79cd6) + var x145 uint64 + var x146 uint64 + x146, x145 = bits.Mul64(x139, 0x5812631a5cf5d3ed) + var x147 uint64 + var x148 uint64 + x147, x148 = bits.Add64(x146, x143, uint64(0x0)) + var x150 uint64 + _, x150 = bits.Add64(x131, x145, uint64(0x0)) + var x151 uint64 + var x152 uint64 + x151, x152 = bits.Add64(x133, x147, uint64(fiatScalarUint1(x150))) + var x153 uint64 + var x154 uint64 + x153, x154 = bits.Add64(x135, (uint64(fiatScalarUint1(x148)) + x144), uint64(fiatScalarUint1(x152))) + var x155 uint64 + var x156 uint64 + x155, x156 = bits.Add64(x137, x141, uint64(fiatScalarUint1(x154))) + x157 := ((uint64(fiatScalarUint1(x156)) + (uint64(fiatScalarUint1(x138)) + (uint64(fiatScalarUint1(x130)) + x118))) + x142) + var x158 uint64 + var x159 uint64 + x158, x159 = bits.Sub64(x151, 0x5812631a5cf5d3ed, uint64(0x0)) + var x160 uint64 + var x161 uint64 + x160, x161 = bits.Sub64(x153, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x159))) + var x162 uint64 + var x163 uint64 + x162, x163 = bits.Sub64(x155, uint64(0x0), uint64(fiatScalarUint1(x161))) + var x164 uint64 + var x165 uint64 + x164, x165 = bits.Sub64(x157, 0x1000000000000000, uint64(fiatScalarUint1(x163))) + var x167 uint64 + _, x167 = bits.Sub64(uint64(0x0), uint64(0x0), uint64(fiatScalarUint1(x165))) + var x168 uint64 + fiatScalarCmovznzU64(&x168, fiatScalarUint1(x167), x158, x151) + var x169 uint64 + fiatScalarCmovznzU64(&x169, fiatScalarUint1(x167), x160, x153) + var x170 uint64 + fiatScalarCmovznzU64(&x170, fiatScalarUint1(x167), x162, x155) + var x171 uint64 + fiatScalarCmovznzU64(&x171, fiatScalarUint1(x167), x164, x157) + out1[0] = x168 + out1[1] = x169 + out1[2] = x170 + out1[3] = x171 +} + +// fiatScalarToBytes serializes a field element NOT in the Montgomery domain to bytes in little-endian order. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// out1 = map (λ x, ⌊((eval arg1 mod m) mod 2^(8 * (x + 1))) / 2^(8 * x)⌋) [0..31] +// +// Input Bounds: +// +// arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x1fffffffffffffff]] +// +// Output Bounds: +// +// out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x1f]] +func fiatScalarToBytes(out1 *[32]uint8, arg1 *[4]uint64) { + x1 := arg1[3] + x2 := arg1[2] + x3 := arg1[1] + x4 := arg1[0] + x5 := (uint8(x4) & 0xff) + x6 := (x4 >> 8) + x7 := (uint8(x6) & 0xff) + x8 := (x6 >> 8) + x9 := (uint8(x8) & 0xff) + x10 := (x8 >> 8) + x11 := (uint8(x10) & 0xff) + x12 := (x10 >> 8) + x13 := (uint8(x12) & 0xff) + x14 := (x12 >> 8) + x15 := (uint8(x14) & 0xff) + x16 := (x14 >> 8) + x17 := (uint8(x16) & 0xff) + x18 := uint8((x16 >> 8)) + x19 := (uint8(x3) & 0xff) + x20 := (x3 >> 8) + x21 := (uint8(x20) & 0xff) + x22 := (x20 >> 8) + x23 := (uint8(x22) & 0xff) + x24 := (x22 >> 8) + x25 := (uint8(x24) & 0xff) + x26 := (x24 >> 8) + x27 := (uint8(x26) & 0xff) + x28 := (x26 >> 8) + x29 := (uint8(x28) & 0xff) + x30 := (x28 >> 8) + x31 := (uint8(x30) & 0xff) + x32 := uint8((x30 >> 8)) + x33 := (uint8(x2) & 0xff) + x34 := (x2 >> 8) + x35 := (uint8(x34) & 0xff) + x36 := (x34 >> 8) + x37 := (uint8(x36) & 0xff) + x38 := (x36 >> 8) + x39 := (uint8(x38) & 0xff) + x40 := (x38 >> 8) + x41 := (uint8(x40) & 0xff) + x42 := (x40 >> 8) + x43 := (uint8(x42) & 0xff) + x44 := (x42 >> 8) + x45 := (uint8(x44) & 0xff) + x46 := uint8((x44 >> 8)) + x47 := (uint8(x1) & 0xff) + x48 := (x1 >> 8) + x49 := (uint8(x48) & 0xff) + x50 := (x48 >> 8) + x51 := (uint8(x50) & 0xff) + x52 := (x50 >> 8) + x53 := (uint8(x52) & 0xff) + x54 := (x52 >> 8) + x55 := (uint8(x54) & 0xff) + x56 := (x54 >> 8) + x57 := (uint8(x56) & 0xff) + x58 := (x56 >> 8) + x59 := (uint8(x58) & 0xff) + x60 := uint8((x58 >> 8)) + out1[0] = x5 + out1[1] = x7 + out1[2] = x9 + out1[3] = x11 + out1[4] = x13 + out1[5] = x15 + out1[6] = x17 + out1[7] = x18 + out1[8] = x19 + out1[9] = x21 + out1[10] = x23 + out1[11] = x25 + out1[12] = x27 + out1[13] = x29 + out1[14] = x31 + out1[15] = x32 + out1[16] = x33 + out1[17] = x35 + out1[18] = x37 + out1[19] = x39 + out1[20] = x41 + out1[21] = x43 + out1[22] = x45 + out1[23] = x46 + out1[24] = x47 + out1[25] = x49 + out1[26] = x51 + out1[27] = x53 + out1[28] = x55 + out1[29] = x57 + out1[30] = x59 + out1[31] = x60 +} + +// fiatScalarFromBytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order. +// +// Preconditions: +// +// 0 ≤ bytes_eval arg1 < m +// +// Postconditions: +// +// eval out1 mod m = bytes_eval arg1 mod m +// 0 ≤ eval out1 < m +// +// Input Bounds: +// +// arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x1f]] +// +// Output Bounds: +// +// out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x1fffffffffffffff]] +func fiatScalarFromBytes(out1 *[4]uint64, arg1 *[32]uint8) { + x1 := (uint64(arg1[31]) << 56) + x2 := (uint64(arg1[30]) << 48) + x3 := (uint64(arg1[29]) << 40) + x4 := (uint64(arg1[28]) << 32) + x5 := (uint64(arg1[27]) << 24) + x6 := (uint64(arg1[26]) << 16) + x7 := (uint64(arg1[25]) << 8) + x8 := arg1[24] + x9 := (uint64(arg1[23]) << 56) + x10 := (uint64(arg1[22]) << 48) + x11 := (uint64(arg1[21]) << 40) + x12 := (uint64(arg1[20]) << 32) + x13 := (uint64(arg1[19]) << 24) + x14 := (uint64(arg1[18]) << 16) + x15 := (uint64(arg1[17]) << 8) + x16 := arg1[16] + x17 := (uint64(arg1[15]) << 56) + x18 := (uint64(arg1[14]) << 48) + x19 := (uint64(arg1[13]) << 40) + x20 := (uint64(arg1[12]) << 32) + x21 := (uint64(arg1[11]) << 24) + x22 := (uint64(arg1[10]) << 16) + x23 := (uint64(arg1[9]) << 8) + x24 := arg1[8] + x25 := (uint64(arg1[7]) << 56) + x26 := (uint64(arg1[6]) << 48) + x27 := (uint64(arg1[5]) << 40) + x28 := (uint64(arg1[4]) << 32) + x29 := (uint64(arg1[3]) << 24) + x30 := (uint64(arg1[2]) << 16) + x31 := (uint64(arg1[1]) << 8) + x32 := arg1[0] + x33 := (x31 + uint64(x32)) + x34 := (x30 + x33) + x35 := (x29 + x34) + x36 := (x28 + x35) + x37 := (x27 + x36) + x38 := (x26 + x37) + x39 := (x25 + x38) + x40 := (x23 + uint64(x24)) + x41 := (x22 + x40) + x42 := (x21 + x41) + x43 := (x20 + x42) + x44 := (x19 + x43) + x45 := (x18 + x44) + x46 := (x17 + x45) + x47 := (x15 + uint64(x16)) + x48 := (x14 + x47) + x49 := (x13 + x48) + x50 := (x12 + x49) + x51 := (x11 + x50) + x52 := (x10 + x51) + x53 := (x9 + x52) + x54 := (x7 + uint64(x8)) + x55 := (x6 + x54) + x56 := (x5 + x55) + x57 := (x4 + x56) + x58 := (x3 + x57) + x59 := (x2 + x58) + x60 := (x1 + x59) + out1[0] = x39 + out1[1] = x46 + out1[2] = x53 + out1[3] = x60 +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_test.go new file mode 100644 index 0000000..05551ef --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalar_test.go @@ -0,0 +1,255 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "bytes" + "encoding/hex" + "math/big" + mathrand "math/rand" + "reflect" + "testing" + "testing/quick" +) + +// quickCheckConfig returns a quick.Config that scales the max count by the +// given factor if the -short flag is not set. +func quickCheckConfig(slowScale int) *quick.Config { + cfg := new(quick.Config) + if !testing.Short() { + cfg.MaxCountScale = float64(slowScale) + } + return cfg +} + +var scOneBytes = [32]byte{1} +var scOne, _ = new(Scalar).SetCanonicalBytes(scOneBytes[:]) +var scMinusOne, _ = new(Scalar).SetCanonicalBytes(scalarMinusOneBytes[:]) + +// Generate returns a valid (reduced modulo l) Scalar with a distribution +// weighted towards high, low, and edge values. +func (Scalar) Generate(rand *mathrand.Rand, size int) reflect.Value { + var s [32]byte + diceRoll := rand.Intn(100) + switch { + case diceRoll == 0: + case diceRoll == 1: + s = scOneBytes + case diceRoll == 2: + s = scalarMinusOneBytes + case diceRoll < 5: + // Generate a low scalar in [0, 2^125). + rand.Read(s[:16]) + s[15] &= (1 << 5) - 1 + case diceRoll < 10: + // Generate a high scalar in [2^252, 2^252 + 2^124). + s[31] = 1 << 4 + rand.Read(s[:16]) + s[15] &= (1 << 4) - 1 + default: + // Generate a valid scalar in [0, l) by returning [0, 2^252) which has a + // negligibly different distribution (the former has a 2^-127.6 chance + // of being out of the latter range). + rand.Read(s[:]) + s[31] &= (1 << 4) - 1 + } + + val := Scalar{} + fiatScalarFromBytes((*[4]uint64)(&val.s), &s) + fiatScalarToMontgomery(&val.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&val.s)) + + return reflect.ValueOf(val) +} + +func TestScalarGenerate(t *testing.T) { + f := func(sc Scalar) bool { + return isReduced(sc.Bytes()) + } + if err := quick.Check(f, quickCheckConfig(1024)); err != nil { + t.Errorf("generated unreduced scalar: %v", err) + } +} + +func TestScalarSetCanonicalBytes(t *testing.T) { + f1 := func(in [32]byte, sc Scalar) bool { + // Mask out top 4 bits to guarantee value falls in [0, l). + in[len(in)-1] &= (1 << 4) - 1 + if _, err := sc.SetCanonicalBytes(in[:]); err != nil { + return false + } + repr := sc.Bytes() + return bytes.Equal(in[:], repr) && isReduced(repr) + } + if err := quick.Check(f1, quickCheckConfig(1024)); err != nil { + t.Errorf("failed bytes->scalar->bytes round-trip: %v", err) + } + + f2 := func(sc1, sc2 Scalar) bool { + if _, err := sc2.SetCanonicalBytes(sc1.Bytes()); err != nil { + return false + } + return sc1 == sc2 + } + if err := quick.Check(f2, quickCheckConfig(1024)); err != nil { + t.Errorf("failed scalar->bytes->scalar round-trip: %v", err) + } + + b := scalarMinusOneBytes + b[31] += 1 + s := scOne + if out, err := s.SetCanonicalBytes(b[:]); err == nil { + t.Errorf("SetCanonicalBytes worked on a non-canonical value") + } else if s != scOne { + t.Errorf("SetCanonicalBytes modified its receiver") + } else if out != nil { + t.Errorf("SetCanonicalBytes did not return nil with an error") + } +} + +func TestScalarSetUniformBytes(t *testing.T) { + mod, _ := new(big.Int).SetString("27742317777372353535851937790883648493", 10) + mod.Add(mod, new(big.Int).Lsh(big.NewInt(1), 252)) + f := func(in [64]byte, sc Scalar) bool { + sc.SetUniformBytes(in[:]) + repr := sc.Bytes() + if !isReduced(repr) { + return false + } + scBig := bigIntFromLittleEndianBytes(repr[:]) + inBig := bigIntFromLittleEndianBytes(in[:]) + return inBig.Mod(inBig, mod).Cmp(scBig) == 0 + } + if err := quick.Check(f, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func TestScalarSetBytesWithClamping(t *testing.T) { + // Generated with libsodium.js 1.0.18 crypto_scalarmult_ed25519_base. + + random := "633d368491364dc9cd4c1bf891b1d59460face1644813240a313e61f2c88216e" + s, _ := new(Scalar).SetBytesWithClamping(decodeHex(random)) + p := new(Point).ScalarBaseMult(s) + want := "1d87a9026fd0126a5736fe1628c95dd419172b5b618457e041c9c861b2494a94" + if got := hex.EncodeToString(p.Bytes()); got != want { + t.Errorf("random: got %q, want %q", got, want) + } + + zero := "0000000000000000000000000000000000000000000000000000000000000000" + s, _ = new(Scalar).SetBytesWithClamping(decodeHex(zero)) + p = new(Point).ScalarBaseMult(s) + want = "693e47972caf527c7883ad1b39822f026f47db2ab0e1919955b8993aa04411d1" + if got := hex.EncodeToString(p.Bytes()); got != want { + t.Errorf("zero: got %q, want %q", got, want) + } + + one := "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + s, _ = new(Scalar).SetBytesWithClamping(decodeHex(one)) + p = new(Point).ScalarBaseMult(s) + want = "12e9a68b73fd5aacdbcaf3e88c46fea6ebedb1aa84eed1842f07f8edab65e3a7" + if got := hex.EncodeToString(p.Bytes()); got != want { + t.Errorf("one: got %q, want %q", got, want) + } +} + +func bigIntFromLittleEndianBytes(b []byte) *big.Int { + bb := make([]byte, len(b)) + for i := range b { + bb[i] = b[len(b)-i-1] + } + return new(big.Int).SetBytes(bb) +} + +func TestScalarMultiplyDistributesOverAdd(t *testing.T) { + multiplyDistributesOverAdd := func(x, y, z Scalar) bool { + // Compute t1 = (x+y)*z + var t1 Scalar + t1.Add(&x, &y) + t1.Multiply(&t1, &z) + + // Compute t2 = x*z + y*z + var t2 Scalar + var t3 Scalar + t2.Multiply(&x, &z) + t3.Multiply(&y, &z) + t2.Add(&t2, &t3) + + reprT1, reprT2 := t1.Bytes(), t2.Bytes() + + return t1 == t2 && isReduced(reprT1) && isReduced(reprT2) + } + + if err := quick.Check(multiplyDistributesOverAdd, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func TestScalarAddLikeSubNeg(t *testing.T) { + addLikeSubNeg := func(x, y Scalar) bool { + // Compute t1 = x - y + var t1 Scalar + t1.Subtract(&x, &y) + + // Compute t2 = -y + x + var t2 Scalar + t2.Negate(&y) + t2.Add(&t2, &x) + + return t1 == t2 && isReduced(t1.Bytes()) + } + + if err := quick.Check(addLikeSubNeg, quickCheckConfig(1024)); err != nil { + t.Error(err) + } +} + +func TestScalarNonAdjacentForm(t *testing.T) { + s, _ := (&Scalar{}).SetCanonicalBytes([]byte{ + 0x1a, 0x0e, 0x97, 0x8a, 0x90, 0xf6, 0x62, 0x2d, + 0x37, 0x47, 0x02, 0x3f, 0x8a, 0xd8, 0x26, 0x4d, + 0xa7, 0x58, 0xaa, 0x1b, 0x88, 0xe0, 0x40, 0xd1, + 0x58, 0x9e, 0x7b, 0x7f, 0x23, 0x76, 0xef, 0x09, + }) + + expectedNaf := [256]int8{ + 0, 13, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, -11, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 9, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, + -9, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 9, 0, + 0, 0, 0, -15, 0, 0, 0, 0, -7, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, -3, 0, + 0, 0, 0, -11, 0, 0, 0, 0, -7, 0, 0, 0, 0, -13, 0, 0, 0, 0, 11, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, -15, 0, 0, 0, 0, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 0, 0, 0, 11, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 0, 0, -15, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + } + + sNaf := s.nonAdjacentForm(5) + + for i := 0; i < 256; i++ { + if expectedNaf[i] != sNaf[i] { + t.Errorf("Wrong digit at position %d, got %d, expected %d", i, sNaf[i], expectedNaf[i]) + } + } +} + +type notZeroScalar Scalar + +func (notZeroScalar) Generate(rand *mathrand.Rand, size int) reflect.Value { + var s Scalar + var isNonZero uint64 + for isNonZero == 0 { + s = Scalar{}.Generate(rand, size).Interface().(Scalar) + fiatScalarNonzero(&isNonZero, (*[4]uint64)(&s.s)) + } + return reflect.ValueOf(notZeroScalar(s)) +} + +func TestScalarEqual(t *testing.T) { + if scOne.Equal(scMinusOne) == 1 { + t.Errorf("scOne.Equal(&scMinusOne) is true") + } + if scMinusOne.Equal(scMinusOne) == 0 { + t.Errorf("scMinusOne.Equal(&scMinusOne) is false") + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult.go new file mode 100644 index 0000000..f7ca3ce --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult.go @@ -0,0 +1,214 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import "sync" + +// basepointTable is a set of 32 affineLookupTables, where table i is generated +// from 256i * basepoint. It is precomputed the first time it's used. +func basepointTable() *[32]affineLookupTable { + basepointTablePrecomp.initOnce.Do(func() { + p := NewGeneratorPoint() + for i := 0; i < 32; i++ { + basepointTablePrecomp.table[i].FromP3(p) + for j := 0; j < 8; j++ { + p.Add(p, p) + } + } + }) + return &basepointTablePrecomp.table +} + +var basepointTablePrecomp struct { + table [32]affineLookupTable + initOnce sync.Once +} + +// ScalarBaseMult sets v = x * B, where B is the canonical generator, and +// returns v. +// +// The scalar multiplication is done in constant time. +func (v *Point) ScalarBaseMult(x *Scalar) *Point { + basepointTable := basepointTable() + + // Write x = sum(x_i * 16^i) so x*B = sum( B*x_i*16^i ) + // as described in the Ed25519 paper + // + // Group even and odd coefficients + // x*B = x_0*16^0*B + x_2*16^2*B + ... + x_62*16^62*B + // + x_1*16^1*B + x_3*16^3*B + ... + x_63*16^63*B + // x*B = x_0*16^0*B + x_2*16^2*B + ... + x_62*16^62*B + // + 16*( x_1*16^0*B + x_3*16^2*B + ... + x_63*16^62*B) + // + // We use a lookup table for each i to get x_i*16^(2*i)*B + // and do four doublings to multiply by 16. + digits := x.signedRadix16() + + multiple := &affineCached{} + tmp1 := &projP1xP1{} + tmp2 := &projP2{} + + // Accumulate the odd components first + v.Set(NewIdentityPoint()) + for i := 1; i < 64; i += 2 { + basepointTable[i/2].SelectInto(multiple, digits[i]) + tmp1.AddAffine(v, multiple) + v.fromP1xP1(tmp1) + } + + // Multiply by 16 + tmp2.FromP3(v) // tmp2 = v in P2 coords + tmp1.Double(tmp2) // tmp1 = 2*v in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 2*v in P2 coords + tmp1.Double(tmp2) // tmp1 = 4*v in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 4*v in P2 coords + tmp1.Double(tmp2) // tmp1 = 8*v in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 8*v in P2 coords + tmp1.Double(tmp2) // tmp1 = 16*v in P1xP1 coords + v.fromP1xP1(tmp1) // now v = 16*(odd components) + + // Accumulate the even components + for i := 0; i < 64; i += 2 { + basepointTable[i/2].SelectInto(multiple, digits[i]) + tmp1.AddAffine(v, multiple) + v.fromP1xP1(tmp1) + } + + return v +} + +// ScalarMult sets v = x * q, and returns v. +// +// The scalar multiplication is done in constant time. +func (v *Point) ScalarMult(x *Scalar, q *Point) *Point { + checkInitialized(q) + + var table projLookupTable + table.FromP3(q) + + // Write x = sum(x_i * 16^i) + // so x*Q = sum( Q*x_i*16^i ) + // = Q*x_0 + 16*(Q*x_1 + 16*( ... + Q*x_63) ... ) + // <------compute inside out--------- + // + // We use the lookup table to get the x_i*Q values + // and do four doublings to compute 16*Q + digits := x.signedRadix16() + + // Unwrap first loop iteration to save computing 16*identity + multiple := &projCached{} + tmp1 := &projP1xP1{} + tmp2 := &projP2{} + table.SelectInto(multiple, digits[63]) + + v.Set(NewIdentityPoint()) + tmp1.Add(v, multiple) // tmp1 = x_63*Q in P1xP1 coords + for i := 62; i >= 0; i-- { + tmp2.FromP1xP1(tmp1) // tmp2 = (prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 2*(prev) in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 2*(prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 4*(prev) in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 4*(prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 8*(prev) in P1xP1 coords + tmp2.FromP1xP1(tmp1) // tmp2 = 8*(prev) in P2 coords + tmp1.Double(tmp2) // tmp1 = 16*(prev) in P1xP1 coords + v.fromP1xP1(tmp1) // v = 16*(prev) in P3 coords + table.SelectInto(multiple, digits[i]) + tmp1.Add(v, multiple) // tmp1 = x_i*Q + 16*(prev) in P1xP1 coords + } + v.fromP1xP1(tmp1) + return v +} + +// basepointNafTable is the nafLookupTable8 for the basepoint. +// It is precomputed the first time it's used. +func basepointNafTable() *nafLookupTable8 { + basepointNafTablePrecomp.initOnce.Do(func() { + basepointNafTablePrecomp.table.FromP3(NewGeneratorPoint()) + }) + return &basepointNafTablePrecomp.table +} + +var basepointNafTablePrecomp struct { + table nafLookupTable8 + initOnce sync.Once +} + +// VarTimeDoubleScalarBaseMult sets v = a * A + b * B, where B is the canonical +// generator, and returns v. +// +// Execution time depends on the inputs. +func (v *Point) VarTimeDoubleScalarBaseMult(a *Scalar, A *Point, b *Scalar) *Point { + checkInitialized(A) + + // Similarly to the single variable-base approach, we compute + // digits and use them with a lookup table. However, because + // we are allowed to do variable-time operations, we don't + // need constant-time lookups or constant-time digit + // computations. + // + // So we use a non-adjacent form of some width w instead of + // radix 16. This is like a binary representation (one digit + // for each binary place) but we allow the digits to grow in + // magnitude up to 2^{w-1} so that the nonzero digits are as + // sparse as possible. Intuitively, this "condenses" the + // "mass" of the scalar onto sparse coefficients (meaning + // fewer additions). + + basepointNafTable := basepointNafTable() + var aTable nafLookupTable5 + aTable.FromP3(A) + // Because the basepoint is fixed, we can use a wider NAF + // corresponding to a bigger table. + aNaf := a.nonAdjacentForm(5) + bNaf := b.nonAdjacentForm(8) + + // Find the first nonzero coefficient. + i := 255 + for j := i; j >= 0; j-- { + if aNaf[j] != 0 || bNaf[j] != 0 { + break + } + } + + multA := &projCached{} + multB := &affineCached{} + tmp1 := &projP1xP1{} + tmp2 := &projP2{} + tmp2.Zero() + + // Move from high to low bits, doubling the accumulator + // at each iteration and checking whether there is a nonzero + // coefficient to look up a multiple of. + for ; i >= 0; i-- { + tmp1.Double(tmp2) + + // Only update v if we have a nonzero coeff to add in. + if aNaf[i] > 0 { + v.fromP1xP1(tmp1) + aTable.SelectInto(multA, aNaf[i]) + tmp1.Add(v, multA) + } else if aNaf[i] < 0 { + v.fromP1xP1(tmp1) + aTable.SelectInto(multA, -aNaf[i]) + tmp1.Sub(v, multA) + } + + if bNaf[i] > 0 { + v.fromP1xP1(tmp1) + basepointNafTable.SelectInto(multB, bNaf[i]) + tmp1.AddAffine(v, multB) + } else if bNaf[i] < 0 { + v.fromP1xP1(tmp1) + basepointNafTable.SelectInto(multB, -bNaf[i]) + tmp1.SubAffine(v, multB) + } + + tmp2.FromP1xP1(tmp1) + } + + v.fromP2(tmp2) + return v +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult_test.go new file mode 100644 index 0000000..4a00c79 --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/scalarmult_test.go @@ -0,0 +1,205 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "testing" + "testing/quick" +) + +var ( + // a random scalar generated using dalek. + dalekScalar, _ = (&Scalar{}).SetCanonicalBytes([]byte{219, 106, 114, 9, 174, 249, 155, 89, 69, 203, 201, 93, 92, 116, 234, 187, 78, 115, 103, 172, 182, 98, 62, 103, 187, 136, 13, 100, 248, 110, 12, 4}) + // the above, times the edwards25519 basepoint. + dalekScalarBasepoint, _ = new(Point).SetBytes([]byte{0xf4, 0xef, 0x7c, 0xa, 0x34, 0x55, 0x7b, 0x9f, 0x72, 0x3b, 0xb6, 0x1e, 0xf9, 0x46, 0x9, 0x91, 0x1c, 0xb9, 0xc0, 0x6c, 0x17, 0x28, 0x2d, 0x8b, 0x43, 0x2b, 0x5, 0x18, 0x6a, 0x54, 0x3e, 0x48}) +) + +func TestScalarMultSmallScalars(t *testing.T) { + var z Scalar + var p Point + p.ScalarMult(&z, B) + if I.Equal(&p) != 1 { + t.Error("0*B != 0") + } + checkOnCurve(t, &p) + + scEight, _ := (&Scalar{}).SetCanonicalBytes([]byte{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) + p.ScalarMult(scEight, B) + if B.Equal(&p) != 1 { + t.Error("1*B != 1") + } + checkOnCurve(t, &p) +} + +func TestScalarMultVsDalek(t *testing.T) { + var p Point + p.ScalarMult(dalekScalar, B) + if dalekScalarBasepoint.Equal(&p) != 1 { + t.Error("Scalar mul does not match dalek") + } + checkOnCurve(t, &p) +} + +func TestBaseMultVsDalek(t *testing.T) { + var p Point + p.ScalarBaseMult(dalekScalar) + if dalekScalarBasepoint.Equal(&p) != 1 { + t.Error("Scalar mul does not match dalek") + } + checkOnCurve(t, &p) +} + +func TestVarTimeDoubleBaseMultVsDalek(t *testing.T) { + var p Point + var z Scalar + p.VarTimeDoubleScalarBaseMult(dalekScalar, B, &z) + if dalekScalarBasepoint.Equal(&p) != 1 { + t.Error("VarTimeDoubleScalarBaseMult fails with b=0") + } + checkOnCurve(t, &p) + p.VarTimeDoubleScalarBaseMult(&z, B, dalekScalar) + if dalekScalarBasepoint.Equal(&p) != 1 { + t.Error("VarTimeDoubleScalarBaseMult fails with a=0") + } + checkOnCurve(t, &p) +} + +func TestScalarMultDistributesOverAdd(t *testing.T) { + scalarMultDistributesOverAdd := func(x, y Scalar) bool { + var z Scalar + z.Add(&x, &y) + var p, q, r, check Point + p.ScalarMult(&x, B) + q.ScalarMult(&y, B) + r.ScalarMult(&z, B) + check.Add(&p, &q) + checkOnCurve(t, &p, &q, &r, &check) + return check.Equal(&r) == 1 + } + + if err := quick.Check(scalarMultDistributesOverAdd, quickCheckConfig(32)); err != nil { + t.Error(err) + } +} + +func TestScalarMultNonIdentityPoint(t *testing.T) { + // Check whether p.ScalarMult and q.ScalaBaseMult give the same, + // when p and q are originally set to the base point. + + scalarMultNonIdentityPoint := func(x Scalar) bool { + var p, q Point + p.Set(B) + q.Set(B) + + p.ScalarMult(&x, B) + q.ScalarBaseMult(&x) + + checkOnCurve(t, &p, &q) + + return p.Equal(&q) == 1 + } + + if err := quick.Check(scalarMultNonIdentityPoint, quickCheckConfig(32)); err != nil { + t.Error(err) + } +} + +func TestBasepointTableGeneration(t *testing.T) { + // The basepoint table is 32 affineLookupTables, + // corresponding to (16^2i)*B for table i. + basepointTable := basepointTable() + + tmp1 := &projP1xP1{} + tmp2 := &projP2{} + tmp3 := &Point{} + tmp3.Set(B) + table := make([]affineLookupTable, 32) + for i := 0; i < 32; i++ { + // Build the table + table[i].FromP3(tmp3) + // Assert equality with the hardcoded one + if table[i] != basepointTable[i] { + t.Errorf("Basepoint table %d does not match", i) + } + + // Set p = (16^2)*p = 256*p = 2^8*p + tmp2.FromP3(tmp3) + for j := 0; j < 7; j++ { + tmp1.Double(tmp2) + tmp2.FromP1xP1(tmp1) + } + tmp1.Double(tmp2) + tmp3.fromP1xP1(tmp1) + checkOnCurve(t, tmp3) + } +} + +func TestScalarMultMatchesBaseMult(t *testing.T) { + scalarMultMatchesBaseMult := func(x Scalar) bool { + var p, q Point + p.ScalarMult(&x, B) + q.ScalarBaseMult(&x) + checkOnCurve(t, &p, &q) + return p.Equal(&q) == 1 + } + + if err := quick.Check(scalarMultMatchesBaseMult, quickCheckConfig(32)); err != nil { + t.Error(err) + } +} + +func TestBasepointNafTableGeneration(t *testing.T) { + var table nafLookupTable8 + table.FromP3(B) + + if table != *basepointNafTable() { + t.Error("BasepointNafTable does not match") + } +} + +func TestVarTimeDoubleBaseMultMatchesBaseMult(t *testing.T) { + varTimeDoubleBaseMultMatchesBaseMult := func(x, y Scalar) bool { + var p, q1, q2, check Point + + p.VarTimeDoubleScalarBaseMult(&x, B, &y) + + q1.ScalarBaseMult(&x) + q2.ScalarBaseMult(&y) + check.Add(&q1, &q2) + + checkOnCurve(t, &p, &check, &q1, &q2) + return p.Equal(&check) == 1 + } + + if err := quick.Check(varTimeDoubleBaseMultMatchesBaseMult, quickCheckConfig(32)); err != nil { + t.Error(err) + } +} + +// Benchmarks. + +func BenchmarkScalarBaseMult(b *testing.B) { + var p Point + + for i := 0; i < b.N; i++ { + p.ScalarBaseMult(dalekScalar) + } +} + +func BenchmarkScalarMult(b *testing.B) { + var p Point + + for i := 0; i < b.N; i++ { + p.ScalarMult(dalekScalar, B) + } +} + +func BenchmarkVarTimeDoubleScalarBaseMult(b *testing.B) { + var p Point + + for i := 0; i < b.N; i++ { + p.VarTimeDoubleScalarBaseMult(dalekScalar, B, dalekScalar) + } +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables.go new file mode 100644 index 0000000..83234bb --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables.go @@ -0,0 +1,129 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "crypto/subtle" +) + +// A dynamic lookup table for variable-base, constant-time scalar muls. +type projLookupTable struct { + points [8]projCached +} + +// A precomputed lookup table for fixed-base, constant-time scalar muls. +type affineLookupTable struct { + points [8]affineCached +} + +// A dynamic lookup table for variable-base, variable-time scalar muls. +type nafLookupTable5 struct { + points [8]projCached +} + +// A precomputed lookup table for fixed-base, variable-time scalar muls. +type nafLookupTable8 struct { + points [64]affineCached +} + +// Constructors. + +// Builds a lookup table at runtime. Fast. +func (v *projLookupTable) FromP3(q *Point) { + // Goal: v.points[i] = (i+1)*Q, i.e., Q, 2Q, ..., 8Q + // This allows lookup of -8Q, ..., -Q, 0, Q, ..., 8Q + v.points[0].FromP3(q) + tmpP3 := Point{} + tmpP1xP1 := projP1xP1{} + for i := 0; i < 7; i++ { + // Compute (i+1)*Q as Q + i*Q and convert to a projCached + // This is needlessly complicated because the API has explicit + // receivers instead of creating stack objects and relying on RVO + v.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(q, &v.points[i]))) + } +} + +// This is not optimised for speed; fixed-base tables should be precomputed. +func (v *affineLookupTable) FromP3(q *Point) { + // Goal: v.points[i] = (i+1)*Q, i.e., Q, 2Q, ..., 8Q + // This allows lookup of -8Q, ..., -Q, 0, Q, ..., 8Q + v.points[0].FromP3(q) + tmpP3 := Point{} + tmpP1xP1 := projP1xP1{} + for i := 0; i < 7; i++ { + // Compute (i+1)*Q as Q + i*Q and convert to affineCached + v.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(q, &v.points[i]))) + } +} + +// Builds a lookup table at runtime. Fast. +func (v *nafLookupTable5) FromP3(q *Point) { + // Goal: v.points[i] = (2*i+1)*Q, i.e., Q, 3Q, 5Q, ..., 15Q + // This allows lookup of -15Q, ..., -3Q, -Q, 0, Q, 3Q, ..., 15Q + v.points[0].FromP3(q) + q2 := Point{} + q2.Add(q, q) + tmpP3 := Point{} + tmpP1xP1 := projP1xP1{} + for i := 0; i < 7; i++ { + v.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(&q2, &v.points[i]))) + } +} + +// This is not optimised for speed; fixed-base tables should be precomputed. +func (v *nafLookupTable8) FromP3(q *Point) { + v.points[0].FromP3(q) + q2 := Point{} + q2.Add(q, q) + tmpP3 := Point{} + tmpP1xP1 := projP1xP1{} + for i := 0; i < 63; i++ { + v.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(&q2, &v.points[i]))) + } +} + +// Selectors. + +// Set dest to x*Q, where -8 <= x <= 8, in constant time. +func (v *projLookupTable) SelectInto(dest *projCached, x int8) { + // Compute xabs = |x| + xmask := x >> 7 + xabs := uint8((x + xmask) ^ xmask) + + dest.Zero() + for j := 1; j <= 8; j++ { + // Set dest = j*Q if |x| = j + cond := subtle.ConstantTimeByteEq(xabs, uint8(j)) + dest.Select(&v.points[j-1], dest, cond) + } + // Now dest = |x|*Q, conditionally negate to get x*Q + dest.CondNeg(int(xmask & 1)) +} + +// Set dest to x*Q, where -8 <= x <= 8, in constant time. +func (v *affineLookupTable) SelectInto(dest *affineCached, x int8) { + // Compute xabs = |x| + xmask := x >> 7 + xabs := uint8((x + xmask) ^ xmask) + + dest.Zero() + for j := 1; j <= 8; j++ { + // Set dest = j*Q if |x| = j + cond := subtle.ConstantTimeByteEq(xabs, uint8(j)) + dest.Select(&v.points[j-1], dest, cond) + } + // Now dest = |x|*Q, conditionally negate to get x*Q + dest.CondNeg(int(xmask & 1)) +} + +// Given odd x with 0 < x < 2^4, return x*Q (in variable time). +func (v *nafLookupTable5) SelectInto(dest *projCached, x int8) { + *dest = v.points[x/2] +} + +// Given odd x with 0 < x < 2^7, return x*Q (in variable time). +func (v *nafLookupTable8) SelectInto(dest *affineCached, x int8) { + *dest = v.points[x/2] +} diff --git a/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables_test.go b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables_test.go new file mode 100644 index 0000000..b5d161a --- /dev/null +++ b/dependencies/pkg/mod/filippo.io/edwards25519@v1.1.0/tables_test.go @@ -0,0 +1,119 @@ +// Copyright (c) 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package edwards25519 + +import ( + "testing" +) + +func TestProjLookupTable(t *testing.T) { + var table projLookupTable + table.FromP3(B) + + var tmp1, tmp2, tmp3 projCached + table.SelectInto(&tmp1, 6) + table.SelectInto(&tmp2, -2) + table.SelectInto(&tmp3, -4) + // Expect T1 + T2 + T3 = identity + + var accP1xP1 projP1xP1 + accP3 := NewIdentityPoint() + + accP1xP1.Add(accP3, &tmp1) + accP3.fromP1xP1(&accP1xP1) + accP1xP1.Add(accP3, &tmp2) + accP3.fromP1xP1(&accP1xP1) + accP1xP1.Add(accP3, &tmp3) + accP3.fromP1xP1(&accP1xP1) + + if accP3.Equal(I) != 1 { + t.Errorf("Consistency check on ProjLookupTable.SelectInto failed! %x %x %x", tmp1, tmp2, tmp3) + } +} + +func TestAffineLookupTable(t *testing.T) { + var table affineLookupTable + table.FromP3(B) + + var tmp1, tmp2, tmp3 affineCached + table.SelectInto(&tmp1, 3) + table.SelectInto(&tmp2, -7) + table.SelectInto(&tmp3, 4) + // Expect T1 + T2 + T3 = identity + + var accP1xP1 projP1xP1 + accP3 := NewIdentityPoint() + + accP1xP1.AddAffine(accP3, &tmp1) + accP3.fromP1xP1(&accP1xP1) + accP1xP1.AddAffine(accP3, &tmp2) + accP3.fromP1xP1(&accP1xP1) + accP1xP1.AddAffine(accP3, &tmp3) + accP3.fromP1xP1(&accP1xP1) + + if accP3.Equal(I) != 1 { + t.Errorf("Consistency check on ProjLookupTable.SelectInto failed! %x %x %x", tmp1, tmp2, tmp3) + } +} + +func TestNafLookupTable5(t *testing.T) { + var table nafLookupTable5 + table.FromP3(B) + + var tmp1, tmp2, tmp3, tmp4 projCached + table.SelectInto(&tmp1, 9) + table.SelectInto(&tmp2, 11) + table.SelectInto(&tmp3, 7) + table.SelectInto(&tmp4, 13) + // Expect T1 + T2 = T3 + T4 + + var accP1xP1 projP1xP1 + lhs := NewIdentityPoint() + rhs := NewIdentityPoint() + + accP1xP1.Add(lhs, &tmp1) + lhs.fromP1xP1(&accP1xP1) + accP1xP1.Add(lhs, &tmp2) + lhs.fromP1xP1(&accP1xP1) + + accP1xP1.Add(rhs, &tmp3) + rhs.fromP1xP1(&accP1xP1) + accP1xP1.Add(rhs, &tmp4) + rhs.fromP1xP1(&accP1xP1) + + if lhs.Equal(rhs) != 1 { + t.Errorf("Consistency check on nafLookupTable5 failed") + } +} + +func TestNafLookupTable8(t *testing.T) { + var table nafLookupTable8 + table.FromP3(B) + + var tmp1, tmp2, tmp3, tmp4 affineCached + table.SelectInto(&tmp1, 49) + table.SelectInto(&tmp2, 11) + table.SelectInto(&tmp3, 35) + table.SelectInto(&tmp4, 25) + // Expect T1 + T2 = T3 + T4 + + var accP1xP1 projP1xP1 + lhs := NewIdentityPoint() + rhs := NewIdentityPoint() + + accP1xP1.AddAffine(lhs, &tmp1) + lhs.fromP1xP1(&accP1xP1) + accP1xP1.AddAffine(lhs, &tmp2) + lhs.fromP1xP1(&accP1xP1) + + accP1xP1.AddAffine(rhs, &tmp3) + rhs.fromP1xP1(&accP1xP1) + accP1xP1.AddAffine(rhs, &tmp4) + rhs.fromP1xP1(&accP1xP1) + + if lhs.Equal(rhs) != 1 { + t.Errorf("Consistency check on nafLookupTable8 failed") + } +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/.github/workflows/test.yml b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/.github/workflows/test.yml deleted file mode 100644 index 606cf83..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/.github/workflows/test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test - -on: - push: - branches: [main] - pull_request: - -jobs: - test: - strategy: - matrix: - go-version: [1.16.x, 1.17.x] - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Install go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - - name: Check out code - uses: actions/checkout@v2 - - - name: Test - run: go test -count 1 -bench . -benchtime 1x ./... - - - name: Test with -tags purego - run: go test -count 1 -bench . -benchtime 1x -tags purego ./... - -# TODO: Test on other architectures. Unfortunately only amd64 is supported -# by GH Actions. We could use QEMU in the meantime. diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/LICENSE.txt b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/LICENSE.txt deleted file mode 100644 index 24b5306..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2016 Caleb Spare - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/README.md b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/README.md deleted file mode 100644 index 792b4a6..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# xxhash - -[![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2) -[![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml) - -xxhash is a Go implementation of the 64-bit -[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a -high-quality hashing algorithm that is much faster than anything in the Go -standard library. - -This package provides a straightforward API: - -``` -func Sum64(b []byte) uint64 -func Sum64String(s string) uint64 -type Digest struct{ ... } - func New() *Digest -``` - -The `Digest` type implements hash.Hash64. Its key methods are: - -``` -func (*Digest) Write([]byte) (int, error) -func (*Digest) WriteString(string) (int, error) -func (*Digest) Sum64() uint64 -``` - -This implementation provides a fast pure-Go implementation and an even faster -assembly implementation for amd64. - -## Compatibility - -This package is in a module and the latest code is in version 2 of the module. -You need a version of Go with at least "minimal module compatibility" to use -github.com/cespare/xxhash/v2: - -* 1.9.7+ for Go 1.9 -* 1.10.3+ for Go 1.10 -* Go 1.11 or later - -I recommend using the latest release of Go. - -## Benchmarks - -Here are some quick benchmarks comparing the pure-Go and assembly -implementations of Sum64. - -| input size | purego | asm | -| --- | --- | --- | -| 5 B | 979.66 MB/s | 1291.17 MB/s | -| 100 B | 7475.26 MB/s | 7973.40 MB/s | -| 4 KB | 17573.46 MB/s | 17602.65 MB/s | -| 10 MB | 17131.46 MB/s | 17142.16 MB/s | - -These numbers were generated on Ubuntu 18.04 with an Intel i7-8700K CPU using -the following commands under Go 1.11.2: - -``` -$ go test -tags purego -benchtime 10s -bench '/xxhash,direct,bytes' -$ go test -benchtime 10s -bench '/xxhash,direct,bytes' -``` - -## Projects using this package - -- [InfluxDB](https://github.com/influxdata/influxdb) -- [Prometheus](https://github.com/prometheus/prometheus) -- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) -- [FreeCache](https://github.com/coocood/freecache) -- [FastCache](https://github.com/VictoriaMetrics/fastcache) diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/bench_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/bench_test.go deleted file mode 100644 index 4dfeb91..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/bench_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package xxhash - -import ( - "strings" - "testing" -) - -var benchmarks = []struct { - name string - n int64 -}{ - {"4B", 4}, - {"100B", 100}, - {"4KB", 4e3}, - {"10MB", 10e6}, -} - -func BenchmarkSum64(b *testing.B) { - for _, bb := range benchmarks { - in := make([]byte, bb.n) - for i := range in { - in[i] = byte(i) - } - b.Run(bb.name, func(b *testing.B) { - b.SetBytes(bb.n) - for i := 0; i < b.N; i++ { - _ = Sum64(in) - } - }) - } -} - -func BenchmarkSum64String(b *testing.B) { - for _, bb := range benchmarks { - s := strings.Repeat("a", int(bb.n)) - b.Run(bb.name, func(b *testing.B) { - b.SetBytes(bb.n) - for i := 0; i < b.N; i++ { - _ = Sum64String(s) - } - }) - } -} - -func BenchmarkDigestBytes(b *testing.B) { - for _, bb := range benchmarks { - in := make([]byte, bb.n) - for i := range in { - in[i] = byte(i) - } - b.Run(bb.name, func(b *testing.B) { - b.SetBytes(bb.n) - for i := 0; i < b.N; i++ { - h := New() - h.Write(in) - _ = h.Sum64() - } - }) - } -} - -func BenchmarkDigestString(b *testing.B) { - for _, bb := range benchmarks { - s := strings.Repeat("a", int(bb.n)) - b.Run(bb.name, func(b *testing.B) { - b.SetBytes(bb.n) - for i := 0; i < b.N; i++ { - h := New() - h.WriteString(s) - _ = h.Sum64() - } - }) - } -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/.gitignore b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/.gitignore deleted file mode 100644 index 8a84f19..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/plugin.so diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/dynamic_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/dynamic_test.go deleted file mode 100644 index c86bc93..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/dynamic_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build linux darwin - -package main - -import ( - "bytes" - "log" - "os/exec" - "plugin" - "testing" -) - -// This is a cursory test that checks whether things work under dynamic linking. - -func TestMain(m *testing.M) { - cmd := exec.Command( - "go", "build", - "-buildmode", "plugin", - "-o", "plugin.so", - "plugin.go", - ) - var out bytes.Buffer - cmd.Stdout = &out - cmd.Stderr = &out - if err := cmd.Run(); err != nil { - log.Fatalf("Error building plugin: %s\nOutput:\n%s", err, out.String()) - } - m.Run() -} - -func TestDynamic(t *testing.T) { - plug, err := plugin.Open("plugin.so") - if err != nil { - t.Fatal(err) - } - for _, test := range []string{ - "TestSum", - "TestDigest", - } { - f, err := plug.Lookup(test) - if err != nil { - t.Fatalf("cannot find func %s: %s", test, err) - } - f.(func(*testing.T))(t) - } -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/plugin.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/plugin.go deleted file mode 100644 index 319ed71..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/dynamic/plugin.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build ignore - -package main - -import ( - "fmt" - "log" - "testing" - - "github.com/cespare/xxhash/v2" -) - -const ( - in = "Call me Ishmael. Some years ago--never mind how long precisely-" - want = 0x02a2e85470d6fd96 -) - -func TestSum(t *testing.T) { - got := xxhash.Sum64String(in) - if got != want { - t.Fatalf("Sum64String: got 0x%x; want 0x%x", got, want) - } -} - -func TestDigest(t *testing.T) { - for chunkSize := 1; chunkSize <= len(in); chunkSize++ { - name := fmt.Sprintf("[chunkSize=%d]", chunkSize) - t.Run(name, func(t *testing.T) { - d := xxhash.New() - for i := 0; i < len(in); i += chunkSize { - chunk := in[i:] - if len(chunk) > chunkSize { - chunk = chunk[:chunkSize] - } - n, err := d.WriteString(chunk) - if err != nil || n != len(chunk) { - t.Fatalf("Digest.WriteString: got (%d, %v); want (%d, nil)", - n, err, len(chunk)) - } - } - if got := d.Sum64(); got != want { - log.Fatalf("Digest.Sum64: got 0x%x; want 0x%x", got, want) - } - }) - } -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.mod b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.mod deleted file mode 100644 index 49f6760..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/cespare/xxhash/v2 - -go 1.11 diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.sum b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/go.sum deleted file mode 100644 index e69de29..0000000 diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash.go deleted file mode 100644 index 15c835d..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash.go +++ /dev/null @@ -1,235 +0,0 @@ -// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described -// at http://cyan4973.github.io/xxHash/. -package xxhash - -import ( - "encoding/binary" - "errors" - "math/bits" -) - -const ( - prime1 uint64 = 11400714785074694791 - prime2 uint64 = 14029467366897019727 - prime3 uint64 = 1609587929392839161 - prime4 uint64 = 9650029242287828579 - prime5 uint64 = 2870177450012600261 -) - -// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where -// possible in the Go code is worth a small (but measurable) performance boost -// by avoiding some MOVQs. Vars are needed for the asm and also are useful for -// convenience in the Go code in a few places where we need to intentionally -// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the -// result overflows a uint64). -var ( - prime1v = prime1 - prime2v = prime2 - prime3v = prime3 - prime4v = prime4 - prime5v = prime5 -) - -// Digest implements hash.Hash64. -type Digest struct { - v1 uint64 - v2 uint64 - v3 uint64 - v4 uint64 - total uint64 - mem [32]byte - n int // how much of mem is used -} - -// New creates a new Digest that computes the 64-bit xxHash algorithm. -func New() *Digest { - var d Digest - d.Reset() - return &d -} - -// Reset clears the Digest's state so that it can be reused. -func (d *Digest) Reset() { - d.v1 = prime1v + prime2 - d.v2 = prime2 - d.v3 = 0 - d.v4 = -prime1v - d.total = 0 - d.n = 0 -} - -// Size always returns 8 bytes. -func (d *Digest) Size() int { return 8 } - -// BlockSize always returns 32 bytes. -func (d *Digest) BlockSize() int { return 32 } - -// Write adds more data to d. It always returns len(b), nil. -func (d *Digest) Write(b []byte) (n int, err error) { - n = len(b) - d.total += uint64(n) - - if d.n+n < 32 { - // This new data doesn't even fill the current block. - copy(d.mem[d.n:], b) - d.n += n - return - } - - if d.n > 0 { - // Finish off the partial block. - copy(d.mem[d.n:], b) - d.v1 = round(d.v1, u64(d.mem[0:8])) - d.v2 = round(d.v2, u64(d.mem[8:16])) - d.v3 = round(d.v3, u64(d.mem[16:24])) - d.v4 = round(d.v4, u64(d.mem[24:32])) - b = b[32-d.n:] - d.n = 0 - } - - if len(b) >= 32 { - // One or more full blocks left. - nw := writeBlocks(d, b) - b = b[nw:] - } - - // Store any remaining partial block. - copy(d.mem[:], b) - d.n = len(b) - - return -} - -// Sum appends the current hash to b and returns the resulting slice. -func (d *Digest) Sum(b []byte) []byte { - s := d.Sum64() - return append( - b, - byte(s>>56), - byte(s>>48), - byte(s>>40), - byte(s>>32), - byte(s>>24), - byte(s>>16), - byte(s>>8), - byte(s), - ) -} - -// Sum64 returns the current hash. -func (d *Digest) Sum64() uint64 { - var h uint64 - - if d.total >= 32 { - v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 - h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) - h = mergeRound(h, v1) - h = mergeRound(h, v2) - h = mergeRound(h, v3) - h = mergeRound(h, v4) - } else { - h = d.v3 + prime5 - } - - h += d.total - - i, end := 0, d.n - for ; i+8 <= end; i += 8 { - k1 := round(0, u64(d.mem[i:i+8])) - h ^= k1 - h = rol27(h)*prime1 + prime4 - } - if i+4 <= end { - h ^= uint64(u32(d.mem[i:i+4])) * prime1 - h = rol23(h)*prime2 + prime3 - i += 4 - } - for i < end { - h ^= uint64(d.mem[i]) * prime5 - h = rol11(h) * prime1 - i++ - } - - h ^= h >> 33 - h *= prime2 - h ^= h >> 29 - h *= prime3 - h ^= h >> 32 - - return h -} - -const ( - magic = "xxh\x06" - marshaledSize = len(magic) + 8*5 + 32 -) - -// MarshalBinary implements the encoding.BinaryMarshaler interface. -func (d *Digest) MarshalBinary() ([]byte, error) { - b := make([]byte, 0, marshaledSize) - b = append(b, magic...) - b = appendUint64(b, d.v1) - b = appendUint64(b, d.v2) - b = appendUint64(b, d.v3) - b = appendUint64(b, d.v4) - b = appendUint64(b, d.total) - b = append(b, d.mem[:d.n]...) - b = b[:len(b)+len(d.mem)-d.n] - return b, nil -} - -// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. -func (d *Digest) UnmarshalBinary(b []byte) error { - if len(b) < len(magic) || string(b[:len(magic)]) != magic { - return errors.New("xxhash: invalid hash state identifier") - } - if len(b) != marshaledSize { - return errors.New("xxhash: invalid hash state size") - } - b = b[len(magic):] - b, d.v1 = consumeUint64(b) - b, d.v2 = consumeUint64(b) - b, d.v3 = consumeUint64(b) - b, d.v4 = consumeUint64(b) - b, d.total = consumeUint64(b) - copy(d.mem[:], b) - d.n = int(d.total % uint64(len(d.mem))) - return nil -} - -func appendUint64(b []byte, x uint64) []byte { - var a [8]byte - binary.LittleEndian.PutUint64(a[:], x) - return append(b, a[:]...) -} - -func consumeUint64(b []byte) ([]byte, uint64) { - x := u64(b) - return b[8:], x -} - -func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) } -func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) } - -func round(acc, input uint64) uint64 { - acc += input * prime2 - acc = rol31(acc) - acc *= prime1 - return acc -} - -func mergeRound(acc, val uint64) uint64 { - val = round(0, val) - acc ^= val - acc = acc*prime1 + prime4 - return acc -} - -func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) } -func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) } -func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) } -func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) } -func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) } -func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) } -func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) } -func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) } diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.go deleted file mode 100644 index ad14b80..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !appengine -// +build gc -// +build !purego - -package xxhash - -// Sum64 computes the 64-bit xxHash digest of b. -// -//go:noescape -func Sum64(b []byte) uint64 - -//go:noescape -func writeBlocks(d *Digest, b []byte) int diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.s b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.s deleted file mode 100644 index be8db5b..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_amd64.s +++ /dev/null @@ -1,215 +0,0 @@ -// +build !appengine -// +build gc -// +build !purego - -#include "textflag.h" - -// Register allocation: -// AX h -// SI pointer to advance through b -// DX n -// BX loop end -// R8 v1, k1 -// R9 v2 -// R10 v3 -// R11 v4 -// R12 tmp -// R13 prime1v -// R14 prime2v -// DI prime4v - -// round reads from and advances the buffer pointer in SI. -// It assumes that R13 has prime1v and R14 has prime2v. -#define round(r) \ - MOVQ (SI), R12 \ - ADDQ $8, SI \ - IMULQ R14, R12 \ - ADDQ R12, r \ - ROLQ $31, r \ - IMULQ R13, r - -// mergeRound applies a merge round on the two registers acc and val. -// It assumes that R13 has prime1v, R14 has prime2v, and DI has prime4v. -#define mergeRound(acc, val) \ - IMULQ R14, val \ - ROLQ $31, val \ - IMULQ R13, val \ - XORQ val, acc \ - IMULQ R13, acc \ - ADDQ DI, acc - -// func Sum64(b []byte) uint64 -TEXT ·Sum64(SB), NOSPLIT, $0-32 - // Load fixed primes. - MOVQ ·prime1v(SB), R13 - MOVQ ·prime2v(SB), R14 - MOVQ ·prime4v(SB), DI - - // Load slice. - MOVQ b_base+0(FP), SI - MOVQ b_len+8(FP), DX - LEAQ (SI)(DX*1), BX - - // The first loop limit will be len(b)-32. - SUBQ $32, BX - - // Check whether we have at least one block. - CMPQ DX, $32 - JLT noBlocks - - // Set up initial state (v1, v2, v3, v4). - MOVQ R13, R8 - ADDQ R14, R8 - MOVQ R14, R9 - XORQ R10, R10 - XORQ R11, R11 - SUBQ R13, R11 - - // Loop until SI > BX. -blockLoop: - round(R8) - round(R9) - round(R10) - round(R11) - - CMPQ SI, BX - JLE blockLoop - - MOVQ R8, AX - ROLQ $1, AX - MOVQ R9, R12 - ROLQ $7, R12 - ADDQ R12, AX - MOVQ R10, R12 - ROLQ $12, R12 - ADDQ R12, AX - MOVQ R11, R12 - ROLQ $18, R12 - ADDQ R12, AX - - mergeRound(AX, R8) - mergeRound(AX, R9) - mergeRound(AX, R10) - mergeRound(AX, R11) - - JMP afterBlocks - -noBlocks: - MOVQ ·prime5v(SB), AX - -afterBlocks: - ADDQ DX, AX - - // Right now BX has len(b)-32, and we want to loop until SI > len(b)-8. - ADDQ $24, BX - - CMPQ SI, BX - JG fourByte - -wordLoop: - // Calculate k1. - MOVQ (SI), R8 - ADDQ $8, SI - IMULQ R14, R8 - ROLQ $31, R8 - IMULQ R13, R8 - - XORQ R8, AX - ROLQ $27, AX - IMULQ R13, AX - ADDQ DI, AX - - CMPQ SI, BX - JLE wordLoop - -fourByte: - ADDQ $4, BX - CMPQ SI, BX - JG singles - - MOVL (SI), R8 - ADDQ $4, SI - IMULQ R13, R8 - XORQ R8, AX - - ROLQ $23, AX - IMULQ R14, AX - ADDQ ·prime3v(SB), AX - -singles: - ADDQ $4, BX - CMPQ SI, BX - JGE finalize - -singlesLoop: - MOVBQZX (SI), R12 - ADDQ $1, SI - IMULQ ·prime5v(SB), R12 - XORQ R12, AX - - ROLQ $11, AX - IMULQ R13, AX - - CMPQ SI, BX - JL singlesLoop - -finalize: - MOVQ AX, R12 - SHRQ $33, R12 - XORQ R12, AX - IMULQ R14, AX - MOVQ AX, R12 - SHRQ $29, R12 - XORQ R12, AX - IMULQ ·prime3v(SB), AX - MOVQ AX, R12 - SHRQ $32, R12 - XORQ R12, AX - - MOVQ AX, ret+24(FP) - RET - -// writeBlocks uses the same registers as above except that it uses AX to store -// the d pointer. - -// func writeBlocks(d *Digest, b []byte) int -TEXT ·writeBlocks(SB), NOSPLIT, $0-40 - // Load fixed primes needed for round. - MOVQ ·prime1v(SB), R13 - MOVQ ·prime2v(SB), R14 - - // Load slice. - MOVQ b_base+8(FP), SI - MOVQ b_len+16(FP), DX - LEAQ (SI)(DX*1), BX - SUBQ $32, BX - - // Load vN from d. - MOVQ d+0(FP), AX - MOVQ 0(AX), R8 // v1 - MOVQ 8(AX), R9 // v2 - MOVQ 16(AX), R10 // v3 - MOVQ 24(AX), R11 // v4 - - // We don't need to check the loop condition here; this function is - // always called with at least one block of data to process. -blockLoop: - round(R8) - round(R9) - round(R10) - round(R11) - - CMPQ SI, BX - JLE blockLoop - - // Copy vN back to d. - MOVQ R8, 0(AX) - MOVQ R9, 8(AX) - MOVQ R10, 16(AX) - MOVQ R11, 24(AX) - - // The number of bytes written is SI minus the old base pointer. - SUBQ b_base+8(FP), SI - MOVQ SI, ret+32(FP) - - RET diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_other.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_other.go deleted file mode 100644 index 4a5a821..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_other.go +++ /dev/null @@ -1,76 +0,0 @@ -// +build !amd64 appengine !gc purego - -package xxhash - -// Sum64 computes the 64-bit xxHash digest of b. -func Sum64(b []byte) uint64 { - // A simpler version would be - // d := New() - // d.Write(b) - // return d.Sum64() - // but this is faster, particularly for small inputs. - - n := len(b) - var h uint64 - - if n >= 32 { - v1 := prime1v + prime2 - v2 := prime2 - v3 := uint64(0) - v4 := -prime1v - for len(b) >= 32 { - v1 = round(v1, u64(b[0:8:len(b)])) - v2 = round(v2, u64(b[8:16:len(b)])) - v3 = round(v3, u64(b[16:24:len(b)])) - v4 = round(v4, u64(b[24:32:len(b)])) - b = b[32:len(b):len(b)] - } - h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) - h = mergeRound(h, v1) - h = mergeRound(h, v2) - h = mergeRound(h, v3) - h = mergeRound(h, v4) - } else { - h = prime5 - } - - h += uint64(n) - - i, end := 0, len(b) - for ; i+8 <= end; i += 8 { - k1 := round(0, u64(b[i:i+8:len(b)])) - h ^= k1 - h = rol27(h)*prime1 + prime4 - } - if i+4 <= end { - h ^= uint64(u32(b[i:i+4:len(b)])) * prime1 - h = rol23(h)*prime2 + prime3 - i += 4 - } - for ; i < end; i++ { - h ^= uint64(b[i]) * prime5 - h = rol11(h) * prime1 - } - - h ^= h >> 33 - h *= prime2 - h ^= h >> 29 - h *= prime3 - h ^= h >> 32 - - return h -} - -func writeBlocks(d *Digest, b []byte) int { - v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 - n := len(b) - for len(b) >= 32 { - v1 = round(v1, u64(b[0:8:len(b)])) - v2 = round(v2, u64(b[8:16:len(b)])) - v3 = round(v3, u64(b[16:24:len(b)])) - v4 = round(v4, u64(b[24:32:len(b)])) - b = b[32:len(b):len(b)] - } - d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4 - return n - len(b) -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_safe.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_safe.go deleted file mode 100644 index fc9bea7..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_safe.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build appengine - -// This file contains the safe implementations of otherwise unsafe-using code. - -package xxhash - -// Sum64String computes the 64-bit xxHash digest of s. -func Sum64String(s string) uint64 { - return Sum64([]byte(s)) -} - -// WriteString adds more data to d. It always returns len(s), nil. -func (d *Digest) WriteString(s string) (n int, err error) { - return d.Write([]byte(s)) -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_test.go deleted file mode 100644 index 6330f19..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_test.go +++ /dev/null @@ -1,166 +0,0 @@ -package xxhash - -import ( - "bytes" - "encoding/binary" - "fmt" - "strings" - "testing" -) - -func TestAll(t *testing.T) { - for _, tt := range []struct { - name string - input string - want uint64 - }{ - {"empty", "", 0xef46db3751d8e999}, - {"a", "a", 0xd24ec4f1a98c6e5b}, - {"as", "as", 0x1c330fb2d66be179}, - {"asd", "asd", 0x631c37ce72a97393}, - {"asdf", "asdf", 0x415872f599cea71e}, - { - "len=63", - // Exactly 63 characters, which exercises all code paths. - "Call me Ishmael. Some years ago--never mind how long precisely-", - 0x02a2e85470d6fd96, - }, - } { - lastChunkSize := len(tt.input) - if lastChunkSize == 0 { - lastChunkSize = 1 - } - for chunkSize := 1; chunkSize <= lastChunkSize; chunkSize++ { - name := fmt.Sprintf("%s,chunkSize=%d", tt.name, chunkSize) - t.Run(name, func(t *testing.T) { - testDigest(t, tt.input, chunkSize, tt.want) - }) - } - t.Run(tt.name, func(t *testing.T) { testSum(t, tt.input, tt.want) }) - } -} - -func testDigest(t *testing.T, input string, chunkSize int, want uint64) { - d := New() - ds := New() // uses WriteString - for i := 0; i < len(input); i += chunkSize { - chunk := input[i:] - if len(chunk) > chunkSize { - chunk = chunk[:chunkSize] - } - n, err := d.Write([]byte(chunk)) - if err != nil || n != len(chunk) { - t.Fatalf("Digest.Write: got (%d, %v); want (%d, nil)", n, err, len(chunk)) - } - n, err = ds.WriteString(chunk) - if err != nil || n != len(chunk) { - t.Fatalf("Digest.WriteString: got (%d, %v); want (%d, nil)", n, err, len(chunk)) - } - } - if got := d.Sum64(); got != want { - t.Fatalf("Digest.Sum64: got 0x%x; want 0x%x", got, want) - } - if got := ds.Sum64(); got != want { - t.Fatalf("Digest.Sum64 (WriteString): got 0x%x; want 0x%x", got, want) - } - var b [8]byte - binary.BigEndian.PutUint64(b[:], want) - if got := d.Sum(nil); !bytes.Equal(got, b[:]) { - t.Fatalf("Sum: got %v; want %v", got, b[:]) - } -} - -func testSum(t *testing.T, input string, want uint64) { - if got := Sum64([]byte(input)); got != want { - t.Fatalf("Sum64: got 0x%x; want 0x%x", got, want) - } - if got := Sum64String(input); got != want { - t.Fatalf("Sum64String: got 0x%x; want 0x%x", got, want) - } -} - -func TestReset(t *testing.T) { - parts := []string{"The quic", "k br", "o", "wn fox jumps", " ov", "er the lazy ", "dog."} - d := New() - for _, part := range parts { - d.Write([]byte(part)) - } - h0 := d.Sum64() - - d.Reset() - d.Write([]byte(strings.Join(parts, ""))) - h1 := d.Sum64() - - if h0 != h1 { - t.Errorf("0x%x != 0x%x", h0, h1) - } -} - -func TestBinaryMarshaling(t *testing.T) { - d := New() - d.WriteString("abc") - b, err := d.MarshalBinary() - if err != nil { - t.Fatal(err) - } - d = New() - d.WriteString("junk") - if err := d.UnmarshalBinary(b); err != nil { - t.Fatal(err) - } - d.WriteString("def") - if got, want := d.Sum64(), Sum64String("abcdef"); got != want { - t.Fatalf("after MarshalBinary+UnmarshalBinary, got 0x%x; want 0x%x", got, want) - } - - d0 := New() - d1 := New() - for i := 0; i < 64; i++ { - b, err := d0.MarshalBinary() - if err != nil { - t.Fatal(err) - } - d0 = new(Digest) - if err := d0.UnmarshalBinary(b); err != nil { - t.Fatal(err) - } - if got, want := d0.Sum64(), d1.Sum64(); got != want { - t.Fatalf("after %d Writes, unmarshaled Digest gave sum 0x%x; want 0x%x", i, got, want) - } - - d0.Write([]byte{'a'}) - d1.Write([]byte{'a'}) - } -} - -var sink uint64 - -func TestAllocs(t *testing.T) { - const shortStr = "abcdefghijklmnop" - // Sum64([]byte(shortString)) shouldn't allocate because the - // intermediate []byte ought not to escape. - // (See https://github.com/cespare/xxhash/pull/2.) - t.Run("Sum64", func(t *testing.T) { - testAllocs(t, func() { - sink = Sum64([]byte(shortStr)) - }) - }) - // Creating and using a Digest shouldn't allocate because its methods - // shouldn't make it escape. (A previous version of New returned a - // hash.Hash64 which forces an allocation.) - t.Run("Digest", func(t *testing.T) { - b := []byte("asdf") - testAllocs(t, func() { - d := New() - d.Write(b) - sink = d.Sum64() - }) - }) -} - -func testAllocs(t *testing.T, fn func()) { - t.Helper() - if allocs := int(testing.AllocsPerRun(10, fn)); allocs > 0 { - t.Fatalf("got %d allocation(s) (want zero)", allocs) - } -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe.go deleted file mode 100644 index 376e0ca..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe.go +++ /dev/null @@ -1,57 +0,0 @@ -// +build !appengine - -// This file encapsulates usage of unsafe. -// xxhash_safe.go contains the safe implementations. - -package xxhash - -import ( - "unsafe" -) - -// In the future it's possible that compiler optimizations will make these -// XxxString functions unnecessary by realizing that calls such as -// Sum64([]byte(s)) don't need to copy s. See https://golang.org/issue/2205. -// If that happens, even if we keep these functions they can be replaced with -// the trivial safe code. - -// NOTE: The usual way of doing an unsafe string-to-[]byte conversion is: -// -// var b []byte -// bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) -// bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data -// bh.Len = len(s) -// bh.Cap = len(s) -// -// Unfortunately, as of Go 1.15.3 the inliner's cost model assigns a high enough -// weight to this sequence of expressions that any function that uses it will -// not be inlined. Instead, the functions below use a different unsafe -// conversion designed to minimize the inliner weight and allow both to be -// inlined. There is also a test (TestInlining) which verifies that these are -// inlined. -// -// See https://github.com/golang/go/issues/42739 for discussion. - -// Sum64String computes the 64-bit xxHash digest of s. -// It may be faster than Sum64([]byte(s)) by avoiding a copy. -func Sum64String(s string) uint64 { - b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})) - return Sum64(b) -} - -// WriteString adds more data to d. It always returns len(s), nil. -// It may be faster than Write([]byte(s)) by avoiding a copy. -func (d *Digest) WriteString(s string) (n int, err error) { - d.Write(*(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))) - // d.Write always returns len(s), nil. - // Ignoring the return output and returning these fixed values buys a - // savings of 6 in the inliner's cost model. - return len(s), nil -} - -// sliceHeader is similar to reflect.SliceHeader, but it assumes that the layout -// of the first two words is the same as the layout of a string. -type sliceHeader struct { - s string - cap int -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe_test.go deleted file mode 100644 index 6598267..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhash_unsafe_test.go +++ /dev/null @@ -1,61 +0,0 @@ -// +build !appengine - -package xxhash - -import ( - "os/exec" - "sort" - "strings" - "testing" -) - -func TestStringAllocs(t *testing.T) { - longStr := strings.Repeat("a", 1000) - t.Run("Sum64String", func(t *testing.T) { - testAllocs(t, func() { - sink = Sum64String(longStr) - }) - }) - t.Run("Digest.WriteString", func(t *testing.T) { - testAllocs(t, func() { - d := New() - d.WriteString(longStr) - sink = d.Sum64() - }) - }) -} - -// This test is inspired by the Go runtime tests in https://golang.org/cl/57410. -// It asserts that certain important functions may be inlined. -func TestInlining(t *testing.T) { - funcs := map[string]struct{}{ - "Sum64String": {}, - "(*Digest).WriteString": {}, - } - - // TODO: it would be better to use the go binary that is running - // 'go test' (if we are running under 'go test'). - cmd := exec.Command("go", "test", "-gcflags=-m", "-run", "xxxx") - out, err := cmd.CombinedOutput() - if err != nil { - t.Log(string(out)) - t.Fatal(err) - } - - for _, line := range strings.Split(string(out), "\n") { - parts := strings.Split(line, ": can inline") - if len(parts) < 2 { - continue - } - delete(funcs, strings.TrimSpace(parts[1])) - } - - var failed []string - for fn := range funcs { - failed = append(failed, fn) - } - sort.Strings(failed) - for _, fn := range failed { - t.Errorf("function %s not inlined", fn) - } -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/.gitignore b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/.gitignore deleted file mode 100644 index 2c88f1d..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/xxhsum diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/xxhsum.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/xxhsum.go deleted file mode 100644 index 9b1d035..0000000 --- a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.1.2/xxhsum/xxhsum.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "fmt" - "io" - "os" - - "github.com/cespare/xxhash/v2" -) - -func main() { - if contains(os.Args[1:], "-h") { - fmt.Fprintf(os.Stderr, `Usage: - %s [filenames] -If no filenames are provided or only - is given, input is read from stdin. -`, os.Args[0]) - os.Exit(1) - } - if len(os.Args) < 2 || len(os.Args) == 2 && os.Args[1] == "-" { - printHash(os.Stdin, "-") - return - } - for _, path := range os.Args[1:] { - f, err := os.Open(path) - if err != nil { - fmt.Fprintln(os.Stderr, err) - continue - } - printHash(f, path) - f.Close() - } -} - -func contains(ss []string, s string) bool { - for _, s1 := range ss { - if s1 == s { - return true - } - } - return false -} - -func printHash(r io.Reader, name string) { - h := xxhash.New() - if _, err := io.Copy(h, r); err != nil { - fmt.Fprintln(os.Stderr, err) - return - } - fmt.Printf("%016x %s\n", h.Sum64(), name) -} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/.github/workflows/test.yml b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/.github/workflows/test.yml new file mode 100644 index 0000000..542b91f --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + strategy: + matrix: + go-version: [1.16.x, 1.17.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Install go + uses: WillAbides/setup-go-faster@v1.5.0 + with: + go-version: ${{ matrix.go-version }} + + - name: Check out code + uses: actions/checkout@v2 + + - name: Test + run: go test -count 1 -bench . -benchtime 1x ./... + + - name: Test with -tags purego + run: go test -count 1 -bench . -benchtime 1x -tags purego ./... + + test-qemu: + needs: test + strategy: + matrix: + go-version: [1.16.x, 1.17.x] + arch: [386, arm, arm64] + runs-on: ubuntu-latest + + steps: + - name: Install go + uses: WillAbides/setup-go-faster@v1.5.0 + with: + go-version: ${{ matrix.go-version }} + + - name: Install QEMU + uses: docker/setup-qemu-action@v1 + + - name: Check out code + uses: actions/checkout@v2 + + - name: Run test via qemu/binfmt + # TODO: Run the dynamic linking tests as well. That is a little more + # involved. + run: go test -v -count 1 -bench . -benchtime 1x + env: + GOARCH: ${{ matrix.arch }} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/LICENSE.txt b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/LICENSE.txt new file mode 100644 index 0000000..24b5306 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2016 Caleb Spare + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/README.md b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/README.md new file mode 100644 index 0000000..8bf0e5b --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/README.md @@ -0,0 +1,72 @@ +# xxhash + +[![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2) +[![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml) + +xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a +high-quality hashing algorithm that is much faster than anything in the Go +standard library. + +This package provides a straightforward API: + +``` +func Sum64(b []byte) uint64 +func Sum64String(s string) uint64 +type Digest struct{ ... } + func New() *Digest +``` + +The `Digest` type implements hash.Hash64. Its key methods are: + +``` +func (*Digest) Write([]byte) (int, error) +func (*Digest) WriteString(string) (int, error) +func (*Digest) Sum64() uint64 +``` + +The package is written with optimized pure Go and also contains even faster +assembly implementations for amd64 and arm64. If desired, the `purego` build tag +opts into using the Go code even on those architectures. + +[xxHash]: http://cyan4973.github.io/xxHash/ + +## Compatibility + +This package is in a module and the latest code is in version 2 of the module. +You need a version of Go with at least "minimal module compatibility" to use +github.com/cespare/xxhash/v2: + +* 1.9.7+ for Go 1.9 +* 1.10.3+ for Go 1.10 +* Go 1.11 or later + +I recommend using the latest release of Go. + +## Benchmarks + +Here are some quick benchmarks comparing the pure-Go and assembly +implementations of Sum64. + +| input size | purego | asm | +| ---------- | --------- | --------- | +| 4 B | 1.3 GB/s | 1.2 GB/s | +| 16 B | 2.9 GB/s | 3.5 GB/s | +| 100 B | 6.9 GB/s | 8.1 GB/s | +| 4 KB | 11.7 GB/s | 16.7 GB/s | +| 10 MB | 12.0 GB/s | 17.3 GB/s | + +These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C +CPU using the following commands under Go 1.19.2: + +``` +benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$') +benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$') +``` + +## Projects using this package + +- [InfluxDB](https://github.com/influxdata/influxdb) +- [Prometheus](https://github.com/prometheus/prometheus) +- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) +- [FreeCache](https://github.com/coocood/freecache) +- [FastCache](https://github.com/VictoriaMetrics/fastcache) diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/bench_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/bench_test.go new file mode 100644 index 0000000..1633823 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/bench_test.go @@ -0,0 +1,75 @@ +package xxhash + +import ( + "strings" + "testing" +) + +var benchmarks = []struct { + name string + n int64 +}{ + {"4B", 4}, + {"16B", 16}, + {"100B", 100}, + {"4KB", 4e3}, + {"10MB", 10e6}, +} + +func BenchmarkSum64(b *testing.B) { + for _, bb := range benchmarks { + in := make([]byte, bb.n) + for i := range in { + in[i] = byte(i) + } + b.Run(bb.name, func(b *testing.B) { + b.SetBytes(bb.n) + for i := 0; i < b.N; i++ { + _ = Sum64(in) + } + }) + } +} + +func BenchmarkSum64String(b *testing.B) { + for _, bb := range benchmarks { + s := strings.Repeat("a", int(bb.n)) + b.Run(bb.name, func(b *testing.B) { + b.SetBytes(bb.n) + for i := 0; i < b.N; i++ { + _ = Sum64String(s) + } + }) + } +} + +func BenchmarkDigestBytes(b *testing.B) { + for _, bb := range benchmarks { + in := make([]byte, bb.n) + for i := range in { + in[i] = byte(i) + } + b.Run(bb.name, func(b *testing.B) { + b.SetBytes(bb.n) + for i := 0; i < b.N; i++ { + h := New() + h.Write(in) + _ = h.Sum64() + } + }) + } +} + +func BenchmarkDigestString(b *testing.B) { + for _, bb := range benchmarks { + s := strings.Repeat("a", int(bb.n)) + b.Run(bb.name, func(b *testing.B) { + b.SetBytes(bb.n) + for i := 0; i < b.N; i++ { + h := New() + h.WriteString(s) + _ = h.Sum64() + } + }) + } +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/.gitignore b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/.gitignore new file mode 100644 index 0000000..8a84f19 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/.gitignore @@ -0,0 +1 @@ +/plugin.so diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/dynamic_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/dynamic_test.go new file mode 100644 index 0000000..4766b58 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/dynamic_test.go @@ -0,0 +1,48 @@ +//go:build linux || darwin +// +build linux darwin + +package main + +import ( + "bytes" + "log" + "os" + "os/exec" + "plugin" + "testing" +) + +// This is a cursory test that checks whether things work under dynamic linking. + +func TestMain(m *testing.M) { + cmd := exec.Command( + "go", "build", + "-buildmode", "plugin", + "-o", "plugin.so", + "plugin.go", + ) + var out bytes.Buffer + cmd.Stdout = &out + cmd.Stderr = &out + if err := cmd.Run(); err != nil { + log.Fatalf("Error building plugin: %s\nOutput:\n%s", err, out.String()) + } + os.Exit(m.Run()) +} + +func TestDynamic(t *testing.T) { + plug, err := plugin.Open("plugin.so") + if err != nil { + t.Fatal(err) + } + for _, test := range []string{ + "TestSum", + "TestDigest", + } { + f, err := plug.Lookup(test) + if err != nil { + t.Fatalf("cannot find func %s: %s", test, err) + } + f.(func(*testing.T))(t) + } +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/plugin.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/plugin.go new file mode 100644 index 0000000..fcf3e73 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/dynamic/plugin.go @@ -0,0 +1,47 @@ +//go:build ignore +// +build ignore + +package main + +import ( + "fmt" + "log" + "testing" + + "github.com/cespare/xxhash/v2" +) + +const ( + in = "Call me Ishmael. Some years ago--never mind how long precisely-" + want = uint64(0x02a2e85470d6fd96) +) + +func TestSum(t *testing.T) { + got := xxhash.Sum64String(in) + if got != want { + t.Fatalf("Sum64String: got 0x%x; want 0x%x", got, want) + } +} + +func TestDigest(t *testing.T) { + for chunkSize := 1; chunkSize <= len(in); chunkSize++ { + name := fmt.Sprintf("[chunkSize=%d]", chunkSize) + t.Run(name, func(t *testing.T) { + d := xxhash.New() + for i := 0; i < len(in); i += chunkSize { + chunk := in[i:] + if len(chunk) > chunkSize { + chunk = chunk[:chunkSize] + } + n, err := d.WriteString(chunk) + if err != nil || n != len(chunk) { + t.Fatalf("Digest.WriteString: got (%d, %v); want (%d, nil)", + n, err, len(chunk)) + } + } + if got := d.Sum64(); got != want { + log.Fatalf("Digest.Sum64: got 0x%x; want 0x%x", got, want) + } + }) + } +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.mod b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.mod new file mode 100644 index 0000000..49f6760 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.mod @@ -0,0 +1,3 @@ +module github.com/cespare/xxhash/v2 + +go 1.11 diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.sum b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/go.sum new file mode 100644 index 0000000..e69de29 diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/testall.sh b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/testall.sh new file mode 100644 index 0000000..94b9c44 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/testall.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -eu -o pipefail + +# Small convenience script for running the tests with various combinations of +# arch/tags. This assumes we're running on amd64 and have qemu available. + +go test ./... +go test -tags purego ./... +GOARCH=arm64 go test +GOARCH=arm64 go test -tags purego diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash.go new file mode 100644 index 0000000..a9e0d45 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash.go @@ -0,0 +1,228 @@ +// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described +// at http://cyan4973.github.io/xxHash/. +package xxhash + +import ( + "encoding/binary" + "errors" + "math/bits" +) + +const ( + prime1 uint64 = 11400714785074694791 + prime2 uint64 = 14029467366897019727 + prime3 uint64 = 1609587929392839161 + prime4 uint64 = 9650029242287828579 + prime5 uint64 = 2870177450012600261 +) + +// Store the primes in an array as well. +// +// The consts are used when possible in Go code to avoid MOVs but we need a +// contiguous array of the assembly code. +var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5} + +// Digest implements hash.Hash64. +type Digest struct { + v1 uint64 + v2 uint64 + v3 uint64 + v4 uint64 + total uint64 + mem [32]byte + n int // how much of mem is used +} + +// New creates a new Digest that computes the 64-bit xxHash algorithm. +func New() *Digest { + var d Digest + d.Reset() + return &d +} + +// Reset clears the Digest's state so that it can be reused. +func (d *Digest) Reset() { + d.v1 = primes[0] + prime2 + d.v2 = prime2 + d.v3 = 0 + d.v4 = -primes[0] + d.total = 0 + d.n = 0 +} + +// Size always returns 8 bytes. +func (d *Digest) Size() int { return 8 } + +// BlockSize always returns 32 bytes. +func (d *Digest) BlockSize() int { return 32 } + +// Write adds more data to d. It always returns len(b), nil. +func (d *Digest) Write(b []byte) (n int, err error) { + n = len(b) + d.total += uint64(n) + + memleft := d.mem[d.n&(len(d.mem)-1):] + + if d.n+n < 32 { + // This new data doesn't even fill the current block. + copy(memleft, b) + d.n += n + return + } + + if d.n > 0 { + // Finish off the partial block. + c := copy(memleft, b) + d.v1 = round(d.v1, u64(d.mem[0:8])) + d.v2 = round(d.v2, u64(d.mem[8:16])) + d.v3 = round(d.v3, u64(d.mem[16:24])) + d.v4 = round(d.v4, u64(d.mem[24:32])) + b = b[c:] + d.n = 0 + } + + if len(b) >= 32 { + // One or more full blocks left. + nw := writeBlocks(d, b) + b = b[nw:] + } + + // Store any remaining partial block. + copy(d.mem[:], b) + d.n = len(b) + + return +} + +// Sum appends the current hash to b and returns the resulting slice. +func (d *Digest) Sum(b []byte) []byte { + s := d.Sum64() + return append( + b, + byte(s>>56), + byte(s>>48), + byte(s>>40), + byte(s>>32), + byte(s>>24), + byte(s>>16), + byte(s>>8), + byte(s), + ) +} + +// Sum64 returns the current hash. +func (d *Digest) Sum64() uint64 { + var h uint64 + + if d.total >= 32 { + v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 + h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + h = mergeRound(h, v1) + h = mergeRound(h, v2) + h = mergeRound(h, v3) + h = mergeRound(h, v4) + } else { + h = d.v3 + prime5 + } + + h += d.total + + b := d.mem[:d.n&(len(d.mem)-1)] + for ; len(b) >= 8; b = b[8:] { + k1 := round(0, u64(b[:8])) + h ^= k1 + h = rol27(h)*prime1 + prime4 + } + if len(b) >= 4 { + h ^= uint64(u32(b[:4])) * prime1 + h = rol23(h)*prime2 + prime3 + b = b[4:] + } + for ; len(b) > 0; b = b[1:] { + h ^= uint64(b[0]) * prime5 + h = rol11(h) * prime1 + } + + h ^= h >> 33 + h *= prime2 + h ^= h >> 29 + h *= prime3 + h ^= h >> 32 + + return h +} + +const ( + magic = "xxh\x06" + marshaledSize = len(magic) + 8*5 + 32 +) + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (d *Digest) MarshalBinary() ([]byte, error) { + b := make([]byte, 0, marshaledSize) + b = append(b, magic...) + b = appendUint64(b, d.v1) + b = appendUint64(b, d.v2) + b = appendUint64(b, d.v3) + b = appendUint64(b, d.v4) + b = appendUint64(b, d.total) + b = append(b, d.mem[:d.n]...) + b = b[:len(b)+len(d.mem)-d.n] + return b, nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +func (d *Digest) UnmarshalBinary(b []byte) error { + if len(b) < len(magic) || string(b[:len(magic)]) != magic { + return errors.New("xxhash: invalid hash state identifier") + } + if len(b) != marshaledSize { + return errors.New("xxhash: invalid hash state size") + } + b = b[len(magic):] + b, d.v1 = consumeUint64(b) + b, d.v2 = consumeUint64(b) + b, d.v3 = consumeUint64(b) + b, d.v4 = consumeUint64(b) + b, d.total = consumeUint64(b) + copy(d.mem[:], b) + d.n = int(d.total % uint64(len(d.mem))) + return nil +} + +func appendUint64(b []byte, x uint64) []byte { + var a [8]byte + binary.LittleEndian.PutUint64(a[:], x) + return append(b, a[:]...) +} + +func consumeUint64(b []byte) ([]byte, uint64) { + x := u64(b) + return b[8:], x +} + +func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) } +func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) } + +func round(acc, input uint64) uint64 { + acc += input * prime2 + acc = rol31(acc) + acc *= prime1 + return acc +} + +func mergeRound(acc, val uint64) uint64 { + val = round(0, val) + acc ^= val + acc = acc*prime1 + prime4 + return acc +} + +func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) } +func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) } +func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) } +func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) } +func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) } +func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) } +func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) } +func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) } diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_amd64.s b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_amd64.s new file mode 100644 index 0000000..3e8b132 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_amd64.s @@ -0,0 +1,209 @@ +//go:build !appengine && gc && !purego +// +build !appengine +// +build gc +// +build !purego + +#include "textflag.h" + +// Registers: +#define h AX +#define d AX +#define p SI // pointer to advance through b +#define n DX +#define end BX // loop end +#define v1 R8 +#define v2 R9 +#define v3 R10 +#define v4 R11 +#define x R12 +#define prime1 R13 +#define prime2 R14 +#define prime4 DI + +#define round(acc, x) \ + IMULQ prime2, x \ + ADDQ x, acc \ + ROLQ $31, acc \ + IMULQ prime1, acc + +// round0 performs the operation x = round(0, x). +#define round0(x) \ + IMULQ prime2, x \ + ROLQ $31, x \ + IMULQ prime1, x + +// mergeRound applies a merge round on the two registers acc and x. +// It assumes that prime1, prime2, and prime4 have been loaded. +#define mergeRound(acc, x) \ + round0(x) \ + XORQ x, acc \ + IMULQ prime1, acc \ + ADDQ prime4, acc + +// blockLoop processes as many 32-byte blocks as possible, +// updating v1, v2, v3, and v4. It assumes that there is at least one block +// to process. +#define blockLoop() \ +loop: \ + MOVQ +0(p), x \ + round(v1, x) \ + MOVQ +8(p), x \ + round(v2, x) \ + MOVQ +16(p), x \ + round(v3, x) \ + MOVQ +24(p), x \ + round(v4, x) \ + ADDQ $32, p \ + CMPQ p, end \ + JLE loop + +// func Sum64(b []byte) uint64 +TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32 + // Load fixed primes. + MOVQ ·primes+0(SB), prime1 + MOVQ ·primes+8(SB), prime2 + MOVQ ·primes+24(SB), prime4 + + // Load slice. + MOVQ b_base+0(FP), p + MOVQ b_len+8(FP), n + LEAQ (p)(n*1), end + + // The first loop limit will be len(b)-32. + SUBQ $32, end + + // Check whether we have at least one block. + CMPQ n, $32 + JLT noBlocks + + // Set up initial state (v1, v2, v3, v4). + MOVQ prime1, v1 + ADDQ prime2, v1 + MOVQ prime2, v2 + XORQ v3, v3 + XORQ v4, v4 + SUBQ prime1, v4 + + blockLoop() + + MOVQ v1, h + ROLQ $1, h + MOVQ v2, x + ROLQ $7, x + ADDQ x, h + MOVQ v3, x + ROLQ $12, x + ADDQ x, h + MOVQ v4, x + ROLQ $18, x + ADDQ x, h + + mergeRound(h, v1) + mergeRound(h, v2) + mergeRound(h, v3) + mergeRound(h, v4) + + JMP afterBlocks + +noBlocks: + MOVQ ·primes+32(SB), h + +afterBlocks: + ADDQ n, h + + ADDQ $24, end + CMPQ p, end + JG try4 + +loop8: + MOVQ (p), x + ADDQ $8, p + round0(x) + XORQ x, h + ROLQ $27, h + IMULQ prime1, h + ADDQ prime4, h + + CMPQ p, end + JLE loop8 + +try4: + ADDQ $4, end + CMPQ p, end + JG try1 + + MOVL (p), x + ADDQ $4, p + IMULQ prime1, x + XORQ x, h + + ROLQ $23, h + IMULQ prime2, h + ADDQ ·primes+16(SB), h + +try1: + ADDQ $4, end + CMPQ p, end + JGE finalize + +loop1: + MOVBQZX (p), x + ADDQ $1, p + IMULQ ·primes+32(SB), x + XORQ x, h + ROLQ $11, h + IMULQ prime1, h + + CMPQ p, end + JL loop1 + +finalize: + MOVQ h, x + SHRQ $33, x + XORQ x, h + IMULQ prime2, h + MOVQ h, x + SHRQ $29, x + XORQ x, h + IMULQ ·primes+16(SB), h + MOVQ h, x + SHRQ $32, x + XORQ x, h + + MOVQ h, ret+24(FP) + RET + +// func writeBlocks(d *Digest, b []byte) int +TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 + // Load fixed primes needed for round. + MOVQ ·primes+0(SB), prime1 + MOVQ ·primes+8(SB), prime2 + + // Load slice. + MOVQ b_base+8(FP), p + MOVQ b_len+16(FP), n + LEAQ (p)(n*1), end + SUBQ $32, end + + // Load vN from d. + MOVQ s+0(FP), d + MOVQ 0(d), v1 + MOVQ 8(d), v2 + MOVQ 16(d), v3 + MOVQ 24(d), v4 + + // We don't need to check the loop condition here; this function is + // always called with at least one block of data to process. + blockLoop() + + // Copy vN back to d. + MOVQ v1, 0(d) + MOVQ v2, 8(d) + MOVQ v3, 16(d) + MOVQ v4, 24(d) + + // The number of bytes written is p minus the old base pointer. + SUBQ b_base+8(FP), p + MOVQ p, ret+32(FP) + + RET diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_arm64.s b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_arm64.s new file mode 100644 index 0000000..7e3145a --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_arm64.s @@ -0,0 +1,183 @@ +//go:build !appengine && gc && !purego +// +build !appengine +// +build gc +// +build !purego + +#include "textflag.h" + +// Registers: +#define digest R1 +#define h R2 // return value +#define p R3 // input pointer +#define n R4 // input length +#define nblocks R5 // n / 32 +#define prime1 R7 +#define prime2 R8 +#define prime3 R9 +#define prime4 R10 +#define prime5 R11 +#define v1 R12 +#define v2 R13 +#define v3 R14 +#define v4 R15 +#define x1 R20 +#define x2 R21 +#define x3 R22 +#define x4 R23 + +#define round(acc, x) \ + MADD prime2, acc, x, acc \ + ROR $64-31, acc \ + MUL prime1, acc + +// round0 performs the operation x = round(0, x). +#define round0(x) \ + MUL prime2, x \ + ROR $64-31, x \ + MUL prime1, x + +#define mergeRound(acc, x) \ + round0(x) \ + EOR x, acc \ + MADD acc, prime4, prime1, acc + +// blockLoop processes as many 32-byte blocks as possible, +// updating v1, v2, v3, and v4. It assumes that n >= 32. +#define blockLoop() \ + LSR $5, n, nblocks \ + PCALIGN $16 \ + loop: \ + LDP.P 16(p), (x1, x2) \ + LDP.P 16(p), (x3, x4) \ + round(v1, x1) \ + round(v2, x2) \ + round(v3, x3) \ + round(v4, x4) \ + SUB $1, nblocks \ + CBNZ nblocks, loop + +// func Sum64(b []byte) uint64 +TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32 + LDP b_base+0(FP), (p, n) + + LDP ·primes+0(SB), (prime1, prime2) + LDP ·primes+16(SB), (prime3, prime4) + MOVD ·primes+32(SB), prime5 + + CMP $32, n + CSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 } + BLT afterLoop + + ADD prime1, prime2, v1 + MOVD prime2, v2 + MOVD $0, v3 + NEG prime1, v4 + + blockLoop() + + ROR $64-1, v1, x1 + ROR $64-7, v2, x2 + ADD x1, x2 + ROR $64-12, v3, x3 + ROR $64-18, v4, x4 + ADD x3, x4 + ADD x2, x4, h + + mergeRound(h, v1) + mergeRound(h, v2) + mergeRound(h, v3) + mergeRound(h, v4) + +afterLoop: + ADD n, h + + TBZ $4, n, try8 + LDP.P 16(p), (x1, x2) + + round0(x1) + + // NOTE: here and below, sequencing the EOR after the ROR (using a + // rotated register) is worth a small but measurable speedup for small + // inputs. + ROR $64-27, h + EOR x1 @> 64-27, h, h + MADD h, prime4, prime1, h + + round0(x2) + ROR $64-27, h + EOR x2 @> 64-27, h, h + MADD h, prime4, prime1, h + +try8: + TBZ $3, n, try4 + MOVD.P 8(p), x1 + + round0(x1) + ROR $64-27, h + EOR x1 @> 64-27, h, h + MADD h, prime4, prime1, h + +try4: + TBZ $2, n, try2 + MOVWU.P 4(p), x2 + + MUL prime1, x2 + ROR $64-23, h + EOR x2 @> 64-23, h, h + MADD h, prime3, prime2, h + +try2: + TBZ $1, n, try1 + MOVHU.P 2(p), x3 + AND $255, x3, x1 + LSR $8, x3, x2 + + MUL prime5, x1 + ROR $64-11, h + EOR x1 @> 64-11, h, h + MUL prime1, h + + MUL prime5, x2 + ROR $64-11, h + EOR x2 @> 64-11, h, h + MUL prime1, h + +try1: + TBZ $0, n, finalize + MOVBU (p), x4 + + MUL prime5, x4 + ROR $64-11, h + EOR x4 @> 64-11, h, h + MUL prime1, h + +finalize: + EOR h >> 33, h + MUL prime2, h + EOR h >> 29, h + MUL prime3, h + EOR h >> 32, h + + MOVD h, ret+24(FP) + RET + +// func writeBlocks(d *Digest, b []byte) int +TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 + LDP ·primes+0(SB), (prime1, prime2) + + // Load state. Assume v[1-4] are stored contiguously. + MOVD d+0(FP), digest + LDP 0(digest), (v1, v2) + LDP 16(digest), (v3, v4) + + LDP b_base+8(FP), (p, n) + + blockLoop() + + // Store updated state. + STP (v1, v2), 0(digest) + STP (v3, v4), 16(digest) + + BIC $31, n + MOVD n, ret+32(FP) + RET diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_asm.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_asm.go new file mode 100644 index 0000000..9216e0a --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_asm.go @@ -0,0 +1,15 @@ +//go:build (amd64 || arm64) && !appengine && gc && !purego +// +build amd64 arm64 +// +build !appengine +// +build gc +// +build !purego + +package xxhash + +// Sum64 computes the 64-bit xxHash digest of b. +// +//go:noescape +func Sum64(b []byte) uint64 + +//go:noescape +func writeBlocks(d *Digest, b []byte) int diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_other.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_other.go new file mode 100644 index 0000000..26df13b --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_other.go @@ -0,0 +1,76 @@ +//go:build (!amd64 && !arm64) || appengine || !gc || purego +// +build !amd64,!arm64 appengine !gc purego + +package xxhash + +// Sum64 computes the 64-bit xxHash digest of b. +func Sum64(b []byte) uint64 { + // A simpler version would be + // d := New() + // d.Write(b) + // return d.Sum64() + // but this is faster, particularly for small inputs. + + n := len(b) + var h uint64 + + if n >= 32 { + v1 := primes[0] + prime2 + v2 := prime2 + v3 := uint64(0) + v4 := -primes[0] + for len(b) >= 32 { + v1 = round(v1, u64(b[0:8:len(b)])) + v2 = round(v2, u64(b[8:16:len(b)])) + v3 = round(v3, u64(b[16:24:len(b)])) + v4 = round(v4, u64(b[24:32:len(b)])) + b = b[32:len(b):len(b)] + } + h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + h = mergeRound(h, v1) + h = mergeRound(h, v2) + h = mergeRound(h, v3) + h = mergeRound(h, v4) + } else { + h = prime5 + } + + h += uint64(n) + + for ; len(b) >= 8; b = b[8:] { + k1 := round(0, u64(b[:8])) + h ^= k1 + h = rol27(h)*prime1 + prime4 + } + if len(b) >= 4 { + h ^= uint64(u32(b[:4])) * prime1 + h = rol23(h)*prime2 + prime3 + b = b[4:] + } + for ; len(b) > 0; b = b[1:] { + h ^= uint64(b[0]) * prime5 + h = rol11(h) * prime1 + } + + h ^= h >> 33 + h *= prime2 + h ^= h >> 29 + h *= prime3 + h ^= h >> 32 + + return h +} + +func writeBlocks(d *Digest, b []byte) int { + v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 + n := len(b) + for len(b) >= 32 { + v1 = round(v1, u64(b[0:8:len(b)])) + v2 = round(v2, u64(b[8:16:len(b)])) + v3 = round(v3, u64(b[16:24:len(b)])) + v4 = round(v4, u64(b[24:32:len(b)])) + b = b[32:len(b):len(b)] + } + d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4 + return n - len(b) +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_safe.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_safe.go new file mode 100644 index 0000000..e86f1b5 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_safe.go @@ -0,0 +1,16 @@ +//go:build appengine +// +build appengine + +// This file contains the safe implementations of otherwise unsafe-using code. + +package xxhash + +// Sum64String computes the 64-bit xxHash digest of s. +func Sum64String(s string) uint64 { + return Sum64([]byte(s)) +} + +// WriteString adds more data to d. It always returns len(s), nil. +func (d *Digest) WriteString(s string) (n int, err error) { + return d.Write([]byte(s)) +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_test.go new file mode 100644 index 0000000..6330f19 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_test.go @@ -0,0 +1,166 @@ +package xxhash + +import ( + "bytes" + "encoding/binary" + "fmt" + "strings" + "testing" +) + +func TestAll(t *testing.T) { + for _, tt := range []struct { + name string + input string + want uint64 + }{ + {"empty", "", 0xef46db3751d8e999}, + {"a", "a", 0xd24ec4f1a98c6e5b}, + {"as", "as", 0x1c330fb2d66be179}, + {"asd", "asd", 0x631c37ce72a97393}, + {"asdf", "asdf", 0x415872f599cea71e}, + { + "len=63", + // Exactly 63 characters, which exercises all code paths. + "Call me Ishmael. Some years ago--never mind how long precisely-", + 0x02a2e85470d6fd96, + }, + } { + lastChunkSize := len(tt.input) + if lastChunkSize == 0 { + lastChunkSize = 1 + } + for chunkSize := 1; chunkSize <= lastChunkSize; chunkSize++ { + name := fmt.Sprintf("%s,chunkSize=%d", tt.name, chunkSize) + t.Run(name, func(t *testing.T) { + testDigest(t, tt.input, chunkSize, tt.want) + }) + } + t.Run(tt.name, func(t *testing.T) { testSum(t, tt.input, tt.want) }) + } +} + +func testDigest(t *testing.T, input string, chunkSize int, want uint64) { + d := New() + ds := New() // uses WriteString + for i := 0; i < len(input); i += chunkSize { + chunk := input[i:] + if len(chunk) > chunkSize { + chunk = chunk[:chunkSize] + } + n, err := d.Write([]byte(chunk)) + if err != nil || n != len(chunk) { + t.Fatalf("Digest.Write: got (%d, %v); want (%d, nil)", n, err, len(chunk)) + } + n, err = ds.WriteString(chunk) + if err != nil || n != len(chunk) { + t.Fatalf("Digest.WriteString: got (%d, %v); want (%d, nil)", n, err, len(chunk)) + } + } + if got := d.Sum64(); got != want { + t.Fatalf("Digest.Sum64: got 0x%x; want 0x%x", got, want) + } + if got := ds.Sum64(); got != want { + t.Fatalf("Digest.Sum64 (WriteString): got 0x%x; want 0x%x", got, want) + } + var b [8]byte + binary.BigEndian.PutUint64(b[:], want) + if got := d.Sum(nil); !bytes.Equal(got, b[:]) { + t.Fatalf("Sum: got %v; want %v", got, b[:]) + } +} + +func testSum(t *testing.T, input string, want uint64) { + if got := Sum64([]byte(input)); got != want { + t.Fatalf("Sum64: got 0x%x; want 0x%x", got, want) + } + if got := Sum64String(input); got != want { + t.Fatalf("Sum64String: got 0x%x; want 0x%x", got, want) + } +} + +func TestReset(t *testing.T) { + parts := []string{"The quic", "k br", "o", "wn fox jumps", " ov", "er the lazy ", "dog."} + d := New() + for _, part := range parts { + d.Write([]byte(part)) + } + h0 := d.Sum64() + + d.Reset() + d.Write([]byte(strings.Join(parts, ""))) + h1 := d.Sum64() + + if h0 != h1 { + t.Errorf("0x%x != 0x%x", h0, h1) + } +} + +func TestBinaryMarshaling(t *testing.T) { + d := New() + d.WriteString("abc") + b, err := d.MarshalBinary() + if err != nil { + t.Fatal(err) + } + d = New() + d.WriteString("junk") + if err := d.UnmarshalBinary(b); err != nil { + t.Fatal(err) + } + d.WriteString("def") + if got, want := d.Sum64(), Sum64String("abcdef"); got != want { + t.Fatalf("after MarshalBinary+UnmarshalBinary, got 0x%x; want 0x%x", got, want) + } + + d0 := New() + d1 := New() + for i := 0; i < 64; i++ { + b, err := d0.MarshalBinary() + if err != nil { + t.Fatal(err) + } + d0 = new(Digest) + if err := d0.UnmarshalBinary(b); err != nil { + t.Fatal(err) + } + if got, want := d0.Sum64(), d1.Sum64(); got != want { + t.Fatalf("after %d Writes, unmarshaled Digest gave sum 0x%x; want 0x%x", i, got, want) + } + + d0.Write([]byte{'a'}) + d1.Write([]byte{'a'}) + } +} + +var sink uint64 + +func TestAllocs(t *testing.T) { + const shortStr = "abcdefghijklmnop" + // Sum64([]byte(shortString)) shouldn't allocate because the + // intermediate []byte ought not to escape. + // (See https://github.com/cespare/xxhash/pull/2.) + t.Run("Sum64", func(t *testing.T) { + testAllocs(t, func() { + sink = Sum64([]byte(shortStr)) + }) + }) + // Creating and using a Digest shouldn't allocate because its methods + // shouldn't make it escape. (A previous version of New returned a + // hash.Hash64 which forces an allocation.) + t.Run("Digest", func(t *testing.T) { + b := []byte("asdf") + testAllocs(t, func() { + d := New() + d.Write(b) + sink = d.Sum64() + }) + }) +} + +func testAllocs(t *testing.T, fn func()) { + t.Helper() + if allocs := int(testing.AllocsPerRun(10, fn)); allocs > 0 { + t.Fatalf("got %d allocation(s) (want zero)", allocs) + } +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe.go new file mode 100644 index 0000000..1c1638f --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe.go @@ -0,0 +1,58 @@ +//go:build !appengine +// +build !appengine + +// This file encapsulates usage of unsafe. +// xxhash_safe.go contains the safe implementations. + +package xxhash + +import ( + "unsafe" +) + +// In the future it's possible that compiler optimizations will make these +// XxxString functions unnecessary by realizing that calls such as +// Sum64([]byte(s)) don't need to copy s. See https://go.dev/issue/2205. +// If that happens, even if we keep these functions they can be replaced with +// the trivial safe code. + +// NOTE: The usual way of doing an unsafe string-to-[]byte conversion is: +// +// var b []byte +// bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) +// bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data +// bh.Len = len(s) +// bh.Cap = len(s) +// +// Unfortunately, as of Go 1.15.3 the inliner's cost model assigns a high enough +// weight to this sequence of expressions that any function that uses it will +// not be inlined. Instead, the functions below use a different unsafe +// conversion designed to minimize the inliner weight and allow both to be +// inlined. There is also a test (TestInlining) which verifies that these are +// inlined. +// +// See https://github.com/golang/go/issues/42739 for discussion. + +// Sum64String computes the 64-bit xxHash digest of s. +// It may be faster than Sum64([]byte(s)) by avoiding a copy. +func Sum64String(s string) uint64 { + b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})) + return Sum64(b) +} + +// WriteString adds more data to d. It always returns len(s), nil. +// It may be faster than Write([]byte(s)) by avoiding a copy. +func (d *Digest) WriteString(s string) (n int, err error) { + d.Write(*(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))) + // d.Write always returns len(s), nil. + // Ignoring the return output and returning these fixed values buys a + // savings of 6 in the inliner's cost model. + return len(s), nil +} + +// sliceHeader is similar to reflect.SliceHeader, but it assumes that the layout +// of the first two words is the same as the layout of a string. +type sliceHeader struct { + s string + cap int +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe_test.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe_test.go new file mode 100644 index 0000000..6d6f93c --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhash_unsafe_test.go @@ -0,0 +1,60 @@ +//go:build !appengine +// +build !appengine + +package xxhash + +import ( + "os/exec" + "sort" + "strings" + "testing" +) + +func TestStringAllocs(t *testing.T) { + longStr := strings.Repeat("a", 1000) + t.Run("Sum64String", func(t *testing.T) { + testAllocs(t, func() { + sink = Sum64String(longStr) + }) + }) + t.Run("Digest.WriteString", func(t *testing.T) { + testAllocs(t, func() { + d := New() + d.WriteString(longStr) + sink = d.Sum64() + }) + }) +} + +// This test is inspired by the Go runtime tests in https://go.dev/cl/57410. +// It asserts that certain important functions may be inlined. +func TestInlining(t *testing.T) { + funcs := map[string]struct{}{ + "Sum64String": {}, + "(*Digest).WriteString": {}, + } + + cmd := exec.Command("go", "test", "-gcflags=-m", "-run", "xxxx") + out, err := cmd.CombinedOutput() + if err != nil { + t.Log(string(out)) + t.Fatal(err) + } + + for _, line := range strings.Split(string(out), "\n") { + parts := strings.Split(line, ": can inline") + if len(parts) < 2 { + continue + } + delete(funcs, strings.TrimSpace(parts[1])) + } + + var failed []string + for fn := range funcs { + failed = append(failed, fn) + } + sort.Strings(failed) + for _, fn := range failed { + t.Errorf("function %s not inlined", fn) + } +} diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/.gitignore b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/.gitignore new file mode 100644 index 0000000..2c88f1d --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/.gitignore @@ -0,0 +1 @@ +/xxhsum diff --git a/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/xxhsum.go b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/xxhsum.go new file mode 100644 index 0000000..9b1d035 --- /dev/null +++ b/dependencies/pkg/mod/github.com/cespare/xxhash/v2@v2.2.0/xxhsum/xxhsum.go @@ -0,0 +1,50 @@ +package main + +import ( + "fmt" + "io" + "os" + + "github.com/cespare/xxhash/v2" +) + +func main() { + if contains(os.Args[1:], "-h") { + fmt.Fprintf(os.Stderr, `Usage: + %s [filenames] +If no filenames are provided or only - is given, input is read from stdin. +`, os.Args[0]) + os.Exit(1) + } + if len(os.Args) < 2 || len(os.Args) == 2 && os.Args[1] == "-" { + printHash(os.Stdin, "-") + return + } + for _, path := range os.Args[1:] { + f, err := os.Open(path) + if err != nil { + fmt.Fprintln(os.Stderr, err) + continue + } + printHash(f, path) + f.Close() + } +} + +func contains(ss []string, s string) bool { + for _, s1 := range ss { + if s1 == s { + return true + } + } + return false +} + +func printHash(r io.Reader, name string) { + h := xxhash.New() + if _, err := io.Copy(h, r); err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + fmt.Printf("%016x %s\n", h.Sum64(), name) +} diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/FUNDING.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/FUNDING.yml deleted file mode 100644 index 707670d..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: ['https://uptrace.dev/sponsor'] diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/bug_report.md b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 3f934f8..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' ---- - -Issue tracker is used for reporting bugs and discussing new features. Please use -[stackoverflow](https://stackoverflow.com) for supporting issues. - - - -## Expected Behavior - - - -## Current Behavior - - - -## Possible Solution - - - -## Steps to Reproduce - - - - -1. -2. -3. -4. - -## Context (Environment) - - - - - - -## Detailed Description - - - -## Possible Implementation - - diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/config.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index e86d7a6..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: true -contact_links: - - name: Discussions - url: https://github.com/go-redis/redis/discussions - about: Ask a question via GitHub Discussions diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/dependabot.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/dependabot.yml deleted file mode 100644 index 77b7be5..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: -- package-ecosystem: gomod - directory: / - schedule: - interval: weekly -- package-ecosystem: github-actions - directory: / - schedule: - interval: weekly diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/build.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/build.yml deleted file mode 100644 index a574e2e..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Go - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - name: build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - go-version: [1.16.x, 1.17.x] - - services: - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Set up ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Test - run: make test diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/commitlint.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/commitlint.yml deleted file mode 100644 index 5fcfeae..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/commitlint.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Lint Commit Messages -on: [pull_request] - -jobs: - commitlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v4 diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/golangci-lint.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/golangci-lint.yml deleted file mode 100644 index 28c16c5..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: golangci-lint - -on: - push: - tags: - - v* - branches: - - master - - main - pull_request: - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/release.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/release.yml deleted file mode 100644 index 685693a..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.github/workflows/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Releases - -on: - push: - tags: - - 'v*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ncipollo/release-action@v1 - with: - body: - Please refer to - [CHANGELOG.md](https://github.com/go-redis/redis/blob/master/CHANGELOG.md) for details diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.gitignore b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.gitignore deleted file mode 100644 index b975a7b..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.rdb -testdata/*/ -.idea/ diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.golangci.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.golangci.yml deleted file mode 100644 index de51455..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.golangci.yml +++ /dev/null @@ -1,4 +0,0 @@ -run: - concurrency: 8 - deadline: 5m - tests: false diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.prettierrc.yml b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.prettierrc.yml deleted file mode 100644 index 8b7f044..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/.prettierrc.yml +++ /dev/null @@ -1,4 +0,0 @@ -semi: false -singleQuote: true -proseWrap: always -printWidth: 100 diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/CHANGELOG.md b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/CHANGELOG.md deleted file mode 100644 index 195e519..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/CHANGELOG.md +++ /dev/null @@ -1,177 +0,0 @@ -## [8.11.5](https://github.com/go-redis/redis/compare/v8.11.4...v8.11.5) (2022-03-17) - - -### Bug Fixes - -* add missing Expire methods to Cmdable ([17e3b43](https://github.com/go-redis/redis/commit/17e3b43879d516437ada71cf9c0deac6a382ed9a)) -* add whitespace for avoid unlikely colisions ([7f7c181](https://github.com/go-redis/redis/commit/7f7c1817617cfec909efb13d14ad22ef05a6ad4c)) -* example/otel compile error ([#2028](https://github.com/go-redis/redis/issues/2028)) ([187c07c](https://github.com/go-redis/redis/commit/187c07c41bf68dc3ab280bc3a925e960bbef6475)) -* **extra/redisotel:** set span.kind attribute to client ([065b200](https://github.com/go-redis/redis/commit/065b200070b41e6e949710b4f9e01b50ccc60ab2)) -* format ([96f53a0](https://github.com/go-redis/redis/commit/96f53a0159a28affa94beec1543a62234e7f8b32)) -* invalid type assert in stringArg ([de6c131](https://github.com/go-redis/redis/commit/de6c131865b8263400c8491777b295035f2408e4)) -* rename Golang to Go ([#2030](https://github.com/go-redis/redis/issues/2030)) ([b82a2d9](https://github.com/go-redis/redis/commit/b82a2d9d4d2de7b7cbe8fcd4895be62dbcacacbc)) -* set timeout for WAIT command. Fixes [#1963](https://github.com/go-redis/redis/issues/1963) ([333fee1](https://github.com/go-redis/redis/commit/333fee1a8fd98a2fbff1ab187c1b03246a7eb01f)) -* update some argument counts in pre-allocs ([f6974eb](https://github.com/go-redis/redis/commit/f6974ebb5c40a8adf90d2cacab6dc297f4eba4c2)) - - -### Features - -* Add redis v7's NX, XX, GT, LT expire variants ([e19bbb2](https://github.com/go-redis/redis/commit/e19bbb26e2e395c6e077b48d80d79e99f729a8b8)) -* add support for acl sentinel auth in universal client ([ab0ccc4](https://github.com/go-redis/redis/commit/ab0ccc47413f9b2a6eabc852fed5005a3ee1af6e)) -* add support for COPY command ([#2016](https://github.com/go-redis/redis/issues/2016)) ([730afbc](https://github.com/go-redis/redis/commit/730afbcffb93760e8a36cc06cfe55ab102b693a7)) -* add support for passing extra attributes added to spans ([39faaa1](https://github.com/go-redis/redis/commit/39faaa171523834ba527c9789710c4fde87f5a2e)) -* add support for time.Duration write and scan ([2f1b74e](https://github.com/go-redis/redis/commit/2f1b74e20cdd7719b2aecf0768d3e3ae7c3e781b)) -* **redisotel:** ability to override TracerProvider ([#1998](https://github.com/go-redis/redis/issues/1998)) ([bf8d4aa](https://github.com/go-redis/redis/commit/bf8d4aa60c00366cda2e98c3ddddc8cf68507417)) -* set net.peer.name and net.peer.port in otel example ([69bf454](https://github.com/go-redis/redis/commit/69bf454f706204211cd34835f76b2e8192d3766d)) - - - -## [8.11.4](https://github.com/go-redis/redis/compare/v8.11.3...v8.11.4) (2021-10-04) - - -### Features - -* add acl auth support for sentinels ([f66582f](https://github.com/go-redis/redis/commit/f66582f44f3dc3a4705a5260f982043fde4aa634)) -* add Cmd.{String,Int,Float,Bool}Slice helpers and an example ([5d3d293](https://github.com/go-redis/redis/commit/5d3d293cc9c60b90871e2420602001463708ce24)) -* add SetVal method for each command ([168981d](https://github.com/go-redis/redis/commit/168981da2d84ee9e07d15d3e74d738c162e264c4)) - - - -## v8.11 - -- Remove OpenTelemetry metrics. -- Supports more redis commands and options. - -## v8.10 - -- Removed extra OpenTelemetry spans from go-redis core. Now go-redis instrumentation only adds a - single span with a Redis command (instead of 4 spans). There are multiple reasons behind this - decision: - - - Traces become smaller and less noisy. - - It may be costly to process those 3 extra spans for each query. - - go-redis no longer depends on OpenTelemetry. - - Eventually we hope to replace the information that we no longer collect with OpenTelemetry - Metrics. - -## v8.9 - -- Changed `PubSub.Channel` to only rely on `Ping` result. You can now use `WithChannelSize`, - `WithChannelHealthCheckInterval`, and `WithChannelSendTimeout` to override default settings. - -## v8.8 - -- To make updating easier, extra modules now have the same version as go-redis does. That means that - you need to update your imports: - -``` -github.com/go-redis/redis/extra/redisotel -> github.com/go-redis/redis/extra/redisotel/v8 -github.com/go-redis/redis/extra/rediscensus -> github.com/go-redis/redis/extra/rediscensus/v8 -``` - -## v8.5 - -- [knadh](https://github.com/knadh) contributed long-awaited ability to scan Redis Hash into a - struct: - -```go -err := rdb.HGetAll(ctx, "hash").Scan(&data) - -err := rdb.MGet(ctx, "key1", "key2").Scan(&data) -``` - -- Please check [redismock](https://github.com/go-redis/redismock) by - [monkey92t](https://github.com/monkey92t) if you are looking for mocking Redis Client. - -## v8 - -- All commands require `context.Context` as a first argument, e.g. `rdb.Ping(ctx)`. If you are not - using `context.Context` yet, the simplest option is to define global package variable - `var ctx = context.TODO()` and use it when `ctx` is required. - -- Full support for `context.Context` canceling. - -- Added `redis.NewFailoverClusterClient` that supports routing read-only commands to a slave node. - -- Added `redisext.OpenTemetryHook` that adds - [Redis OpenTelemetry instrumentation](https://redis.uptrace.dev/tracing/). - -- Redis slow log support. - -- Ring uses Rendezvous Hashing by default which provides better distribution. You need to move - existing keys to a new location or keys will be inaccessible / lost. To use old hashing scheme: - -```go -import "github.com/golang/groupcache/consistenthash" - -ring := redis.NewRing(&redis.RingOptions{ - NewConsistentHash: func() { - return consistenthash.New(100, crc32.ChecksumIEEE) - }, -}) -``` - -- `ClusterOptions.MaxRedirects` default value is changed from 8 to 3. -- `Options.MaxRetries` default value is changed from 0 to 3. - -- `Cluster.ForEachNode` is renamed to `ForEachShard` for consistency with `Ring`. - -## v7.3 - -- New option `Options.Username` which causes client to use `AuthACL`. Be aware if your connection - URL contains username. - -## v7.2 - -- Existing `HMSet` is renamed to `HSet` and old deprecated `HMSet` is restored for Redis 3 users. - -## v7.1 - -- Existing `Cmd.String` is renamed to `Cmd.Text`. New `Cmd.String` implements `fmt.Stringer` - interface. - -## v7 - -- _Important_. Tx.Pipeline now returns a non-transactional pipeline. Use Tx.TxPipeline for a - transactional pipeline. -- WrapProcess is replaced with more convenient AddHook that has access to context.Context. -- WithContext now can not be used to create a shallow copy of the client. -- New methods ProcessContext, DoContext, and ExecContext. -- Client respects Context.Deadline when setting net.Conn deadline. -- Client listens on Context.Done while waiting for a connection from the pool and returns an error - when context context is cancelled. -- Add PubSub.ChannelWithSubscriptions that sends `*Subscription` in addition to `*Message` to allow - detecting reconnections. -- `time.Time` is now marshalled in RFC3339 format. `rdb.Get("foo").Time()` helper is added to parse - the time. -- `SetLimiter` is removed and added `Options.Limiter` instead. -- `HMSet` is deprecated as of Redis v4. - -## v6.15 - -- Cluster and Ring pipelines process commands for each node in its own goroutine. - -## 6.14 - -- Added Options.MinIdleConns. -- Added Options.MaxConnAge. -- PoolStats.FreeConns is renamed to PoolStats.IdleConns. -- Add Client.Do to simplify creating custom commands. -- Add Cmd.String, Cmd.Int, Cmd.Int64, Cmd.Uint64, Cmd.Float64, and Cmd.Bool helpers. -- Lower memory usage. - -## v6.13 - -- Ring got new options called `HashReplicas` and `Hash`. It is recommended to set - `HashReplicas = 1000` for better keys distribution between shards. -- Cluster client was optimized to use much less memory when reloading cluster state. -- PubSub.ReceiveMessage is re-worked to not use ReceiveTimeout so it does not lose data when timeout - occurres. In most cases it is recommended to use PubSub.Channel instead. -- Dialer.KeepAlive is set to 5 minutes by default. - -## v6.12 - -- ClusterClient got new option called `ClusterSlots` which allows to build cluster of normal Redis - Servers that don't have cluster mode enabled. See - https://godoc.org/github.com/go-redis/redis#example-NewClusterClient--ManualSetup diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/LICENSE b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/LICENSE deleted file mode 100644 index 298bed9..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2013 The github.com/go-redis/redis Authors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/Makefile b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/Makefile deleted file mode 100644 index a4cfe05..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -PACKAGE_DIRS := $(shell find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | sort) - -test: testdeps - go test ./... - go test ./... -short -race - go test ./... -run=NONE -bench=. -benchmem - env GOOS=linux GOARCH=386 go test ./... - go vet - -testdeps: testdata/redis/src/redis-server - -bench: testdeps - go test ./... -test.run=NONE -test.bench=. -test.benchmem - -.PHONY: all test testdeps bench - -testdata/redis: - mkdir -p $@ - wget -qO- https://download.redis.io/releases/redis-6.2.5.tar.gz | tar xvz --strip-components=1 -C $@ - -testdata/redis/src/redis-server: testdata/redis - cd $< && make all - -fmt: - gofmt -w -s ./ - goimports -w -local github.com/go-redis/redis ./ - -go_mod_tidy: - go get -u && go mod tidy - set -e; for dir in $(PACKAGE_DIRS); do \ - echo "go mod tidy in $${dir}"; \ - (cd "$${dir}" && \ - go get -u && \ - go mod tidy); \ - done diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/README.md b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/README.md deleted file mode 100644 index f3b6a01..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/README.md +++ /dev/null @@ -1,175 +0,0 @@ -# Redis client for Go - -![build workflow](https://github.com/go-redis/redis/actions/workflows/build.yml/badge.svg) -[![PkgGoDev](https://pkg.go.dev/badge/github.com/go-redis/redis/v8)](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc) -[![Documentation](https://img.shields.io/badge/redis-documentation-informational)](https://redis.uptrace.dev/) - -go-redis is brought to you by :star: [**uptrace/uptrace**](https://github.com/uptrace/uptrace). -Uptrace is an open source and blazingly fast **distributed tracing** backend powered by -OpenTelemetry and ClickHouse. Give it a star as well! - -## Resources - -- [Discussions](https://github.com/go-redis/redis/discussions) -- [Documentation](https://redis.uptrace.dev) -- [Reference](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc) -- [Examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples) -- [RealWorld example app](https://github.com/uptrace/go-treemux-realworld-example-app) - -Other projects you may like: - -- [Bun](https://bun.uptrace.dev) - fast and simple SQL client for PostgreSQL, MySQL, and SQLite. -- [BunRouter](https://bunrouter.uptrace.dev/) - fast and flexible HTTP router for Go. - -## Ecosystem - -- [Redis Mock](https://github.com/go-redis/redismock) -- [Distributed Locks](https://github.com/bsm/redislock) -- [Redis Cache](https://github.com/go-redis/cache) -- [Rate limiting](https://github.com/go-redis/redis_rate) - -## Features - -- Redis 3 commands except QUIT, MONITOR, and SYNC. -- Automatic connection pooling with - [circuit breaker](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern) support. -- [Pub/Sub](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#PubSub). -- [Transactions](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client-TxPipeline). -- [Pipeline](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client.Pipeline) and - [TxPipeline](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client.TxPipeline). -- [Scripting](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#Script). -- [Timeouts](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#Options). -- [Redis Sentinel](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#NewFailoverClient). -- [Redis Cluster](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#NewClusterClient). -- [Cluster of Redis Servers](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-NewClusterClient-ManualSetup) - without using cluster mode and Redis Sentinel. -- [Ring](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#NewRing). -- [Instrumentation](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-package-Instrumentation). - -## Installation - -go-redis supports 2 last Go versions and requires a Go version with -[modules](https://github.com/golang/go/wiki/Modules) support. So make sure to initialize a Go -module: - -```shell -go mod init github.com/my/repo -``` - -And then install go-redis/v8 (note _v8_ in the import; omitting it is a popular mistake): - -```shell -go get github.com/go-redis/redis/v8 -``` - -## Quickstart - -```go -import ( - "context" - "github.com/go-redis/redis/v8" - "fmt" -) - -var ctx = context.Background() - -func ExampleClient() { - rdb := redis.NewClient(&redis.Options{ - Addr: "localhost:6379", - Password: "", // no password set - DB: 0, // use default DB - }) - - err := rdb.Set(ctx, "key", "value", 0).Err() - if err != nil { - panic(err) - } - - val, err := rdb.Get(ctx, "key").Result() - if err != nil { - panic(err) - } - fmt.Println("key", val) - - val2, err := rdb.Get(ctx, "key2").Result() - if err == redis.Nil { - fmt.Println("key2 does not exist") - } else if err != nil { - panic(err) - } else { - fmt.Println("key2", val2) - } - // Output: key value - // key2 does not exist -} -``` - -## Look and feel - -Some corner cases: - -```go -// SET key value EX 10 NX -set, err := rdb.SetNX(ctx, "key", "value", 10*time.Second).Result() - -// SET key value keepttl NX -set, err := rdb.SetNX(ctx, "key", "value", redis.KeepTTL).Result() - -// SORT list LIMIT 0 2 ASC -vals, err := rdb.Sort(ctx, "list", &redis.Sort{Offset: 0, Count: 2, Order: "ASC"}).Result() - -// ZRANGEBYSCORE zset -inf +inf WITHSCORES LIMIT 0 2 -vals, err := rdb.ZRangeByScoreWithScores(ctx, "zset", &redis.ZRangeBy{ - Min: "-inf", - Max: "+inf", - Offset: 0, - Count: 2, -}).Result() - -// ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3 AGGREGATE SUM -vals, err := rdb.ZInterStore(ctx, "out", &redis.ZStore{ - Keys: []string{"zset1", "zset2"}, - Weights: []int64{2, 3} -}).Result() - -// EVAL "return {KEYS[1],ARGV[1]}" 1 "key" "hello" -vals, err := rdb.Eval(ctx, "return {KEYS[1],ARGV[1]}", []string{"key"}, "hello").Result() - -// custom command -res, err := rdb.Do(ctx, "set", "key", "value").Result() -``` - -## Run the test - -go-redis will start a redis-server and run the test cases. - -The paths of redis-server bin file and redis config file are defined in `main_test.go`: - -``` -var ( - redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server")) - redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis", "redis.conf")) -) -``` - -For local testing, you can change the variables to refer to your local files, or create a soft link -to the corresponding folder for redis-server and copy the config file to `testdata/redis/`: - -``` -ln -s /usr/bin/redis-server ./go-redis/testdata/redis/src -cp ./go-redis/testdata/redis.conf ./go-redis/testdata/redis/ -``` - -Lastly, run: - -``` -go test -``` - -## Contributors - -Thanks to all the people who already contributed! - - - - diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/RELEASING.md b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/RELEASING.md deleted file mode 100644 index 1115db4..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/RELEASING.md +++ /dev/null @@ -1,15 +0,0 @@ -# Releasing - -1. Run `release.sh` script which updates versions in go.mod files and pushes a new branch to GitHub: - -```shell -TAG=v1.0.0 ./scripts/release.sh -``` - -2. Open a pull request and wait for the build to finish. - -3. Merge the pull request and run `tag.sh` to create tags for packages: - -```shell -TAG=v1.0.0 ./scripts/tag.sh -``` diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_decode_test.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_decode_test.go deleted file mode 100644 index 8382806..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_decode_test.go +++ /dev/null @@ -1,309 +0,0 @@ -package redis - -import ( - "context" - "fmt" - "io" - "net" - "testing" - "time" - - "github.com/go-redis/redis/v8/internal/proto" -) - -var ctx = context.TODO() - -type ClientStub struct { - Cmdable - resp []byte -} - -func NewClientStub(resp []byte) *ClientStub { - stub := &ClientStub{ - resp: resp, - } - stub.Cmdable = NewClient(&Options{ - PoolSize: 128, - Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { - return stub.stubConn(), nil - }, - }) - return stub -} - -func NewClusterClientStub(resp []byte) *ClientStub { - stub := &ClientStub{ - resp: resp, - } - - client := NewClusterClient(&ClusterOptions{ - PoolSize: 128, - Addrs: []string{"127.0.0.1:6379"}, - Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { - return stub.stubConn(), nil - }, - ClusterSlots: func(_ context.Context) ([]ClusterSlot, error) { - return []ClusterSlot{ - { - Start: 0, - End: 16383, - Nodes: []ClusterNode{{Addr: "127.0.0.1:6379"}}, - }, - }, nil - }, - }) - - // init command. - tmpClient := NewClient(&Options{Addr: ":6379"}) - cmdsInfo, err := tmpClient.Command(ctx).Result() - _ = tmpClient.Close() - client.cmdsInfoCache = newCmdsInfoCache(func(_ context.Context) (map[string]*CommandInfo, error) { - return cmdsInfo, err - }) - - stub.Cmdable = client - return stub -} - -func (c *ClientStub) stubConn() *ConnStub { - return &ConnStub{ - resp: c.resp, - } -} - -type ConnStub struct { - resp []byte - pos int -} - -func (c *ConnStub) Read(b []byte) (n int, err error) { - if len(c.resp) == 0 { - return 0, io.EOF - } - - if c.pos >= len(c.resp) { - c.pos = 0 - } - n = copy(b, c.resp[c.pos:]) - c.pos += n - return n, nil -} - -func (c *ConnStub) Write(b []byte) (n int, err error) { return len(b), nil } -func (c *ConnStub) Close() error { return nil } -func (c *ConnStub) LocalAddr() net.Addr { return nil } -func (c *ConnStub) RemoteAddr() net.Addr { return nil } -func (c *ConnStub) SetDeadline(_ time.Time) error { return nil } -func (c *ConnStub) SetReadDeadline(_ time.Time) error { return nil } -func (c *ConnStub) SetWriteDeadline(_ time.Time) error { return nil } - -type ClientStubFunc func([]byte) *ClientStub - -func BenchmarkDecode(b *testing.B) { - type Benchmark struct { - name string - stub ClientStubFunc - } - - benchmarks := []Benchmark{ - {"single", NewClientStub}, - {"cluster", NewClusterClientStub}, - } - - for _, bench := range benchmarks { - b.Run(fmt.Sprintf("RespError-%s", bench.name), func(b *testing.B) { - respError(b, bench.stub) - }) - b.Run(fmt.Sprintf("RespStatus-%s", bench.name), func(b *testing.B) { - respStatus(b, bench.stub) - }) - b.Run(fmt.Sprintf("RespInt-%s", bench.name), func(b *testing.B) { - respInt(b, bench.stub) - }) - b.Run(fmt.Sprintf("RespString-%s", bench.name), func(b *testing.B) { - respString(b, bench.stub) - }) - b.Run(fmt.Sprintf("RespArray-%s", bench.name), func(b *testing.B) { - respArray(b, bench.stub) - }) - b.Run(fmt.Sprintf("RespPipeline-%s", bench.name), func(b *testing.B) { - respPipeline(b, bench.stub) - }) - b.Run(fmt.Sprintf("RespTxPipeline-%s", bench.name), func(b *testing.B) { - respTxPipeline(b, bench.stub) - }) - - // goroutine - b.Run(fmt.Sprintf("DynamicGoroutine-%s-pool=5", bench.name), func(b *testing.B) { - dynamicGoroutine(b, bench.stub, 5) - }) - b.Run(fmt.Sprintf("DynamicGoroutine-%s-pool=20", bench.name), func(b *testing.B) { - dynamicGoroutine(b, bench.stub, 20) - }) - b.Run(fmt.Sprintf("DynamicGoroutine-%s-pool=50", bench.name), func(b *testing.B) { - dynamicGoroutine(b, bench.stub, 50) - }) - b.Run(fmt.Sprintf("DynamicGoroutine-%s-pool=100", bench.name), func(b *testing.B) { - dynamicGoroutine(b, bench.stub, 100) - }) - - b.Run(fmt.Sprintf("StaticGoroutine-%s-pool=5", bench.name), func(b *testing.B) { - staticGoroutine(b, bench.stub, 5) - }) - b.Run(fmt.Sprintf("StaticGoroutine-%s-pool=20", bench.name), func(b *testing.B) { - staticGoroutine(b, bench.stub, 20) - }) - b.Run(fmt.Sprintf("StaticGoroutine-%s-pool=50", bench.name), func(b *testing.B) { - staticGoroutine(b, bench.stub, 50) - }) - b.Run(fmt.Sprintf("StaticGoroutine-%s-pool=100", bench.name), func(b *testing.B) { - staticGoroutine(b, bench.stub, 100) - }) - } -} - -func respError(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte("-ERR test error\r\n")) - respErr := proto.RedisError("ERR test error") - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if err := rdb.Get(ctx, "key").Err(); err != respErr { - b.Fatalf("response error, got %q, want %q", err, respErr) - } - } -} - -func respStatus(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte("+OK\r\n")) - var val string - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if val = rdb.Set(ctx, "key", "value", 0).Val(); val != "OK" { - b.Fatalf("response error, got %q, want OK", val) - } - } -} - -func respInt(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte(":10\r\n")) - var val int64 - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if val = rdb.Incr(ctx, "key").Val(); val != 10 { - b.Fatalf("response error, got %q, want 10", val) - } - } -} - -func respString(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte("$5\r\nhello\r\n")) - var val string - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if val = rdb.Get(ctx, "key").Val(); val != "hello" { - b.Fatalf("response error, got %q, want hello", val) - } - } -} - -func respArray(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte("*3\r\n$5\r\nhello\r\n:10\r\n+OK\r\n")) - var val []interface{} - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if val = rdb.MGet(ctx, "key").Val(); len(val) != 3 { - b.Fatalf("response error, got len(%d), want len(3)", len(val)) - } - } -} - -func respPipeline(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte("+OK\r\n$5\r\nhello\r\n:1\r\n")) - var pipe Pipeliner - - b.ResetTimer() - for i := 0; i < b.N; i++ { - pipe = rdb.Pipeline() - set := pipe.Set(ctx, "key", "value", 0) - get := pipe.Get(ctx, "key") - del := pipe.Del(ctx, "key") - _, err := pipe.Exec(ctx) - if err != nil { - b.Fatalf("response error, got %q, want nil", err) - } - if set.Val() != "OK" || get.Val() != "hello" || del.Val() != 1 { - b.Fatal("response error") - } - } -} - -func respTxPipeline(b *testing.B, stub ClientStubFunc) { - rdb := stub([]byte("+OK\r\n+QUEUED\r\n+QUEUED\r\n+QUEUED\r\n*3\r\n+OK\r\n$5\r\nhello\r\n:1\r\n")) - - b.ResetTimer() - for i := 0; i < b.N; i++ { - var set *StatusCmd - var get *StringCmd - var del *IntCmd - _, err := rdb.TxPipelined(ctx, func(pipe Pipeliner) error { - set = pipe.Set(ctx, "key", "value", 0) - get = pipe.Get(ctx, "key") - del = pipe.Del(ctx, "key") - return nil - }) - if err != nil { - b.Fatalf("response error, got %q, want nil", err) - } - if set.Val() != "OK" || get.Val() != "hello" || del.Val() != 1 { - b.Fatal("response error") - } - } -} - -func dynamicGoroutine(b *testing.B, stub ClientStubFunc, concurrency int) { - rdb := stub([]byte("$5\r\nhello\r\n")) - c := make(chan struct{}, concurrency) - - b.ResetTimer() - for i := 0; i < b.N; i++ { - c <- struct{}{} - go func() { - if val := rdb.Get(ctx, "key").Val(); val != "hello" { - panic(fmt.Sprintf("response error, got %q, want hello", val)) - } - <-c - }() - } - // Here no longer wait for all goroutines to complete, it will not affect the test results. - close(c) -} - -func staticGoroutine(b *testing.B, stub ClientStubFunc, concurrency int) { - rdb := stub([]byte("$5\r\nhello\r\n")) - c := make(chan struct{}, concurrency) - - b.ResetTimer() - - for i := 0; i < concurrency; i++ { - go func() { - for { - _, ok := <-c - if !ok { - return - } - if val := rdb.Get(ctx, "key").Val(); val != "hello" { - panic(fmt.Sprintf("response error, got %q, want hello", val)) - } - } - }() - } - for i := 0; i < b.N; i++ { - c <- struct{}{} - } - close(c) -} diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_test.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_test.go deleted file mode 100644 index ba81ce8..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/bench_test.go +++ /dev/null @@ -1,412 +0,0 @@ -package redis_test - -import ( - "bytes" - "context" - "fmt" - "strconv" - "strings" - "sync" - "testing" - "time" - - "github.com/go-redis/redis/v8" -) - -func benchmarkRedisClient(ctx context.Context, poolSize int) *redis.Client { - client := redis.NewClient(&redis.Options{ - Addr: ":6379", - DialTimeout: time.Second, - ReadTimeout: time.Second, - WriteTimeout: time.Second, - PoolSize: poolSize, - }) - if err := client.FlushDB(ctx).Err(); err != nil { - panic(err) - } - return client -} - -func BenchmarkRedisPing(b *testing.B) { - ctx := context.Background() - rdb := benchmarkRedisClient(ctx, 10) - defer rdb.Close() - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if err := rdb.Ping(ctx).Err(); err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkSetGoroutines(b *testing.B) { - ctx := context.Background() - rdb := benchmarkRedisClient(ctx, 10) - defer rdb.Close() - - for i := 0; i < b.N; i++ { - var wg sync.WaitGroup - - for i := 0; i < 1000; i++ { - wg.Add(1) - go func() { - defer wg.Done() - - err := rdb.Set(ctx, "hello", "world", 0).Err() - if err != nil { - panic(err) - } - }() - } - - wg.Wait() - } -} - -func BenchmarkRedisGetNil(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if err := client.Get(ctx, "key").Err(); err != redis.Nil { - b.Fatal(err) - } - } - }) -} - -type setStringBenchmark struct { - poolSize int - valueSize int -} - -func (bm setStringBenchmark) String() string { - return fmt.Sprintf("pool=%d value=%d", bm.poolSize, bm.valueSize) -} - -func BenchmarkRedisSetString(b *testing.B) { - benchmarks := []setStringBenchmark{ - {10, 64}, - {10, 1024}, - {10, 64 * 1024}, - {10, 1024 * 1024}, - {10, 10 * 1024 * 1024}, - - {100, 64}, - {100, 1024}, - {100, 64 * 1024}, - {100, 1024 * 1024}, - {100, 10 * 1024 * 1024}, - } - for _, bm := range benchmarks { - b.Run(bm.String(), func(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, bm.poolSize) - defer client.Close() - - value := strings.Repeat("1", bm.valueSize) - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - err := client.Set(ctx, "key", value, 0).Err() - if err != nil { - b.Fatal(err) - } - } - }) - }) - } -} - -func BenchmarkRedisSetGetBytes(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - value := bytes.Repeat([]byte{'1'}, 10000) - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if err := client.Set(ctx, "key", value, 0).Err(); err != nil { - b.Fatal(err) - } - - got, err := client.Get(ctx, "key").Bytes() - if err != nil { - b.Fatal(err) - } - if !bytes.Equal(got, value) { - b.Fatalf("got != value") - } - } - }) -} - -func BenchmarkRedisMGet(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - if err := client.MSet(ctx, "key1", "hello1", "key2", "hello2").Err(); err != nil { - b.Fatal(err) - } - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if err := client.MGet(ctx, "key1", "key2").Err(); err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkSetExpire(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - if err := client.Set(ctx, "key", "hello", 0).Err(); err != nil { - b.Fatal(err) - } - if err := client.Expire(ctx, "key", time.Second).Err(); err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkPipeline(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := client.Pipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Set(ctx, "key", "hello", 0) - pipe.Expire(ctx, "key", time.Second) - return nil - }) - if err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkZAdd(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - err := client.ZAdd(ctx, "key", &redis.Z{ - Score: float64(1), - Member: "hello", - }).Err() - if err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkXRead(b *testing.B) { - ctx := context.Background() - client := benchmarkRedisClient(ctx, 10) - defer client.Close() - - args := redis.XAddArgs{ - Stream: "1", - ID: "*", - Values: map[string]string{"uno": "dos"}, - } - - lenStreams := 16 - streams := make([]string, 0, lenStreams) - for i := 0; i < lenStreams; i++ { - streams = append(streams, strconv.Itoa(i)) - } - for i := 0; i < lenStreams; i++ { - streams = append(streams, "0") - } - - b.ReportAllocs() - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - client.XAdd(ctx, &args) - - err := client.XRead(ctx, &redis.XReadArgs{ - Streams: streams, - Count: 1, - Block: time.Second, - }).Err() - if err != nil { - b.Fatal(err) - } - } - }) -} - -var clientSink *redis.Client - -func BenchmarkWithContext(b *testing.B) { - ctx := context.Background() - rdb := benchmarkRedisClient(ctx, 10) - defer rdb.Close() - - b.ResetTimer() - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - clientSink = rdb.WithContext(ctx) - } -} - -var ringSink *redis.Ring - -func BenchmarkRingWithContext(b *testing.B) { - ctx := context.Background() - rdb := redis.NewRing(&redis.RingOptions{}) - defer rdb.Close() - - b.ResetTimer() - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - ringSink = rdb.WithContext(ctx) - } -} - -//------------------------------------------------------------------------------ - -func newClusterScenario() *clusterScenario { - return &clusterScenario{ - ports: []string{"8220", "8221", "8222", "8223", "8224", "8225"}, - nodeIDs: make([]string, 6), - processes: make(map[string]*redisProcess, 6), - clients: make(map[string]*redis.Client, 6), - } -} - -func BenchmarkClusterPing(b *testing.B) { - if testing.Short() { - b.Skip("skipping in short mode") - } - - ctx := context.Background() - cluster := newClusterScenario() - if err := startCluster(ctx, cluster); err != nil { - b.Fatal(err) - } - defer cluster.Close() - - client := cluster.newClusterClient(ctx, redisClusterOptions()) - defer client.Close() - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - err := client.Ping(ctx).Err() - if err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkClusterDoInt(b *testing.B) { - if testing.Short() { - b.Skip("skipping in short mode") - } - - ctx := context.Background() - cluster := newClusterScenario() - if err := startCluster(ctx, cluster); err != nil { - b.Fatal(err) - } - defer cluster.Close() - - client := cluster.newClusterClient(ctx, redisClusterOptions()) - defer client.Close() - - b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - err := client.Do(ctx, "SET", 10, 10).Err() - if err != nil { - b.Fatal(err) - } - } - }) -} - -func BenchmarkClusterSetString(b *testing.B) { - if testing.Short() { - b.Skip("skipping in short mode") - } - - ctx := context.Background() - cluster := newClusterScenario() - if err := startCluster(ctx, cluster); err != nil { - b.Fatal(err) - } - defer cluster.Close() - - client := cluster.newClusterClient(ctx, redisClusterOptions()) - defer client.Close() - - value := string(bytes.Repeat([]byte{'1'}, 10000)) - - b.ResetTimer() - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - err := client.Set(ctx, "key", value, 0).Err() - if err != nil { - b.Fatal(err) - } - } - }) -} - -var clusterSink *redis.ClusterClient - -func BenchmarkClusterWithContext(b *testing.B) { - ctx := context.Background() - rdb := redis.NewClusterClient(&redis.ClusterOptions{}) - defer rdb.Close() - - b.ResetTimer() - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - clusterSink = rdb.WithContext(ctx) - } -} diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster.go deleted file mode 100644 index a54f2f3..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster.go +++ /dev/null @@ -1,1750 +0,0 @@ -package redis - -import ( - "context" - "crypto/tls" - "fmt" - "math" - "net" - "runtime" - "sort" - "sync" - "sync/atomic" - "time" - - "github.com/go-redis/redis/v8/internal" - "github.com/go-redis/redis/v8/internal/hashtag" - "github.com/go-redis/redis/v8/internal/pool" - "github.com/go-redis/redis/v8/internal/proto" - "github.com/go-redis/redis/v8/internal/rand" -) - -var errClusterNoNodes = fmt.Errorf("redis: cluster has no nodes") - -// ClusterOptions are used to configure a cluster client and should be -// passed to NewClusterClient. -type ClusterOptions struct { - // A seed list of host:port addresses of cluster nodes. - Addrs []string - - // NewClient creates a cluster node client with provided name and options. - NewClient func(opt *Options) *Client - - // The maximum number of retries before giving up. Command is retried - // on network errors and MOVED/ASK redirects. - // Default is 3 retries. - MaxRedirects int - - // Enables read-only commands on slave nodes. - ReadOnly bool - // Allows routing read-only commands to the closest master or slave node. - // It automatically enables ReadOnly. - RouteByLatency bool - // Allows routing read-only commands to the random master or slave node. - // It automatically enables ReadOnly. - RouteRandomly bool - - // Optional function that returns cluster slots information. - // It is useful to manually create cluster of standalone Redis servers - // and load-balance read/write operations between master and slaves. - // It can use service like ZooKeeper to maintain configuration information - // and Cluster.ReloadState to manually trigger state reloading. - ClusterSlots func(context.Context) ([]ClusterSlot, error) - - // Following options are copied from Options struct. - - Dialer func(ctx context.Context, network, addr string) (net.Conn, error) - - OnConnect func(ctx context.Context, cn *Conn) error - - Username string - Password string - - MaxRetries int - MinRetryBackoff time.Duration - MaxRetryBackoff time.Duration - - DialTimeout time.Duration - ReadTimeout time.Duration - WriteTimeout time.Duration - - // PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO). - PoolFIFO bool - - // PoolSize applies per cluster node and not for the whole cluster. - PoolSize int - MinIdleConns int - MaxConnAge time.Duration - PoolTimeout time.Duration - IdleTimeout time.Duration - IdleCheckFrequency time.Duration - - TLSConfig *tls.Config -} - -func (opt *ClusterOptions) init() { - if opt.MaxRedirects == -1 { - opt.MaxRedirects = 0 - } else if opt.MaxRedirects == 0 { - opt.MaxRedirects = 3 - } - - if opt.RouteByLatency || opt.RouteRandomly { - opt.ReadOnly = true - } - - if opt.PoolSize == 0 { - opt.PoolSize = 5 * runtime.GOMAXPROCS(0) - } - - switch opt.ReadTimeout { - case -1: - opt.ReadTimeout = 0 - case 0: - opt.ReadTimeout = 3 * time.Second - } - switch opt.WriteTimeout { - case -1: - opt.WriteTimeout = 0 - case 0: - opt.WriteTimeout = opt.ReadTimeout - } - - if opt.MaxRetries == 0 { - opt.MaxRetries = -1 - } - switch opt.MinRetryBackoff { - case -1: - opt.MinRetryBackoff = 0 - case 0: - opt.MinRetryBackoff = 8 * time.Millisecond - } - switch opt.MaxRetryBackoff { - case -1: - opt.MaxRetryBackoff = 0 - case 0: - opt.MaxRetryBackoff = 512 * time.Millisecond - } - - if opt.NewClient == nil { - opt.NewClient = NewClient - } -} - -func (opt *ClusterOptions) clientOptions() *Options { - const disableIdleCheck = -1 - - return &Options{ - Dialer: opt.Dialer, - OnConnect: opt.OnConnect, - - Username: opt.Username, - Password: opt.Password, - - MaxRetries: opt.MaxRetries, - MinRetryBackoff: opt.MinRetryBackoff, - MaxRetryBackoff: opt.MaxRetryBackoff, - - DialTimeout: opt.DialTimeout, - ReadTimeout: opt.ReadTimeout, - WriteTimeout: opt.WriteTimeout, - - PoolFIFO: opt.PoolFIFO, - PoolSize: opt.PoolSize, - MinIdleConns: opt.MinIdleConns, - MaxConnAge: opt.MaxConnAge, - PoolTimeout: opt.PoolTimeout, - IdleTimeout: opt.IdleTimeout, - IdleCheckFrequency: disableIdleCheck, - - TLSConfig: opt.TLSConfig, - // If ClusterSlots is populated, then we probably have an artificial - // cluster whose nodes are not in clustering mode (otherwise there isn't - // much use for ClusterSlots config). This means we cannot execute the - // READONLY command against that node -- setting readOnly to false in such - // situations in the options below will prevent that from happening. - readOnly: opt.ReadOnly && opt.ClusterSlots == nil, - } -} - -//------------------------------------------------------------------------------ - -type clusterNode struct { - Client *Client - - latency uint32 // atomic - generation uint32 // atomic - failing uint32 // atomic -} - -func newClusterNode(clOpt *ClusterOptions, addr string) *clusterNode { - opt := clOpt.clientOptions() - opt.Addr = addr - node := clusterNode{ - Client: clOpt.NewClient(opt), - } - - node.latency = math.MaxUint32 - if clOpt.RouteByLatency { - go node.updateLatency() - } - - return &node -} - -func (n *clusterNode) String() string { - return n.Client.String() -} - -func (n *clusterNode) Close() error { - return n.Client.Close() -} - -func (n *clusterNode) updateLatency() { - const numProbe = 10 - var dur uint64 - - for i := 0; i < numProbe; i++ { - time.Sleep(time.Duration(10+rand.Intn(10)) * time.Millisecond) - - start := time.Now() - n.Client.Ping(context.TODO()) - dur += uint64(time.Since(start) / time.Microsecond) - } - - latency := float64(dur) / float64(numProbe) - atomic.StoreUint32(&n.latency, uint32(latency+0.5)) -} - -func (n *clusterNode) Latency() time.Duration { - latency := atomic.LoadUint32(&n.latency) - return time.Duration(latency) * time.Microsecond -} - -func (n *clusterNode) MarkAsFailing() { - atomic.StoreUint32(&n.failing, uint32(time.Now().Unix())) -} - -func (n *clusterNode) Failing() bool { - const timeout = 15 // 15 seconds - - failing := atomic.LoadUint32(&n.failing) - if failing == 0 { - return false - } - if time.Now().Unix()-int64(failing) < timeout { - return true - } - atomic.StoreUint32(&n.failing, 0) - return false -} - -func (n *clusterNode) Generation() uint32 { - return atomic.LoadUint32(&n.generation) -} - -func (n *clusterNode) SetGeneration(gen uint32) { - for { - v := atomic.LoadUint32(&n.generation) - if gen < v || atomic.CompareAndSwapUint32(&n.generation, v, gen) { - break - } - } -} - -//------------------------------------------------------------------------------ - -type clusterNodes struct { - opt *ClusterOptions - - mu sync.RWMutex - addrs []string - nodes map[string]*clusterNode - activeAddrs []string - closed bool - - _generation uint32 // atomic -} - -func newClusterNodes(opt *ClusterOptions) *clusterNodes { - return &clusterNodes{ - opt: opt, - - addrs: opt.Addrs, - nodes: make(map[string]*clusterNode), - } -} - -func (c *clusterNodes) Close() error { - c.mu.Lock() - defer c.mu.Unlock() - - if c.closed { - return nil - } - c.closed = true - - var firstErr error - for _, node := range c.nodes { - if err := node.Client.Close(); err != nil && firstErr == nil { - firstErr = err - } - } - - c.nodes = nil - c.activeAddrs = nil - - return firstErr -} - -func (c *clusterNodes) Addrs() ([]string, error) { - var addrs []string - - c.mu.RLock() - closed := c.closed //nolint:ifshort - if !closed { - if len(c.activeAddrs) > 0 { - addrs = c.activeAddrs - } else { - addrs = c.addrs - } - } - c.mu.RUnlock() - - if closed { - return nil, pool.ErrClosed - } - if len(addrs) == 0 { - return nil, errClusterNoNodes - } - return addrs, nil -} - -func (c *clusterNodes) NextGeneration() uint32 { - return atomic.AddUint32(&c._generation, 1) -} - -// GC removes unused nodes. -func (c *clusterNodes) GC(generation uint32) { - //nolint:prealloc - var collected []*clusterNode - - c.mu.Lock() - - c.activeAddrs = c.activeAddrs[:0] - for addr, node := range c.nodes { - if node.Generation() >= generation { - c.activeAddrs = append(c.activeAddrs, addr) - if c.opt.RouteByLatency { - go node.updateLatency() - } - continue - } - - delete(c.nodes, addr) - collected = append(collected, node) - } - - c.mu.Unlock() - - for _, node := range collected { - _ = node.Client.Close() - } -} - -func (c *clusterNodes) GetOrCreate(addr string) (*clusterNode, error) { - node, err := c.get(addr) - if err != nil { - return nil, err - } - if node != nil { - return node, nil - } - - c.mu.Lock() - defer c.mu.Unlock() - - if c.closed { - return nil, pool.ErrClosed - } - - node, ok := c.nodes[addr] - if ok { - return node, nil - } - - node = newClusterNode(c.opt, addr) - - c.addrs = appendIfNotExists(c.addrs, addr) - c.nodes[addr] = node - - return node, nil -} - -func (c *clusterNodes) get(addr string) (*clusterNode, error) { - var node *clusterNode - var err error - c.mu.RLock() - if c.closed { - err = pool.ErrClosed - } else { - node = c.nodes[addr] - } - c.mu.RUnlock() - return node, err -} - -func (c *clusterNodes) All() ([]*clusterNode, error) { - c.mu.RLock() - defer c.mu.RUnlock() - - if c.closed { - return nil, pool.ErrClosed - } - - cp := make([]*clusterNode, 0, len(c.nodes)) - for _, node := range c.nodes { - cp = append(cp, node) - } - return cp, nil -} - -func (c *clusterNodes) Random() (*clusterNode, error) { - addrs, err := c.Addrs() - if err != nil { - return nil, err - } - - n := rand.Intn(len(addrs)) - return c.GetOrCreate(addrs[n]) -} - -//------------------------------------------------------------------------------ - -type clusterSlot struct { - start, end int - nodes []*clusterNode -} - -type clusterSlotSlice []*clusterSlot - -func (p clusterSlotSlice) Len() int { - return len(p) -} - -func (p clusterSlotSlice) Less(i, j int) bool { - return p[i].start < p[j].start -} - -func (p clusterSlotSlice) Swap(i, j int) { - p[i], p[j] = p[j], p[i] -} - -type clusterState struct { - nodes *clusterNodes - Masters []*clusterNode - Slaves []*clusterNode - - slots []*clusterSlot - - generation uint32 - createdAt time.Time -} - -func newClusterState( - nodes *clusterNodes, slots []ClusterSlot, origin string, -) (*clusterState, error) { - c := clusterState{ - nodes: nodes, - - slots: make([]*clusterSlot, 0, len(slots)), - - generation: nodes.NextGeneration(), - createdAt: time.Now(), - } - - originHost, _, _ := net.SplitHostPort(origin) - isLoopbackOrigin := isLoopback(originHost) - - for _, slot := range slots { - var nodes []*clusterNode - for i, slotNode := range slot.Nodes { - addr := slotNode.Addr - if !isLoopbackOrigin { - addr = replaceLoopbackHost(addr, originHost) - } - - node, err := c.nodes.GetOrCreate(addr) - if err != nil { - return nil, err - } - - node.SetGeneration(c.generation) - nodes = append(nodes, node) - - if i == 0 { - c.Masters = appendUniqueNode(c.Masters, node) - } else { - c.Slaves = appendUniqueNode(c.Slaves, node) - } - } - - c.slots = append(c.slots, &clusterSlot{ - start: slot.Start, - end: slot.End, - nodes: nodes, - }) - } - - sort.Sort(clusterSlotSlice(c.slots)) - - time.AfterFunc(time.Minute, func() { - nodes.GC(c.generation) - }) - - return &c, nil -} - -func replaceLoopbackHost(nodeAddr, originHost string) string { - nodeHost, nodePort, err := net.SplitHostPort(nodeAddr) - if err != nil { - return nodeAddr - } - - nodeIP := net.ParseIP(nodeHost) - if nodeIP == nil { - return nodeAddr - } - - if !nodeIP.IsLoopback() { - return nodeAddr - } - - // Use origin host which is not loopback and node port. - return net.JoinHostPort(originHost, nodePort) -} - -func isLoopback(host string) bool { - ip := net.ParseIP(host) - if ip == nil { - return true - } - return ip.IsLoopback() -} - -func (c *clusterState) slotMasterNode(slot int) (*clusterNode, error) { - nodes := c.slotNodes(slot) - if len(nodes) > 0 { - return nodes[0], nil - } - return c.nodes.Random() -} - -func (c *clusterState) slotSlaveNode(slot int) (*clusterNode, error) { - nodes := c.slotNodes(slot) - switch len(nodes) { - case 0: - return c.nodes.Random() - case 1: - return nodes[0], nil - case 2: - if slave := nodes[1]; !slave.Failing() { - return slave, nil - } - return nodes[0], nil - default: - var slave *clusterNode - for i := 0; i < 10; i++ { - n := rand.Intn(len(nodes)-1) + 1 - slave = nodes[n] - if !slave.Failing() { - return slave, nil - } - } - - // All slaves are loading - use master. - return nodes[0], nil - } -} - -func (c *clusterState) slotClosestNode(slot int) (*clusterNode, error) { - nodes := c.slotNodes(slot) - if len(nodes) == 0 { - return c.nodes.Random() - } - - var node *clusterNode - for _, n := range nodes { - if n.Failing() { - continue - } - if node == nil || n.Latency() < node.Latency() { - node = n - } - } - if node != nil { - return node, nil - } - - // If all nodes are failing - return random node - return c.nodes.Random() -} - -func (c *clusterState) slotRandomNode(slot int) (*clusterNode, error) { - nodes := c.slotNodes(slot) - if len(nodes) == 0 { - return c.nodes.Random() - } - if len(nodes) == 1 { - return nodes[0], nil - } - randomNodes := rand.Perm(len(nodes)) - for _, idx := range randomNodes { - if node := nodes[idx]; !node.Failing() { - return node, nil - } - } - return nodes[randomNodes[0]], nil -} - -func (c *clusterState) slotNodes(slot int) []*clusterNode { - i := sort.Search(len(c.slots), func(i int) bool { - return c.slots[i].end >= slot - }) - if i >= len(c.slots) { - return nil - } - x := c.slots[i] - if slot >= x.start && slot <= x.end { - return x.nodes - } - return nil -} - -//------------------------------------------------------------------------------ - -type clusterStateHolder struct { - load func(ctx context.Context) (*clusterState, error) - - state atomic.Value - reloading uint32 // atomic -} - -func newClusterStateHolder(fn func(ctx context.Context) (*clusterState, error)) *clusterStateHolder { - return &clusterStateHolder{ - load: fn, - } -} - -func (c *clusterStateHolder) Reload(ctx context.Context) (*clusterState, error) { - state, err := c.load(ctx) - if err != nil { - return nil, err - } - c.state.Store(state) - return state, nil -} - -func (c *clusterStateHolder) LazyReload() { - if !atomic.CompareAndSwapUint32(&c.reloading, 0, 1) { - return - } - go func() { - defer atomic.StoreUint32(&c.reloading, 0) - - _, err := c.Reload(context.Background()) - if err != nil { - return - } - time.Sleep(200 * time.Millisecond) - }() -} - -func (c *clusterStateHolder) Get(ctx context.Context) (*clusterState, error) { - v := c.state.Load() - if v == nil { - return c.Reload(ctx) - } - - state := v.(*clusterState) - if time.Since(state.createdAt) > 10*time.Second { - c.LazyReload() - } - return state, nil -} - -func (c *clusterStateHolder) ReloadOrGet(ctx context.Context) (*clusterState, error) { - state, err := c.Reload(ctx) - if err == nil { - return state, nil - } - return c.Get(ctx) -} - -//------------------------------------------------------------------------------ - -type clusterClient struct { - opt *ClusterOptions - nodes *clusterNodes - state *clusterStateHolder //nolint:structcheck - cmdsInfoCache *cmdsInfoCache //nolint:structcheck -} - -// ClusterClient is a Redis Cluster client representing a pool of zero -// or more underlying connections. It's safe for concurrent use by -// multiple goroutines. -type ClusterClient struct { - *clusterClient - cmdable - hooks - ctx context.Context -} - -// NewClusterClient returns a Redis Cluster client as described in -// http://redis.io/topics/cluster-spec. -func NewClusterClient(opt *ClusterOptions) *ClusterClient { - opt.init() - - c := &ClusterClient{ - clusterClient: &clusterClient{ - opt: opt, - nodes: newClusterNodes(opt), - }, - ctx: context.Background(), - } - c.state = newClusterStateHolder(c.loadState) - c.cmdsInfoCache = newCmdsInfoCache(c.cmdsInfo) - c.cmdable = c.Process - - if opt.IdleCheckFrequency > 0 { - go c.reaper(opt.IdleCheckFrequency) - } - - return c -} - -func (c *ClusterClient) Context() context.Context { - return c.ctx -} - -func (c *ClusterClient) WithContext(ctx context.Context) *ClusterClient { - if ctx == nil { - panic("nil context") - } - clone := *c - clone.cmdable = clone.Process - clone.hooks.lock() - clone.ctx = ctx - return &clone -} - -// Options returns read-only Options that were used to create the client. -func (c *ClusterClient) Options() *ClusterOptions { - return c.opt -} - -// ReloadState reloads cluster state. If available it calls ClusterSlots func -// to get cluster slots information. -func (c *ClusterClient) ReloadState(ctx context.Context) { - c.state.LazyReload() -} - -// Close closes the cluster client, releasing any open resources. -// -// It is rare to Close a ClusterClient, as the ClusterClient is meant -// to be long-lived and shared between many goroutines. -func (c *ClusterClient) Close() error { - return c.nodes.Close() -} - -// Do creates a Cmd from the args and processes the cmd. -func (c *ClusterClient) Do(ctx context.Context, args ...interface{}) *Cmd { - cmd := NewCmd(ctx, args...) - _ = c.Process(ctx, cmd) - return cmd -} - -func (c *ClusterClient) Process(ctx context.Context, cmd Cmder) error { - return c.hooks.process(ctx, cmd, c.process) -} - -func (c *ClusterClient) process(ctx context.Context, cmd Cmder) error { - cmdInfo := c.cmdInfo(cmd.Name()) - slot := c.cmdSlot(cmd) - - var node *clusterNode - var ask bool - var lastErr error - for attempt := 0; attempt <= c.opt.MaxRedirects; attempt++ { - if attempt > 0 { - if err := internal.Sleep(ctx, c.retryBackoff(attempt)); err != nil { - return err - } - } - - if node == nil { - var err error - node, err = c.cmdNode(ctx, cmdInfo, slot) - if err != nil { - return err - } - } - - if ask { - pipe := node.Client.Pipeline() - _ = pipe.Process(ctx, NewCmd(ctx, "asking")) - _ = pipe.Process(ctx, cmd) - _, lastErr = pipe.Exec(ctx) - _ = pipe.Close() - ask = false - } else { - lastErr = node.Client.Process(ctx, cmd) - } - - // If there is no error - we are done. - if lastErr == nil { - return nil - } - if isReadOnly := isReadOnlyError(lastErr); isReadOnly || lastErr == pool.ErrClosed { - if isReadOnly { - c.state.LazyReload() - } - node = nil - continue - } - - // If slave is loading - pick another node. - if c.opt.ReadOnly && isLoadingError(lastErr) { - node.MarkAsFailing() - node = nil - continue - } - - var moved bool - var addr string - moved, ask, addr = isMovedError(lastErr) - if moved || ask { - c.state.LazyReload() - - var err error - node, err = c.nodes.GetOrCreate(addr) - if err != nil { - return err - } - continue - } - - if shouldRetry(lastErr, cmd.readTimeout() == nil) { - // First retry the same node. - if attempt == 0 { - continue - } - - // Second try another node. - node.MarkAsFailing() - node = nil - continue - } - - return lastErr - } - return lastErr -} - -// ForEachMaster concurrently calls the fn on each master node in the cluster. -// It returns the first error if any. -func (c *ClusterClient) ForEachMaster( - ctx context.Context, - fn func(ctx context.Context, client *Client) error, -) error { - state, err := c.state.ReloadOrGet(ctx) - if err != nil { - return err - } - - var wg sync.WaitGroup - errCh := make(chan error, 1) - - for _, master := range state.Masters { - wg.Add(1) - go func(node *clusterNode) { - defer wg.Done() - err := fn(ctx, node.Client) - if err != nil { - select { - case errCh <- err: - default: - } - } - }(master) - } - - wg.Wait() - - select { - case err := <-errCh: - return err - default: - return nil - } -} - -// ForEachSlave concurrently calls the fn on each slave node in the cluster. -// It returns the first error if any. -func (c *ClusterClient) ForEachSlave( - ctx context.Context, - fn func(ctx context.Context, client *Client) error, -) error { - state, err := c.state.ReloadOrGet(ctx) - if err != nil { - return err - } - - var wg sync.WaitGroup - errCh := make(chan error, 1) - - for _, slave := range state.Slaves { - wg.Add(1) - go func(node *clusterNode) { - defer wg.Done() - err := fn(ctx, node.Client) - if err != nil { - select { - case errCh <- err: - default: - } - } - }(slave) - } - - wg.Wait() - - select { - case err := <-errCh: - return err - default: - return nil - } -} - -// ForEachShard concurrently calls the fn on each known node in the cluster. -// It returns the first error if any. -func (c *ClusterClient) ForEachShard( - ctx context.Context, - fn func(ctx context.Context, client *Client) error, -) error { - state, err := c.state.ReloadOrGet(ctx) - if err != nil { - return err - } - - var wg sync.WaitGroup - errCh := make(chan error, 1) - - worker := func(node *clusterNode) { - defer wg.Done() - err := fn(ctx, node.Client) - if err != nil { - select { - case errCh <- err: - default: - } - } - } - - for _, node := range state.Masters { - wg.Add(1) - go worker(node) - } - for _, node := range state.Slaves { - wg.Add(1) - go worker(node) - } - - wg.Wait() - - select { - case err := <-errCh: - return err - default: - return nil - } -} - -// PoolStats returns accumulated connection pool stats. -func (c *ClusterClient) PoolStats() *PoolStats { - var acc PoolStats - - state, _ := c.state.Get(context.TODO()) - if state == nil { - return &acc - } - - for _, node := range state.Masters { - s := node.Client.connPool.Stats() - acc.Hits += s.Hits - acc.Misses += s.Misses - acc.Timeouts += s.Timeouts - - acc.TotalConns += s.TotalConns - acc.IdleConns += s.IdleConns - acc.StaleConns += s.StaleConns - } - - for _, node := range state.Slaves { - s := node.Client.connPool.Stats() - acc.Hits += s.Hits - acc.Misses += s.Misses - acc.Timeouts += s.Timeouts - - acc.TotalConns += s.TotalConns - acc.IdleConns += s.IdleConns - acc.StaleConns += s.StaleConns - } - - return &acc -} - -func (c *ClusterClient) loadState(ctx context.Context) (*clusterState, error) { - if c.opt.ClusterSlots != nil { - slots, err := c.opt.ClusterSlots(ctx) - if err != nil { - return nil, err - } - return newClusterState(c.nodes, slots, "") - } - - addrs, err := c.nodes.Addrs() - if err != nil { - return nil, err - } - - var firstErr error - - for _, idx := range rand.Perm(len(addrs)) { - addr := addrs[idx] - - node, err := c.nodes.GetOrCreate(addr) - if err != nil { - if firstErr == nil { - firstErr = err - } - continue - } - - slots, err := node.Client.ClusterSlots(ctx).Result() - if err != nil { - if firstErr == nil { - firstErr = err - } - continue - } - - return newClusterState(c.nodes, slots, node.Client.opt.Addr) - } - - /* - * No node is connectable. It's possible that all nodes' IP has changed. - * Clear activeAddrs to let client be able to re-connect using the initial - * setting of the addresses (e.g. [redis-cluster-0:6379, redis-cluster-1:6379]), - * which might have chance to resolve domain name and get updated IP address. - */ - c.nodes.mu.Lock() - c.nodes.activeAddrs = nil - c.nodes.mu.Unlock() - - return nil, firstErr -} - -// reaper closes idle connections to the cluster. -func (c *ClusterClient) reaper(idleCheckFrequency time.Duration) { - ticker := time.NewTicker(idleCheckFrequency) - defer ticker.Stop() - - for range ticker.C { - nodes, err := c.nodes.All() - if err != nil { - break - } - - for _, node := range nodes { - _, err := node.Client.connPool.(*pool.ConnPool).ReapStaleConns() - if err != nil { - internal.Logger.Printf(c.Context(), "ReapStaleConns failed: %s", err) - } - } - } -} - -func (c *ClusterClient) Pipeline() Pipeliner { - pipe := Pipeline{ - ctx: c.ctx, - exec: c.processPipeline, - } - pipe.init() - return &pipe -} - -func (c *ClusterClient) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { - return c.Pipeline().Pipelined(ctx, fn) -} - -func (c *ClusterClient) processPipeline(ctx context.Context, cmds []Cmder) error { - return c.hooks.processPipeline(ctx, cmds, c._processPipeline) -} - -func (c *ClusterClient) _processPipeline(ctx context.Context, cmds []Cmder) error { - cmdsMap := newCmdsMap() - err := c.mapCmdsByNode(ctx, cmdsMap, cmds) - if err != nil { - setCmdsErr(cmds, err) - return err - } - - for attempt := 0; attempt <= c.opt.MaxRedirects; attempt++ { - if attempt > 0 { - if err := internal.Sleep(ctx, c.retryBackoff(attempt)); err != nil { - setCmdsErr(cmds, err) - return err - } - } - - failedCmds := newCmdsMap() - var wg sync.WaitGroup - - for node, cmds := range cmdsMap.m { - wg.Add(1) - go func(node *clusterNode, cmds []Cmder) { - defer wg.Done() - - err := c._processPipelineNode(ctx, node, cmds, failedCmds) - if err == nil { - return - } - if attempt < c.opt.MaxRedirects { - if err := c.mapCmdsByNode(ctx, failedCmds, cmds); err != nil { - setCmdsErr(cmds, err) - } - } else { - setCmdsErr(cmds, err) - } - }(node, cmds) - } - - wg.Wait() - if len(failedCmds.m) == 0 { - break - } - cmdsMap = failedCmds - } - - return cmdsFirstErr(cmds) -} - -func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmds []Cmder) error { - state, err := c.state.Get(ctx) - if err != nil { - return err - } - - if c.opt.ReadOnly && c.cmdsAreReadOnly(cmds) { - for _, cmd := range cmds { - slot := c.cmdSlot(cmd) - node, err := c.slotReadOnlyNode(state, slot) - if err != nil { - return err - } - cmdsMap.Add(node, cmd) - } - return nil - } - - for _, cmd := range cmds { - slot := c.cmdSlot(cmd) - node, err := state.slotMasterNode(slot) - if err != nil { - return err - } - cmdsMap.Add(node, cmd) - } - return nil -} - -func (c *ClusterClient) cmdsAreReadOnly(cmds []Cmder) bool { - for _, cmd := range cmds { - cmdInfo := c.cmdInfo(cmd.Name()) - if cmdInfo == nil || !cmdInfo.ReadOnly { - return false - } - } - return true -} - -func (c *ClusterClient) _processPipelineNode( - ctx context.Context, node *clusterNode, cmds []Cmder, failedCmds *cmdsMap, -) error { - return node.Client.hooks.processPipeline(ctx, cmds, func(ctx context.Context, cmds []Cmder) error { - return node.Client.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error { - err := cn.WithWriter(ctx, c.opt.WriteTimeout, func(wr *proto.Writer) error { - return writeCmds(wr, cmds) - }) - if err != nil { - return err - } - - return cn.WithReader(ctx, c.opt.ReadTimeout, func(rd *proto.Reader) error { - return c.pipelineReadCmds(ctx, node, rd, cmds, failedCmds) - }) - }) - }) -} - -func (c *ClusterClient) pipelineReadCmds( - ctx context.Context, - node *clusterNode, - rd *proto.Reader, - cmds []Cmder, - failedCmds *cmdsMap, -) error { - for _, cmd := range cmds { - err := cmd.readReply(rd) - cmd.SetErr(err) - - if err == nil { - continue - } - - if c.checkMovedErr(ctx, cmd, err, failedCmds) { - continue - } - - if c.opt.ReadOnly && isLoadingError(err) { - node.MarkAsFailing() - return err - } - if isRedisError(err) { - continue - } - return err - } - return nil -} - -func (c *ClusterClient) checkMovedErr( - ctx context.Context, cmd Cmder, err error, failedCmds *cmdsMap, -) bool { - moved, ask, addr := isMovedError(err) - if !moved && !ask { - return false - } - - node, err := c.nodes.GetOrCreate(addr) - if err != nil { - return false - } - - if moved { - c.state.LazyReload() - failedCmds.Add(node, cmd) - return true - } - - if ask { - failedCmds.Add(node, NewCmd(ctx, "asking"), cmd) - return true - } - - panic("not reached") -} - -// TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC. -func (c *ClusterClient) TxPipeline() Pipeliner { - pipe := Pipeline{ - ctx: c.ctx, - exec: c.processTxPipeline, - } - pipe.init() - return &pipe -} - -func (c *ClusterClient) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { - return c.TxPipeline().Pipelined(ctx, fn) -} - -func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) error { - return c.hooks.processTxPipeline(ctx, cmds, c._processTxPipeline) -} - -func (c *ClusterClient) _processTxPipeline(ctx context.Context, cmds []Cmder) error { - // Trim multi .. exec. - cmds = cmds[1 : len(cmds)-1] - - state, err := c.state.Get(ctx) - if err != nil { - setCmdsErr(cmds, err) - return err - } - - cmdsMap := c.mapCmdsBySlot(cmds) - for slot, cmds := range cmdsMap { - node, err := state.slotMasterNode(slot) - if err != nil { - setCmdsErr(cmds, err) - continue - } - - cmdsMap := map[*clusterNode][]Cmder{node: cmds} - for attempt := 0; attempt <= c.opt.MaxRedirects; attempt++ { - if attempt > 0 { - if err := internal.Sleep(ctx, c.retryBackoff(attempt)); err != nil { - setCmdsErr(cmds, err) - return err - } - } - - failedCmds := newCmdsMap() - var wg sync.WaitGroup - - for node, cmds := range cmdsMap { - wg.Add(1) - go func(node *clusterNode, cmds []Cmder) { - defer wg.Done() - - err := c._processTxPipelineNode(ctx, node, cmds, failedCmds) - if err == nil { - return - } - - if attempt < c.opt.MaxRedirects { - if err := c.mapCmdsByNode(ctx, failedCmds, cmds); err != nil { - setCmdsErr(cmds, err) - } - } else { - setCmdsErr(cmds, err) - } - }(node, cmds) - } - - wg.Wait() - if len(failedCmds.m) == 0 { - break - } - cmdsMap = failedCmds.m - } - } - - return cmdsFirstErr(cmds) -} - -func (c *ClusterClient) mapCmdsBySlot(cmds []Cmder) map[int][]Cmder { - cmdsMap := make(map[int][]Cmder) - for _, cmd := range cmds { - slot := c.cmdSlot(cmd) - cmdsMap[slot] = append(cmdsMap[slot], cmd) - } - return cmdsMap -} - -func (c *ClusterClient) _processTxPipelineNode( - ctx context.Context, node *clusterNode, cmds []Cmder, failedCmds *cmdsMap, -) error { - return node.Client.hooks.processTxPipeline(ctx, cmds, func(ctx context.Context, cmds []Cmder) error { - return node.Client.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error { - err := cn.WithWriter(ctx, c.opt.WriteTimeout, func(wr *proto.Writer) error { - return writeCmds(wr, cmds) - }) - if err != nil { - return err - } - - return cn.WithReader(ctx, c.opt.ReadTimeout, func(rd *proto.Reader) error { - statusCmd := cmds[0].(*StatusCmd) - // Trim multi and exec. - cmds = cmds[1 : len(cmds)-1] - - err := c.txPipelineReadQueued(ctx, rd, statusCmd, cmds, failedCmds) - if err != nil { - moved, ask, addr := isMovedError(err) - if moved || ask { - return c.cmdsMoved(ctx, cmds, moved, ask, addr, failedCmds) - } - return err - } - - return pipelineReadCmds(rd, cmds) - }) - }) - }) -} - -func (c *ClusterClient) txPipelineReadQueued( - ctx context.Context, - rd *proto.Reader, - statusCmd *StatusCmd, - cmds []Cmder, - failedCmds *cmdsMap, -) error { - // Parse queued replies. - if err := statusCmd.readReply(rd); err != nil { - return err - } - - for _, cmd := range cmds { - err := statusCmd.readReply(rd) - if err == nil || c.checkMovedErr(ctx, cmd, err, failedCmds) || isRedisError(err) { - continue - } - return err - } - - // Parse number of replies. - line, err := rd.ReadLine() - if err != nil { - if err == Nil { - err = TxFailedErr - } - return err - } - - switch line[0] { - case proto.ErrorReply: - return proto.ParseErrorReply(line) - case proto.ArrayReply: - // ok - default: - return fmt.Errorf("redis: expected '*', but got line %q", line) - } - - return nil -} - -func (c *ClusterClient) cmdsMoved( - ctx context.Context, cmds []Cmder, - moved, ask bool, - addr string, - failedCmds *cmdsMap, -) error { - node, err := c.nodes.GetOrCreate(addr) - if err != nil { - return err - } - - if moved { - c.state.LazyReload() - for _, cmd := range cmds { - failedCmds.Add(node, cmd) - } - return nil - } - - if ask { - for _, cmd := range cmds { - failedCmds.Add(node, NewCmd(ctx, "asking"), cmd) - } - return nil - } - - return nil -} - -func (c *ClusterClient) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error { - if len(keys) == 0 { - return fmt.Errorf("redis: Watch requires at least one key") - } - - slot := hashtag.Slot(keys[0]) - for _, key := range keys[1:] { - if hashtag.Slot(key) != slot { - err := fmt.Errorf("redis: Watch requires all keys to be in the same slot") - return err - } - } - - node, err := c.slotMasterNode(ctx, slot) - if err != nil { - return err - } - - for attempt := 0; attempt <= c.opt.MaxRedirects; attempt++ { - if attempt > 0 { - if err := internal.Sleep(ctx, c.retryBackoff(attempt)); err != nil { - return err - } - } - - err = node.Client.Watch(ctx, fn, keys...) - if err == nil { - break - } - - moved, ask, addr := isMovedError(err) - if moved || ask { - node, err = c.nodes.GetOrCreate(addr) - if err != nil { - return err - } - continue - } - - if isReadOnly := isReadOnlyError(err); isReadOnly || err == pool.ErrClosed { - if isReadOnly { - c.state.LazyReload() - } - node, err = c.slotMasterNode(ctx, slot) - if err != nil { - return err - } - continue - } - - if shouldRetry(err, true) { - continue - } - - return err - } - - return err -} - -func (c *ClusterClient) pubSub() *PubSub { - var node *clusterNode - pubsub := &PubSub{ - opt: c.opt.clientOptions(), - - newConn: func(ctx context.Context, channels []string) (*pool.Conn, error) { - if node != nil { - panic("node != nil") - } - - var err error - if len(channels) > 0 { - slot := hashtag.Slot(channels[0]) - node, err = c.slotMasterNode(ctx, slot) - } else { - node, err = c.nodes.Random() - } - if err != nil { - return nil, err - } - - cn, err := node.Client.newConn(context.TODO()) - if err != nil { - node = nil - - return nil, err - } - - return cn, nil - }, - closeConn: func(cn *pool.Conn) error { - err := node.Client.connPool.CloseConn(cn) - node = nil - return err - }, - } - pubsub.init() - - return pubsub -} - -// Subscribe subscribes the client to the specified channels. -// Channels can be omitted to create empty subscription. -func (c *ClusterClient) Subscribe(ctx context.Context, channels ...string) *PubSub { - pubsub := c.pubSub() - if len(channels) > 0 { - _ = pubsub.Subscribe(ctx, channels...) - } - return pubsub -} - -// PSubscribe subscribes the client to the given patterns. -// Patterns can be omitted to create empty subscription. -func (c *ClusterClient) PSubscribe(ctx context.Context, channels ...string) *PubSub { - pubsub := c.pubSub() - if len(channels) > 0 { - _ = pubsub.PSubscribe(ctx, channels...) - } - return pubsub -} - -func (c *ClusterClient) retryBackoff(attempt int) time.Duration { - return internal.RetryBackoff(attempt, c.opt.MinRetryBackoff, c.opt.MaxRetryBackoff) -} - -func (c *ClusterClient) cmdsInfo(ctx context.Context) (map[string]*CommandInfo, error) { - // Try 3 random nodes. - const nodeLimit = 3 - - addrs, err := c.nodes.Addrs() - if err != nil { - return nil, err - } - - var firstErr error - - perm := rand.Perm(len(addrs)) - if len(perm) > nodeLimit { - perm = perm[:nodeLimit] - } - - for _, idx := range perm { - addr := addrs[idx] - - node, err := c.nodes.GetOrCreate(addr) - if err != nil { - if firstErr == nil { - firstErr = err - } - continue - } - - info, err := node.Client.Command(ctx).Result() - if err == nil { - return info, nil - } - if firstErr == nil { - firstErr = err - } - } - - if firstErr == nil { - panic("not reached") - } - return nil, firstErr -} - -func (c *ClusterClient) cmdInfo(name string) *CommandInfo { - cmdsInfo, err := c.cmdsInfoCache.Get(c.ctx) - if err != nil { - return nil - } - - info := cmdsInfo[name] - if info == nil { - internal.Logger.Printf(c.Context(), "info for cmd=%s not found", name) - } - return info -} - -func (c *ClusterClient) cmdSlot(cmd Cmder) int { - args := cmd.Args() - if args[0] == "cluster" && args[1] == "getkeysinslot" { - return args[2].(int) - } - - cmdInfo := c.cmdInfo(cmd.Name()) - return cmdSlot(cmd, cmdFirstKeyPos(cmd, cmdInfo)) -} - -func cmdSlot(cmd Cmder, pos int) int { - if pos == 0 { - return hashtag.RandomSlot() - } - firstKey := cmd.stringArg(pos) - return hashtag.Slot(firstKey) -} - -func (c *ClusterClient) cmdNode( - ctx context.Context, - cmdInfo *CommandInfo, - slot int, -) (*clusterNode, error) { - state, err := c.state.Get(ctx) - if err != nil { - return nil, err - } - - if c.opt.ReadOnly && cmdInfo != nil && cmdInfo.ReadOnly { - return c.slotReadOnlyNode(state, slot) - } - return state.slotMasterNode(slot) -} - -func (c *clusterClient) slotReadOnlyNode(state *clusterState, slot int) (*clusterNode, error) { - if c.opt.RouteByLatency { - return state.slotClosestNode(slot) - } - if c.opt.RouteRandomly { - return state.slotRandomNode(slot) - } - return state.slotSlaveNode(slot) -} - -func (c *ClusterClient) slotMasterNode(ctx context.Context, slot int) (*clusterNode, error) { - state, err := c.state.Get(ctx) - if err != nil { - return nil, err - } - return state.slotMasterNode(slot) -} - -// SlaveForKey gets a client for a replica node to run any command on it. -// This is especially useful if we want to run a particular lua script which has -// only read only commands on the replica. -// This is because other redis commands generally have a flag that points that -// they are read only and automatically run on the replica nodes -// if ClusterOptions.ReadOnly flag is set to true. -func (c *ClusterClient) SlaveForKey(ctx context.Context, key string) (*Client, error) { - state, err := c.state.Get(ctx) - if err != nil { - return nil, err - } - slot := hashtag.Slot(key) - node, err := c.slotReadOnlyNode(state, slot) - if err != nil { - return nil, err - } - return node.Client, err -} - -// MasterForKey return a client to the master node for a particular key. -func (c *ClusterClient) MasterForKey(ctx context.Context, key string) (*Client, error) { - slot := hashtag.Slot(key) - node, err := c.slotMasterNode(ctx, slot) - if err != nil { - return nil, err - } - return node.Client, err -} - -func appendUniqueNode(nodes []*clusterNode, node *clusterNode) []*clusterNode { - for _, n := range nodes { - if n == node { - return nodes - } - } - return append(nodes, node) -} - -func appendIfNotExists(ss []string, es ...string) []string { -loop: - for _, e := range es { - for _, s := range ss { - if s == e { - continue loop - } - } - ss = append(ss, e) - } - return ss -} - -//------------------------------------------------------------------------------ - -type cmdsMap struct { - mu sync.Mutex - m map[*clusterNode][]Cmder -} - -func newCmdsMap() *cmdsMap { - return &cmdsMap{ - m: make(map[*clusterNode][]Cmder), - } -} - -func (m *cmdsMap) Add(node *clusterNode, cmds ...Cmder) { - m.mu.Lock() - m.m[node] = append(m.m[node], cmds...) - m.mu.Unlock() -} diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_commands.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_commands.go deleted file mode 100644 index 085bce8..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_commands.go +++ /dev/null @@ -1,109 +0,0 @@ -package redis - -import ( - "context" - "sync" - "sync/atomic" -) - -func (c *ClusterClient) DBSize(ctx context.Context) *IntCmd { - cmd := NewIntCmd(ctx, "dbsize") - _ = c.hooks.process(ctx, cmd, func(ctx context.Context, _ Cmder) error { - var size int64 - err := c.ForEachMaster(ctx, func(ctx context.Context, master *Client) error { - n, err := master.DBSize(ctx).Result() - if err != nil { - return err - } - atomic.AddInt64(&size, n) - return nil - }) - if err != nil { - cmd.SetErr(err) - } else { - cmd.val = size - } - return nil - }) - return cmd -} - -func (c *ClusterClient) ScriptLoad(ctx context.Context, script string) *StringCmd { - cmd := NewStringCmd(ctx, "script", "load", script) - _ = c.hooks.process(ctx, cmd, func(ctx context.Context, _ Cmder) error { - mu := &sync.Mutex{} - err := c.ForEachShard(ctx, func(ctx context.Context, shard *Client) error { - val, err := shard.ScriptLoad(ctx, script).Result() - if err != nil { - return err - } - - mu.Lock() - if cmd.Val() == "" { - cmd.val = val - } - mu.Unlock() - - return nil - }) - if err != nil { - cmd.SetErr(err) - } - return nil - }) - return cmd -} - -func (c *ClusterClient) ScriptFlush(ctx context.Context) *StatusCmd { - cmd := NewStatusCmd(ctx, "script", "flush") - _ = c.hooks.process(ctx, cmd, func(ctx context.Context, _ Cmder) error { - err := c.ForEachShard(ctx, func(ctx context.Context, shard *Client) error { - return shard.ScriptFlush(ctx).Err() - }) - if err != nil { - cmd.SetErr(err) - } - return nil - }) - return cmd -} - -func (c *ClusterClient) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd { - args := make([]interface{}, 2+len(hashes)) - args[0] = "script" - args[1] = "exists" - for i, hash := range hashes { - args[2+i] = hash - } - cmd := NewBoolSliceCmd(ctx, args...) - - result := make([]bool, len(hashes)) - for i := range result { - result[i] = true - } - - _ = c.hooks.process(ctx, cmd, func(ctx context.Context, _ Cmder) error { - mu := &sync.Mutex{} - err := c.ForEachShard(ctx, func(ctx context.Context, shard *Client) error { - val, err := shard.ScriptExists(ctx, hashes...).Result() - if err != nil { - return err - } - - mu.Lock() - for i, v := range val { - result[i] = result[i] && v - } - mu.Unlock() - - return nil - }) - if err != nil { - cmd.SetErr(err) - } else { - cmd.val = result - } - return nil - }) - return cmd -} diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_test.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_test.go deleted file mode 100644 index 6ee7364..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/cluster_test.go +++ /dev/null @@ -1,1283 +0,0 @@ -package redis_test - -import ( - "context" - "fmt" - "net" - "strconv" - "strings" - "sync" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "github.com/go-redis/redis/v8" - "github.com/go-redis/redis/v8/internal/hashtag" -) - -type clusterScenario struct { - ports []string - nodeIDs []string - processes map[string]*redisProcess - clients map[string]*redis.Client -} - -func (s *clusterScenario) masters() []*redis.Client { - result := make([]*redis.Client, 3) - for pos, port := range s.ports[:3] { - result[pos] = s.clients[port] - } - return result -} - -func (s *clusterScenario) slaves() []*redis.Client { - result := make([]*redis.Client, 3) - for pos, port := range s.ports[3:] { - result[pos] = s.clients[port] - } - return result -} - -func (s *clusterScenario) addrs() []string { - addrs := make([]string, len(s.ports)) - for i, port := range s.ports { - addrs[i] = net.JoinHostPort("127.0.0.1", port) - } - return addrs -} - -func (s *clusterScenario) newClusterClientUnstable(opt *redis.ClusterOptions) *redis.ClusterClient { - opt.Addrs = s.addrs() - return redis.NewClusterClient(opt) -} - -func (s *clusterScenario) newClusterClient( - ctx context.Context, opt *redis.ClusterOptions, -) *redis.ClusterClient { - client := s.newClusterClientUnstable(opt) - - err := eventually(func() error { - if opt.ClusterSlots != nil { - return nil - } - - state, err := client.LoadState(ctx) - if err != nil { - return err - } - - if !state.IsConsistent(ctx) { - return fmt.Errorf("cluster state is not consistent") - } - - return nil - }, 30*time.Second) - if err != nil { - panic(err) - } - - return client -} - -func (s *clusterScenario) Close() error { - for _, port := range s.ports { - processes[port].Close() - delete(processes, port) - } - return nil -} - -func startCluster(ctx context.Context, scenario *clusterScenario) error { - // Start processes and collect node ids - for pos, port := range scenario.ports { - process, err := startRedis(port, "--cluster-enabled", "yes") - if err != nil { - return err - } - - client := redis.NewClient(&redis.Options{ - Addr: ":" + port, - }) - - info, err := client.ClusterNodes(ctx).Result() - if err != nil { - return err - } - - scenario.processes[port] = process - scenario.clients[port] = client - scenario.nodeIDs[pos] = info[:40] - } - - // Meet cluster nodes. - for _, client := range scenario.clients { - err := client.ClusterMeet(ctx, "127.0.0.1", scenario.ports[0]).Err() - if err != nil { - return err - } - } - - // Bootstrap masters. - slots := []int{0, 5000, 10000, 16384} - for pos, master := range scenario.masters() { - err := master.ClusterAddSlotsRange(ctx, slots[pos], slots[pos+1]-1).Err() - if err != nil { - return err - } - } - - // Bootstrap slaves. - for idx, slave := range scenario.slaves() { - masterID := scenario.nodeIDs[idx] - - // Wait until master is available - err := eventually(func() error { - s := slave.ClusterNodes(ctx).Val() - wanted := masterID - if !strings.Contains(s, wanted) { - return fmt.Errorf("%q does not contain %q", s, wanted) - } - return nil - }, 10*time.Second) - if err != nil { - return err - } - - err = slave.ClusterReplicate(ctx, masterID).Err() - if err != nil { - return err - } - } - - // Wait until all nodes have consistent info. - wanted := []redis.ClusterSlot{{ - Start: 0, - End: 4999, - Nodes: []redis.ClusterNode{{ - ID: "", - Addr: "127.0.0.1:8220", - }, { - ID: "", - Addr: "127.0.0.1:8223", - }}, - }, { - Start: 5000, - End: 9999, - Nodes: []redis.ClusterNode{{ - ID: "", - Addr: "127.0.0.1:8221", - }, { - ID: "", - Addr: "127.0.0.1:8224", - }}, - }, { - Start: 10000, - End: 16383, - Nodes: []redis.ClusterNode{{ - ID: "", - Addr: "127.0.0.1:8222", - }, { - ID: "", - Addr: "127.0.0.1:8225", - }}, - }} - for _, client := range scenario.clients { - err := eventually(func() error { - res, err := client.ClusterSlots(ctx).Result() - if err != nil { - return err - } - return assertSlotsEqual(res, wanted) - }, 30*time.Second) - if err != nil { - return err - } - } - - return nil -} - -func assertSlotsEqual(slots, wanted []redis.ClusterSlot) error { -outerLoop: - for _, s2 := range wanted { - for _, s1 := range slots { - if slotEqual(s1, s2) { - continue outerLoop - } - } - return fmt.Errorf("%v not found in %v", s2, slots) - } - return nil -} - -func slotEqual(s1, s2 redis.ClusterSlot) bool { - if s1.Start != s2.Start { - return false - } - if s1.End != s2.End { - return false - } - if len(s1.Nodes) != len(s2.Nodes) { - return false - } - for i, n1 := range s1.Nodes { - if n1.Addr != s2.Nodes[i].Addr { - return false - } - } - return true -} - -//------------------------------------------------------------------------------ - -var _ = Describe("ClusterClient", func() { - var failover bool - var opt *redis.ClusterOptions - var client *redis.ClusterClient - - assertClusterClient := func() { - It("supports WithContext", func() { - ctx, cancel := context.WithCancel(ctx) - cancel() - - err := client.Ping(ctx).Err() - Expect(err).To(MatchError("context canceled")) - }) - - It("should GET/SET/DEL", func() { - err := client.Get(ctx, "A").Err() - Expect(err).To(Equal(redis.Nil)) - - err = client.Set(ctx, "A", "VALUE", 0).Err() - Expect(err).NotTo(HaveOccurred()) - - Eventually(func() string { - return client.Get(ctx, "A").Val() - }, 30*time.Second).Should(Equal("VALUE")) - - cnt, err := client.Del(ctx, "A").Result() - Expect(err).NotTo(HaveOccurred()) - Expect(cnt).To(Equal(int64(1))) - }) - - It("GET follows redirects", func() { - err := client.Set(ctx, "A", "VALUE", 0).Err() - Expect(err).NotTo(HaveOccurred()) - - if !failover { - Eventually(func() int64 { - nodes, err := client.Nodes(ctx, "A") - if err != nil { - return 0 - } - return nodes[1].Client.DBSize(ctx).Val() - }, 30*time.Second).Should(Equal(int64(1))) - - Eventually(func() error { - return client.SwapNodes(ctx, "A") - }, 30*time.Second).ShouldNot(HaveOccurred()) - } - - v, err := client.Get(ctx, "A").Result() - Expect(err).NotTo(HaveOccurred()) - Expect(v).To(Equal("VALUE")) - }) - - It("SET follows redirects", func() { - if !failover { - Eventually(func() error { - return client.SwapNodes(ctx, "A") - }, 30*time.Second).ShouldNot(HaveOccurred()) - } - - err := client.Set(ctx, "A", "VALUE", 0).Err() - Expect(err).NotTo(HaveOccurred()) - - v, err := client.Get(ctx, "A").Result() - Expect(err).NotTo(HaveOccurred()) - Expect(v).To(Equal("VALUE")) - }) - - It("distributes keys", func() { - for i := 0; i < 100; i++ { - err := client.Set(ctx, fmt.Sprintf("key%d", i), "value", 0).Err() - Expect(err).NotTo(HaveOccurred()) - } - - client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - defer GinkgoRecover() - Eventually(func() string { - return master.Info(ctx, "keyspace").Val() - }, 30*time.Second).Should(Or( - ContainSubstring("keys=31"), - ContainSubstring("keys=29"), - ContainSubstring("keys=40"), - )) - return nil - }) - }) - - It("distributes keys when using EVAL", func() { - script := redis.NewScript(` - local r = redis.call('SET', KEYS[1], ARGV[1]) - return r - `) - - var key string - for i := 0; i < 100; i++ { - key = fmt.Sprintf("key%d", i) - err := script.Run(ctx, client, []string{key}, "value").Err() - Expect(err).NotTo(HaveOccurred()) - } - - client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - defer GinkgoRecover() - Eventually(func() string { - return master.Info(ctx, "keyspace").Val() - }, 30*time.Second).Should(Or( - ContainSubstring("keys=31"), - ContainSubstring("keys=29"), - ContainSubstring("keys=40"), - )) - return nil - }) - }) - - It("distributes scripts when using Script Load", func() { - client.ScriptFlush(ctx) - - script := redis.NewScript(`return 'Unique script'`) - - script.Load(ctx, client) - - client.ForEachShard(ctx, func(ctx context.Context, shard *redis.Client) error { - defer GinkgoRecover() - - val, _ := script.Exists(ctx, shard).Result() - Expect(val[0]).To(Equal(true)) - return nil - }) - }) - - It("checks all shards when using Script Exists", func() { - client.ScriptFlush(ctx) - - script := redis.NewScript(`return 'First script'`) - lostScriptSrc := `return 'Lost script'` - lostScript := redis.NewScript(lostScriptSrc) - - script.Load(ctx, client) - client.Do(ctx, "script", "load", lostScriptSrc) - - val, _ := client.ScriptExists(ctx, script.Hash(), lostScript.Hash()).Result() - - Expect(val).To(Equal([]bool{true, false})) - }) - - It("flushes scripts from all shards when using ScriptFlush", func() { - script := redis.NewScript(`return 'Unnecessary script'`) - script.Load(ctx, client) - - val, _ := client.ScriptExists(ctx, script.Hash()).Result() - Expect(val).To(Equal([]bool{true})) - - client.ScriptFlush(ctx) - - val, _ = client.ScriptExists(ctx, script.Hash()).Result() - Expect(val).To(Equal([]bool{false})) - }) - - It("supports Watch", func() { - var incr func(string) error - - // Transactionally increments key using GET and SET commands. - incr = func(key string) error { - err := client.Watch(ctx, func(tx *redis.Tx) error { - n, err := tx.Get(ctx, key).Int64() - if err != nil && err != redis.Nil { - return err - } - - _, err = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Set(ctx, key, strconv.FormatInt(n+1, 10), 0) - return nil - }) - return err - }, key) - if err == redis.TxFailedErr { - return incr(key) - } - return err - } - - var wg sync.WaitGroup - for i := 0; i < 100; i++ { - wg.Add(1) - go func() { - defer GinkgoRecover() - defer wg.Done() - - err := incr("key") - Expect(err).NotTo(HaveOccurred()) - }() - } - wg.Wait() - - Eventually(func() string { - return client.Get(ctx, "key").Val() - }, 30*time.Second).Should(Equal("100")) - }) - - Describe("pipelining", func() { - var pipe *redis.Pipeline - - assertPipeline := func() { - keys := []string{"A", "B", "C", "D", "E", "F", "G"} - - It("follows redirects", func() { - if !failover { - for _, key := range keys { - Eventually(func() error { - return client.SwapNodes(ctx, key) - }, 30*time.Second).ShouldNot(HaveOccurred()) - } - } - - for i, key := range keys { - pipe.Set(ctx, key, key+"_value", 0) - pipe.Expire(ctx, key, time.Duration(i+1)*time.Hour) - } - cmds, err := pipe.Exec(ctx) - Expect(err).NotTo(HaveOccurred()) - Expect(cmds).To(HaveLen(14)) - - _ = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - defer GinkgoRecover() - Eventually(func() int64 { - return node.DBSize(ctx).Val() - }, 30*time.Second).ShouldNot(BeZero()) - return nil - }) - - if !failover { - for _, key := range keys { - Eventually(func() error { - return client.SwapNodes(ctx, key) - }, 30*time.Second).ShouldNot(HaveOccurred()) - } - } - - for _, key := range keys { - pipe.Get(ctx, key) - pipe.TTL(ctx, key) - } - cmds, err = pipe.Exec(ctx) - Expect(err).NotTo(HaveOccurred()) - Expect(cmds).To(HaveLen(14)) - - for i, key := range keys { - get := cmds[i*2].(*redis.StringCmd) - Expect(get.Val()).To(Equal(key + "_value")) - - ttl := cmds[(i*2)+1].(*redis.DurationCmd) - dur := time.Duration(i+1) * time.Hour - Expect(ttl.Val()).To(BeNumerically("~", dur, 30*time.Second)) - } - }) - - It("works with missing keys", func() { - pipe.Set(ctx, "A", "A_value", 0) - pipe.Set(ctx, "C", "C_value", 0) - _, err := pipe.Exec(ctx) - Expect(err).NotTo(HaveOccurred()) - - a := pipe.Get(ctx, "A") - b := pipe.Get(ctx, "B") - c := pipe.Get(ctx, "C") - cmds, err := pipe.Exec(ctx) - Expect(err).To(Equal(redis.Nil)) - Expect(cmds).To(HaveLen(3)) - - Expect(a.Err()).NotTo(HaveOccurred()) - Expect(a.Val()).To(Equal("A_value")) - - Expect(b.Err()).To(Equal(redis.Nil)) - Expect(b.Val()).To(Equal("")) - - Expect(c.Err()).NotTo(HaveOccurred()) - Expect(c.Val()).To(Equal("C_value")) - }) - } - - Describe("with Pipeline", func() { - BeforeEach(func() { - pipe = client.Pipeline().(*redis.Pipeline) - }) - - AfterEach(func() { - Expect(pipe.Close()).NotTo(HaveOccurred()) - }) - - assertPipeline() - }) - - Describe("with TxPipeline", func() { - BeforeEach(func() { - pipe = client.TxPipeline().(*redis.Pipeline) - }) - - AfterEach(func() { - Expect(pipe.Close()).NotTo(HaveOccurred()) - }) - - assertPipeline() - }) - }) - - It("supports PubSub", func() { - pubsub := client.Subscribe(ctx, "mychannel") - defer pubsub.Close() - - Eventually(func() error { - _, err := client.Publish(ctx, "mychannel", "hello").Result() - if err != nil { - return err - } - - msg, err := pubsub.ReceiveTimeout(ctx, time.Second) - if err != nil { - return err - } - - _, ok := msg.(*redis.Message) - if !ok { - return fmt.Errorf("got %T, wanted *redis.Message", msg) - } - - return nil - }, 30*time.Second).ShouldNot(HaveOccurred()) - }) - - It("supports PubSub.Ping without channels", func() { - pubsub := client.Subscribe(ctx) - defer pubsub.Close() - - err := pubsub.Ping(ctx) - Expect(err).NotTo(HaveOccurred()) - }) - } - - Describe("ClusterClient", func() { - BeforeEach(func() { - opt = redisClusterOptions() - client = cluster.newClusterClient(ctx, opt) - - err := client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - _ = client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(client.Close()).NotTo(HaveOccurred()) - }) - - It("returns pool stats", func() { - stats := client.PoolStats() - Expect(stats).To(BeAssignableToTypeOf(&redis.PoolStats{})) - }) - - It("returns an error when there are no attempts left", func() { - opt := redisClusterOptions() - opt.MaxRedirects = -1 - client := cluster.newClusterClient(ctx, opt) - - Eventually(func() error { - return client.SwapNodes(ctx, "A") - }, 30*time.Second).ShouldNot(HaveOccurred()) - - err := client.Get(ctx, "A").Err() - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("MOVED")) - - Expect(client.Close()).NotTo(HaveOccurred()) - }) - - It("calls fn for every master node", func() { - for i := 0; i < 10; i++ { - Expect(client.Set(ctx, strconv.Itoa(i), "", 0).Err()).NotTo(HaveOccurred()) - } - - err := client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - size, err := client.DBSize(ctx).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(size).To(Equal(int64(0))) - }) - - It("should CLUSTER SLOTS", func() { - res, err := client.ClusterSlots(ctx).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(res).To(HaveLen(3)) - - wanted := []redis.ClusterSlot{{ - Start: 0, - End: 4999, - Nodes: []redis.ClusterNode{{ - ID: "", - Addr: "127.0.0.1:8220", - }, { - ID: "", - Addr: "127.0.0.1:8223", - }}, - }, { - Start: 5000, - End: 9999, - Nodes: []redis.ClusterNode{{ - ID: "", - Addr: "127.0.0.1:8221", - }, { - ID: "", - Addr: "127.0.0.1:8224", - }}, - }, { - Start: 10000, - End: 16383, - Nodes: []redis.ClusterNode{{ - ID: "", - Addr: "127.0.0.1:8222", - }, { - ID: "", - Addr: "127.0.0.1:8225", - }}, - }} - Expect(assertSlotsEqual(res, wanted)).NotTo(HaveOccurred()) - }) - - It("should CLUSTER NODES", func() { - res, err := client.ClusterNodes(ctx).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(len(res)).To(BeNumerically(">", 400)) - }) - - It("should CLUSTER INFO", func() { - res, err := client.ClusterInfo(ctx).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(res).To(ContainSubstring("cluster_known_nodes:6")) - }) - - It("should CLUSTER KEYSLOT", func() { - hashSlot, err := client.ClusterKeySlot(ctx, "somekey").Result() - Expect(err).NotTo(HaveOccurred()) - Expect(hashSlot).To(Equal(int64(hashtag.Slot("somekey")))) - }) - - It("should CLUSTER GETKEYSINSLOT", func() { - keys, err := client.ClusterGetKeysInSlot(ctx, hashtag.Slot("somekey"), 1).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(len(keys)).To(Equal(0)) - }) - - It("should CLUSTER COUNT-FAILURE-REPORTS", func() { - n, err := client.ClusterCountFailureReports(ctx, cluster.nodeIDs[0]).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(n).To(Equal(int64(0))) - }) - - It("should CLUSTER COUNTKEYSINSLOT", func() { - n, err := client.ClusterCountKeysInSlot(ctx, 10).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(n).To(Equal(int64(0))) - }) - - It("should CLUSTER SAVECONFIG", func() { - res, err := client.ClusterSaveConfig(ctx).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(res).To(Equal("OK")) - }) - - It("should CLUSTER SLAVES", func() { - nodesList, err := client.ClusterSlaves(ctx, cluster.nodeIDs[0]).Result() - Expect(err).NotTo(HaveOccurred()) - Expect(nodesList).Should(ContainElement(ContainSubstring("slave"))) - Expect(nodesList).Should(HaveLen(1)) - }) - - It("should RANDOMKEY", func() { - const nkeys = 100 - - for i := 0; i < nkeys; i++ { - err := client.Set(ctx, fmt.Sprintf("key%d", i), "value", 0).Err() - Expect(err).NotTo(HaveOccurred()) - } - - var keys []string - addKey := func(key string) { - for _, k := range keys { - if k == key { - return - } - } - keys = append(keys, key) - } - - for i := 0; i < nkeys*10; i++ { - key := client.RandomKey(ctx).Val() - addKey(key) - } - - Expect(len(keys)).To(BeNumerically("~", nkeys, nkeys/10)) - }) - - It("supports Process hook", func() { - err := client.Ping(ctx).Err() - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - return node.Ping(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - var stack []string - - clusterHook := &hook{ - beforeProcess: func(ctx context.Context, cmd redis.Cmder) (context.Context, error) { - Expect(cmd.String()).To(Equal("ping: ")) - stack = append(stack, "cluster.BeforeProcess") - return ctx, nil - }, - afterProcess: func(ctx context.Context, cmd redis.Cmder) error { - Expect(cmd.String()).To(Equal("ping: PONG")) - stack = append(stack, "cluster.AfterProcess") - return nil - }, - } - client.AddHook(clusterHook) - - nodeHook := &hook{ - beforeProcess: func(ctx context.Context, cmd redis.Cmder) (context.Context, error) { - Expect(cmd.String()).To(Equal("ping: ")) - stack = append(stack, "shard.BeforeProcess") - return ctx, nil - }, - afterProcess: func(ctx context.Context, cmd redis.Cmder) error { - Expect(cmd.String()).To(Equal("ping: PONG")) - stack = append(stack, "shard.AfterProcess") - return nil - }, - } - - _ = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - node.AddHook(nodeHook) - return nil - }) - - err = client.Ping(ctx).Err() - Expect(err).NotTo(HaveOccurred()) - Expect(stack).To(Equal([]string{ - "cluster.BeforeProcess", - "shard.BeforeProcess", - "shard.AfterProcess", - "cluster.AfterProcess", - })) - - clusterHook.beforeProcess = nil - clusterHook.afterProcess = nil - nodeHook.beforeProcess = nil - nodeHook.afterProcess = nil - }) - - It("supports Pipeline hook", func() { - err := client.Ping(ctx).Err() - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - return node.Ping(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - var stack []string - - client.AddHook(&hook{ - beforeProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) (context.Context, error) { - Expect(cmds).To(HaveLen(1)) - Expect(cmds[0].String()).To(Equal("ping: ")) - stack = append(stack, "cluster.BeforeProcessPipeline") - return ctx, nil - }, - afterProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) error { - Expect(cmds).To(HaveLen(1)) - Expect(cmds[0].String()).To(Equal("ping: PONG")) - stack = append(stack, "cluster.AfterProcessPipeline") - return nil - }, - }) - - _ = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - node.AddHook(&hook{ - beforeProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) (context.Context, error) { - Expect(cmds).To(HaveLen(1)) - Expect(cmds[0].String()).To(Equal("ping: ")) - stack = append(stack, "shard.BeforeProcessPipeline") - return ctx, nil - }, - afterProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) error { - Expect(cmds).To(HaveLen(1)) - Expect(cmds[0].String()).To(Equal("ping: PONG")) - stack = append(stack, "shard.AfterProcessPipeline") - return nil - }, - }) - return nil - }) - - _, err = client.Pipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Ping(ctx) - return nil - }) - Expect(err).NotTo(HaveOccurred()) - Expect(stack).To(Equal([]string{ - "cluster.BeforeProcessPipeline", - "shard.BeforeProcessPipeline", - "shard.AfterProcessPipeline", - "cluster.AfterProcessPipeline", - })) - }) - - It("supports TxPipeline hook", func() { - err := client.Ping(ctx).Err() - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - return node.Ping(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - var stack []string - - client.AddHook(&hook{ - beforeProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) (context.Context, error) { - Expect(cmds).To(HaveLen(3)) - Expect(cmds[1].String()).To(Equal("ping: ")) - stack = append(stack, "cluster.BeforeProcessPipeline") - return ctx, nil - }, - afterProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) error { - Expect(cmds).To(HaveLen(3)) - Expect(cmds[1].String()).To(Equal("ping: PONG")) - stack = append(stack, "cluster.AfterProcessPipeline") - return nil - }, - }) - - _ = client.ForEachShard(ctx, func(ctx context.Context, node *redis.Client) error { - node.AddHook(&hook{ - beforeProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) (context.Context, error) { - Expect(cmds).To(HaveLen(3)) - Expect(cmds[1].String()).To(Equal("ping: ")) - stack = append(stack, "shard.BeforeProcessPipeline") - return ctx, nil - }, - afterProcessPipeline: func(ctx context.Context, cmds []redis.Cmder) error { - Expect(cmds).To(HaveLen(3)) - Expect(cmds[1].String()).To(Equal("ping: PONG")) - stack = append(stack, "shard.AfterProcessPipeline") - return nil - }, - }) - return nil - }) - - _, err = client.TxPipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Ping(ctx) - return nil - }) - Expect(err).NotTo(HaveOccurred()) - Expect(stack).To(Equal([]string{ - "cluster.BeforeProcessPipeline", - "shard.BeforeProcessPipeline", - "shard.AfterProcessPipeline", - "cluster.AfterProcessPipeline", - })) - }) - - It("should return correct replica for key", func() { - client, err := client.SlaveForKey(ctx, "test") - Expect(err).ToNot(HaveOccurred()) - info := client.Info(ctx, "server") - Expect(info.Val()).Should(ContainSubstring("tcp_port:8224")) - }) - - It("should return correct master for key", func() { - client, err := client.MasterForKey(ctx, "test") - Expect(err).ToNot(HaveOccurred()) - info := client.Info(ctx, "server") - Expect(info.Val()).Should(ContainSubstring("tcp_port:8221")) - }) - - assertClusterClient() - }) - - Describe("ClusterClient with RouteByLatency", func() { - BeforeEach(func() { - opt = redisClusterOptions() - opt.RouteByLatency = true - client = cluster.newClusterClient(ctx, opt) - - err := client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachSlave(ctx, func(ctx context.Context, slave *redis.Client) error { - Eventually(func() int64 { - return client.DBSize(ctx).Val() - }, 30*time.Second).Should(Equal(int64(0))) - return nil - }) - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - err := client.ForEachSlave(ctx, func(ctx context.Context, slave *redis.Client) error { - return slave.ReadWrite(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - err = client.Close() - Expect(err).NotTo(HaveOccurred()) - }) - - assertClusterClient() - }) - - Describe("ClusterClient with ClusterSlots", func() { - BeforeEach(func() { - failover = true - - opt = redisClusterOptions() - opt.ClusterSlots = func(ctx context.Context) ([]redis.ClusterSlot, error) { - slots := []redis.ClusterSlot{{ - Start: 0, - End: 4999, - Nodes: []redis.ClusterNode{{ - Addr: ":" + ringShard1Port, - }}, - }, { - Start: 5000, - End: 9999, - Nodes: []redis.ClusterNode{{ - Addr: ":" + ringShard2Port, - }}, - }, { - Start: 10000, - End: 16383, - Nodes: []redis.ClusterNode{{ - Addr: ":" + ringShard3Port, - }}, - }} - return slots, nil - } - client = cluster.newClusterClient(ctx, opt) - - err := client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachSlave(ctx, func(ctx context.Context, slave *redis.Client) error { - Eventually(func() int64 { - return client.DBSize(ctx).Val() - }, 30*time.Second).Should(Equal(int64(0))) - return nil - }) - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - failover = false - - err := client.Close() - Expect(err).NotTo(HaveOccurred()) - }) - - assertClusterClient() - }) - - Describe("ClusterClient with RouteRandomly and ClusterSlots", func() { - BeforeEach(func() { - failover = true - - opt = redisClusterOptions() - opt.RouteRandomly = true - opt.ClusterSlots = func(ctx context.Context) ([]redis.ClusterSlot, error) { - slots := []redis.ClusterSlot{{ - Start: 0, - End: 4999, - Nodes: []redis.ClusterNode{{ - Addr: ":" + ringShard1Port, - }}, - }, { - Start: 5000, - End: 9999, - Nodes: []redis.ClusterNode{{ - Addr: ":" + ringShard2Port, - }}, - }, { - Start: 10000, - End: 16383, - Nodes: []redis.ClusterNode{{ - Addr: ":" + ringShard3Port, - }}, - }} - return slots, nil - } - client = cluster.newClusterClient(ctx, opt) - - err := client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachSlave(ctx, func(ctx context.Context, slave *redis.Client) error { - Eventually(func() int64 { - return client.DBSize(ctx).Val() - }, 30*time.Second).Should(Equal(int64(0))) - return nil - }) - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - failover = false - - err := client.Close() - Expect(err).NotTo(HaveOccurred()) - }) - - assertClusterClient() - }) - - Describe("ClusterClient with ClusterSlots with multiple nodes per slot", func() { - BeforeEach(func() { - failover = true - - opt = redisClusterOptions() - opt.ReadOnly = true - opt.ClusterSlots = func(ctx context.Context) ([]redis.ClusterSlot, error) { - slots := []redis.ClusterSlot{{ - Start: 0, - End: 4999, - Nodes: []redis.ClusterNode{{ - Addr: ":8220", - }, { - Addr: ":8223", - }}, - }, { - Start: 5000, - End: 9999, - Nodes: []redis.ClusterNode{{ - Addr: ":8221", - }, { - Addr: ":8224", - }}, - }, { - Start: 10000, - End: 16383, - Nodes: []redis.ClusterNode{{ - Addr: ":8222", - }, { - Addr: ":8225", - }}, - }} - return slots, nil - } - client = cluster.newClusterClient(ctx, opt) - - err := client.ForEachMaster(ctx, func(ctx context.Context, master *redis.Client) error { - return master.FlushDB(ctx).Err() - }) - Expect(err).NotTo(HaveOccurred()) - - err = client.ForEachSlave(ctx, func(ctx context.Context, slave *redis.Client) error { - Eventually(func() int64 { - return client.DBSize(ctx).Val() - }, 30*time.Second).Should(Equal(int64(0))) - return nil - }) - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - failover = false - - err := client.Close() - Expect(err).NotTo(HaveOccurred()) - }) - - assertClusterClient() - }) -}) - -var _ = Describe("ClusterClient without nodes", func() { - var client *redis.ClusterClient - - BeforeEach(func() { - client = redis.NewClusterClient(&redis.ClusterOptions{}) - }) - - AfterEach(func() { - Expect(client.Close()).NotTo(HaveOccurred()) - }) - - It("Ping returns an error", func() { - err := client.Ping(ctx).Err() - Expect(err).To(MatchError("redis: cluster has no nodes")) - }) - - It("pipeline returns an error", func() { - _, err := client.Pipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Ping(ctx) - return nil - }) - Expect(err).To(MatchError("redis: cluster has no nodes")) - }) -}) - -var _ = Describe("ClusterClient without valid nodes", func() { - var client *redis.ClusterClient - - BeforeEach(func() { - client = redis.NewClusterClient(&redis.ClusterOptions{ - Addrs: []string{redisAddr}, - }) - }) - - AfterEach(func() { - Expect(client.Close()).NotTo(HaveOccurred()) - }) - - It("returns an error", func() { - err := client.Ping(ctx).Err() - Expect(err).To(MatchError("ERR This instance has cluster support disabled")) - }) - - It("pipeline returns an error", func() { - _, err := client.Pipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Ping(ctx) - return nil - }) - Expect(err).To(MatchError("ERR This instance has cluster support disabled")) - }) -}) - -var _ = Describe("ClusterClient with unavailable Cluster", func() { - var client *redis.ClusterClient - - BeforeEach(func() { - for _, node := range cluster.clients { - err := node.ClientPause(ctx, 5*time.Second).Err() - Expect(err).NotTo(HaveOccurred()) - } - - opt := redisClusterOptions() - opt.ReadTimeout = 250 * time.Millisecond - opt.WriteTimeout = 250 * time.Millisecond - opt.MaxRedirects = 1 - client = cluster.newClusterClientUnstable(opt) - }) - - AfterEach(func() { - Expect(client.Close()).NotTo(HaveOccurred()) - }) - - It("recovers when Cluster recovers", func() { - err := client.Ping(ctx).Err() - Expect(err).To(HaveOccurred()) - - Eventually(func() error { - return client.Ping(ctx).Err() - }, "30s").ShouldNot(HaveOccurred()) - }) -}) - -var _ = Describe("ClusterClient timeout", func() { - var client *redis.ClusterClient - - AfterEach(func() { - _ = client.Close() - }) - - testTimeout := func() { - It("Ping timeouts", func() { - err := client.Ping(ctx).Err() - Expect(err).To(HaveOccurred()) - Expect(err.(net.Error).Timeout()).To(BeTrue()) - }) - - It("Pipeline timeouts", func() { - _, err := client.Pipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Ping(ctx) - return nil - }) - Expect(err).To(HaveOccurred()) - Expect(err.(net.Error).Timeout()).To(BeTrue()) - }) - - It("Tx timeouts", func() { - err := client.Watch(ctx, func(tx *redis.Tx) error { - return tx.Ping(ctx).Err() - }, "foo") - Expect(err).To(HaveOccurred()) - Expect(err.(net.Error).Timeout()).To(BeTrue()) - }) - - It("Tx Pipeline timeouts", func() { - err := client.Watch(ctx, func(tx *redis.Tx) error { - _, err := tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.Ping(ctx) - return nil - }) - return err - }, "foo") - Expect(err).To(HaveOccurred()) - Expect(err.(net.Error).Timeout()).To(BeTrue()) - }) - } - - const pause = 5 * time.Second - - Context("read/write timeout", func() { - BeforeEach(func() { - opt := redisClusterOptions() - opt.ReadTimeout = 250 * time.Millisecond - opt.WriteTimeout = 250 * time.Millisecond - opt.MaxRedirects = 1 - client = cluster.newClusterClient(ctx, opt) - - err := client.ForEachShard(ctx, func(ctx context.Context, client *redis.Client) error { - return client.ClientPause(ctx, pause).Err() - }) - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - _ = client.ForEachShard(ctx, func(ctx context.Context, client *redis.Client) error { - defer GinkgoRecover() - Eventually(func() error { - return client.Ping(ctx).Err() - }, 2*pause).ShouldNot(HaveOccurred()) - return nil - }) - }) - - testTimeout() - }) -}) diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command.go deleted file mode 100644 index 4bb12a8..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command.go +++ /dev/null @@ -1,3478 +0,0 @@ -package redis - -import ( - "context" - "fmt" - "net" - "strconv" - "time" - - "github.com/go-redis/redis/v8/internal" - "github.com/go-redis/redis/v8/internal/hscan" - "github.com/go-redis/redis/v8/internal/proto" - "github.com/go-redis/redis/v8/internal/util" -) - -type Cmder interface { - Name() string - FullName() string - Args() []interface{} - String() string - stringArg(int) string - firstKeyPos() int8 - SetFirstKeyPos(int8) - - readTimeout() *time.Duration - readReply(rd *proto.Reader) error - - SetErr(error) - Err() error -} - -func setCmdsErr(cmds []Cmder, e error) { - for _, cmd := range cmds { - if cmd.Err() == nil { - cmd.SetErr(e) - } - } -} - -func cmdsFirstErr(cmds []Cmder) error { - for _, cmd := range cmds { - if err := cmd.Err(); err != nil { - return err - } - } - return nil -} - -func writeCmds(wr *proto.Writer, cmds []Cmder) error { - for _, cmd := range cmds { - if err := writeCmd(wr, cmd); err != nil { - return err - } - } - return nil -} - -func writeCmd(wr *proto.Writer, cmd Cmder) error { - return wr.WriteArgs(cmd.Args()) -} - -func cmdFirstKeyPos(cmd Cmder, info *CommandInfo) int { - if pos := cmd.firstKeyPos(); pos != 0 { - return int(pos) - } - - switch cmd.Name() { - case "eval", "evalsha": - if cmd.stringArg(2) != "0" { - return 3 - } - - return 0 - case "publish": - return 1 - case "memory": - // https://github.com/redis/redis/issues/7493 - if cmd.stringArg(1) == "usage" { - return 2 - } - } - - if info != nil { - return int(info.FirstKeyPos) - } - return 0 -} - -func cmdString(cmd Cmder, val interface{}) string { - b := make([]byte, 0, 64) - - for i, arg := range cmd.Args() { - if i > 0 { - b = append(b, ' ') - } - b = internal.AppendArg(b, arg) - } - - if err := cmd.Err(); err != nil { - b = append(b, ": "...) - b = append(b, err.Error()...) - } else if val != nil { - b = append(b, ": "...) - b = internal.AppendArg(b, val) - } - - return internal.String(b) -} - -//------------------------------------------------------------------------------ - -type baseCmd struct { - ctx context.Context - args []interface{} - err error - keyPos int8 - - _readTimeout *time.Duration -} - -var _ Cmder = (*Cmd)(nil) - -func (cmd *baseCmd) Name() string { - if len(cmd.args) == 0 { - return "" - } - // Cmd name must be lower cased. - return internal.ToLower(cmd.stringArg(0)) -} - -func (cmd *baseCmd) FullName() string { - switch name := cmd.Name(); name { - case "cluster", "command": - if len(cmd.args) == 1 { - return name - } - if s2, ok := cmd.args[1].(string); ok { - return name + " " + s2 - } - return name - default: - return name - } -} - -func (cmd *baseCmd) Args() []interface{} { - return cmd.args -} - -func (cmd *baseCmd) stringArg(pos int) string { - if pos < 0 || pos >= len(cmd.args) { - return "" - } - arg := cmd.args[pos] - switch v := arg.(type) { - case string: - return v - default: - // TODO: consider using appendArg - return fmt.Sprint(v) - } -} - -func (cmd *baseCmd) firstKeyPos() int8 { - return cmd.keyPos -} - -func (cmd *baseCmd) SetFirstKeyPos(keyPos int8) { - cmd.keyPos = keyPos -} - -func (cmd *baseCmd) SetErr(e error) { - cmd.err = e -} - -func (cmd *baseCmd) Err() error { - return cmd.err -} - -func (cmd *baseCmd) readTimeout() *time.Duration { - return cmd._readTimeout -} - -func (cmd *baseCmd) setReadTimeout(d time.Duration) { - cmd._readTimeout = &d -} - -//------------------------------------------------------------------------------ - -type Cmd struct { - baseCmd - - val interface{} -} - -func NewCmd(ctx context.Context, args ...interface{}) *Cmd { - return &Cmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *Cmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *Cmd) SetVal(val interface{}) { - cmd.val = val -} - -func (cmd *Cmd) Val() interface{} { - return cmd.val -} - -func (cmd *Cmd) Result() (interface{}, error) { - return cmd.val, cmd.err -} - -func (cmd *Cmd) Text() (string, error) { - if cmd.err != nil { - return "", cmd.err - } - return toString(cmd.val) -} - -func toString(val interface{}) (string, error) { - switch val := val.(type) { - case string: - return val, nil - default: - err := fmt.Errorf("redis: unexpected type=%T for String", val) - return "", err - } -} - -func (cmd *Cmd) Int() (int, error) { - if cmd.err != nil { - return 0, cmd.err - } - switch val := cmd.val.(type) { - case int64: - return int(val), nil - case string: - return strconv.Atoi(val) - default: - err := fmt.Errorf("redis: unexpected type=%T for Int", val) - return 0, err - } -} - -func (cmd *Cmd) Int64() (int64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return toInt64(cmd.val) -} - -func toInt64(val interface{}) (int64, error) { - switch val := val.(type) { - case int64: - return val, nil - case string: - return strconv.ParseInt(val, 10, 64) - default: - err := fmt.Errorf("redis: unexpected type=%T for Int64", val) - return 0, err - } -} - -func (cmd *Cmd) Uint64() (uint64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return toUint64(cmd.val) -} - -func toUint64(val interface{}) (uint64, error) { - switch val := val.(type) { - case int64: - return uint64(val), nil - case string: - return strconv.ParseUint(val, 10, 64) - default: - err := fmt.Errorf("redis: unexpected type=%T for Uint64", val) - return 0, err - } -} - -func (cmd *Cmd) Float32() (float32, error) { - if cmd.err != nil { - return 0, cmd.err - } - return toFloat32(cmd.val) -} - -func toFloat32(val interface{}) (float32, error) { - switch val := val.(type) { - case int64: - return float32(val), nil - case string: - f, err := strconv.ParseFloat(val, 32) - if err != nil { - return 0, err - } - return float32(f), nil - default: - err := fmt.Errorf("redis: unexpected type=%T for Float32", val) - return 0, err - } -} - -func (cmd *Cmd) Float64() (float64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return toFloat64(cmd.val) -} - -func toFloat64(val interface{}) (float64, error) { - switch val := val.(type) { - case int64: - return float64(val), nil - case string: - return strconv.ParseFloat(val, 64) - default: - err := fmt.Errorf("redis: unexpected type=%T for Float64", val) - return 0, err - } -} - -func (cmd *Cmd) Bool() (bool, error) { - if cmd.err != nil { - return false, cmd.err - } - return toBool(cmd.val) -} - -func toBool(val interface{}) (bool, error) { - switch val := val.(type) { - case int64: - return val != 0, nil - case string: - return strconv.ParseBool(val) - default: - err := fmt.Errorf("redis: unexpected type=%T for Bool", val) - return false, err - } -} - -func (cmd *Cmd) Slice() ([]interface{}, error) { - if cmd.err != nil { - return nil, cmd.err - } - switch val := cmd.val.(type) { - case []interface{}: - return val, nil - default: - return nil, fmt.Errorf("redis: unexpected type=%T for Slice", val) - } -} - -func (cmd *Cmd) StringSlice() ([]string, error) { - slice, err := cmd.Slice() - if err != nil { - return nil, err - } - - ss := make([]string, len(slice)) - for i, iface := range slice { - val, err := toString(iface) - if err != nil { - return nil, err - } - ss[i] = val - } - return ss, nil -} - -func (cmd *Cmd) Int64Slice() ([]int64, error) { - slice, err := cmd.Slice() - if err != nil { - return nil, err - } - - nums := make([]int64, len(slice)) - for i, iface := range slice { - val, err := toInt64(iface) - if err != nil { - return nil, err - } - nums[i] = val - } - return nums, nil -} - -func (cmd *Cmd) Uint64Slice() ([]uint64, error) { - slice, err := cmd.Slice() - if err != nil { - return nil, err - } - - nums := make([]uint64, len(slice)) - for i, iface := range slice { - val, err := toUint64(iface) - if err != nil { - return nil, err - } - nums[i] = val - } - return nums, nil -} - -func (cmd *Cmd) Float32Slice() ([]float32, error) { - slice, err := cmd.Slice() - if err != nil { - return nil, err - } - - floats := make([]float32, len(slice)) - for i, iface := range slice { - val, err := toFloat32(iface) - if err != nil { - return nil, err - } - floats[i] = val - } - return floats, nil -} - -func (cmd *Cmd) Float64Slice() ([]float64, error) { - slice, err := cmd.Slice() - if err != nil { - return nil, err - } - - floats := make([]float64, len(slice)) - for i, iface := range slice { - val, err := toFloat64(iface) - if err != nil { - return nil, err - } - floats[i] = val - } - return floats, nil -} - -func (cmd *Cmd) BoolSlice() ([]bool, error) { - slice, err := cmd.Slice() - if err != nil { - return nil, err - } - - bools := make([]bool, len(slice)) - for i, iface := range slice { - val, err := toBool(iface) - if err != nil { - return nil, err - } - bools[i] = val - } - return bools, nil -} - -func (cmd *Cmd) readReply(rd *proto.Reader) (err error) { - cmd.val, err = rd.ReadReply(sliceParser) - return err -} - -// sliceParser implements proto.MultiBulkParse. -func sliceParser(rd *proto.Reader, n int64) (interface{}, error) { - vals := make([]interface{}, n) - for i := 0; i < len(vals); i++ { - v, err := rd.ReadReply(sliceParser) - if err != nil { - if err == Nil { - vals[i] = nil - continue - } - if err, ok := err.(proto.RedisError); ok { - vals[i] = err - continue - } - return nil, err - } - vals[i] = v - } - return vals, nil -} - -//------------------------------------------------------------------------------ - -type SliceCmd struct { - baseCmd - - val []interface{} -} - -var _ Cmder = (*SliceCmd)(nil) - -func NewSliceCmd(ctx context.Context, args ...interface{}) *SliceCmd { - return &SliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *SliceCmd) SetVal(val []interface{}) { - cmd.val = val -} - -func (cmd *SliceCmd) Val() []interface{} { - return cmd.val -} - -func (cmd *SliceCmd) Result() ([]interface{}, error) { - return cmd.val, cmd.err -} - -func (cmd *SliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -// Scan scans the results from the map into a destination struct. The map keys -// are matched in the Redis struct fields by the `redis:"field"` tag. -func (cmd *SliceCmd) Scan(dst interface{}) error { - if cmd.err != nil { - return cmd.err - } - - // Pass the list of keys and values. - // Skip the first two args for: HMGET key - var args []interface{} - if cmd.args[0] == "hmget" { - args = cmd.args[2:] - } else { - // Otherwise, it's: MGET field field ... - args = cmd.args[1:] - } - - return hscan.Scan(dst, args, cmd.val) -} - -func (cmd *SliceCmd) readReply(rd *proto.Reader) error { - v, err := rd.ReadArrayReply(sliceParser) - if err != nil { - return err - } - cmd.val = v.([]interface{}) - return nil -} - -//------------------------------------------------------------------------------ - -type StatusCmd struct { - baseCmd - - val string -} - -var _ Cmder = (*StatusCmd)(nil) - -func NewStatusCmd(ctx context.Context, args ...interface{}) *StatusCmd { - return &StatusCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *StatusCmd) SetVal(val string) { - cmd.val = val -} - -func (cmd *StatusCmd) Val() string { - return cmd.val -} - -func (cmd *StatusCmd) Result() (string, error) { - return cmd.val, cmd.err -} - -func (cmd *StatusCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StatusCmd) readReply(rd *proto.Reader) (err error) { - cmd.val, err = rd.ReadString() - return err -} - -//------------------------------------------------------------------------------ - -type IntCmd struct { - baseCmd - - val int64 -} - -var _ Cmder = (*IntCmd)(nil) - -func NewIntCmd(ctx context.Context, args ...interface{}) *IntCmd { - return &IntCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *IntCmd) SetVal(val int64) { - cmd.val = val -} - -func (cmd *IntCmd) Val() int64 { - return cmd.val -} - -func (cmd *IntCmd) Result() (int64, error) { - return cmd.val, cmd.err -} - -func (cmd *IntCmd) Uint64() (uint64, error) { - return uint64(cmd.val), cmd.err -} - -func (cmd *IntCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *IntCmd) readReply(rd *proto.Reader) (err error) { - cmd.val, err = rd.ReadIntReply() - return err -} - -//------------------------------------------------------------------------------ - -type IntSliceCmd struct { - baseCmd - - val []int64 -} - -var _ Cmder = (*IntSliceCmd)(nil) - -func NewIntSliceCmd(ctx context.Context, args ...interface{}) *IntSliceCmd { - return &IntSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *IntSliceCmd) SetVal(val []int64) { - cmd.val = val -} - -func (cmd *IntSliceCmd) Val() []int64 { - return cmd.val -} - -func (cmd *IntSliceCmd) Result() ([]int64, error) { - return cmd.val, cmd.err -} - -func (cmd *IntSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *IntSliceCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]int64, n) - for i := 0; i < len(cmd.val); i++ { - num, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.val[i] = num - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type DurationCmd struct { - baseCmd - - val time.Duration - precision time.Duration -} - -var _ Cmder = (*DurationCmd)(nil) - -func NewDurationCmd(ctx context.Context, precision time.Duration, args ...interface{}) *DurationCmd { - return &DurationCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - precision: precision, - } -} - -func (cmd *DurationCmd) SetVal(val time.Duration) { - cmd.val = val -} - -func (cmd *DurationCmd) Val() time.Duration { - return cmd.val -} - -func (cmd *DurationCmd) Result() (time.Duration, error) { - return cmd.val, cmd.err -} - -func (cmd *DurationCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *DurationCmd) readReply(rd *proto.Reader) error { - n, err := rd.ReadIntReply() - if err != nil { - return err - } - switch n { - // -2 if the key does not exist - // -1 if the key exists but has no associated expire - case -2, -1: - cmd.val = time.Duration(n) - default: - cmd.val = time.Duration(n) * cmd.precision - } - return nil -} - -//------------------------------------------------------------------------------ - -type TimeCmd struct { - baseCmd - - val time.Time -} - -var _ Cmder = (*TimeCmd)(nil) - -func NewTimeCmd(ctx context.Context, args ...interface{}) *TimeCmd { - return &TimeCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *TimeCmd) SetVal(val time.Time) { - cmd.val = val -} - -func (cmd *TimeCmd) Val() time.Time { - return cmd.val -} - -func (cmd *TimeCmd) Result() (time.Time, error) { - return cmd.val, cmd.err -} - -func (cmd *TimeCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *TimeCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d elements, expected 2", n) - } - - sec, err := rd.ReadInt() - if err != nil { - return nil, err - } - - microsec, err := rd.ReadInt() - if err != nil { - return nil, err - } - - cmd.val = time.Unix(sec, microsec*1000) - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type BoolCmd struct { - baseCmd - - val bool -} - -var _ Cmder = (*BoolCmd)(nil) - -func NewBoolCmd(ctx context.Context, args ...interface{}) *BoolCmd { - return &BoolCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *BoolCmd) SetVal(val bool) { - cmd.val = val -} - -func (cmd *BoolCmd) Val() bool { - return cmd.val -} - -func (cmd *BoolCmd) Result() (bool, error) { - return cmd.val, cmd.err -} - -func (cmd *BoolCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *BoolCmd) readReply(rd *proto.Reader) error { - v, err := rd.ReadReply(nil) - // `SET key value NX` returns nil when key already exists. But - // `SETNX key value` returns bool (0/1). So convert nil to bool. - if err == Nil { - cmd.val = false - return nil - } - if err != nil { - return err - } - switch v := v.(type) { - case int64: - cmd.val = v == 1 - return nil - case string: - cmd.val = v == "OK" - return nil - default: - return fmt.Errorf("got %T, wanted int64 or string", v) - } -} - -//------------------------------------------------------------------------------ - -type StringCmd struct { - baseCmd - - val string -} - -var _ Cmder = (*StringCmd)(nil) - -func NewStringCmd(ctx context.Context, args ...interface{}) *StringCmd { - return &StringCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *StringCmd) SetVal(val string) { - cmd.val = val -} - -func (cmd *StringCmd) Val() string { - return cmd.val -} - -func (cmd *StringCmd) Result() (string, error) { - return cmd.Val(), cmd.err -} - -func (cmd *StringCmd) Bytes() ([]byte, error) { - return util.StringToBytes(cmd.val), cmd.err -} - -func (cmd *StringCmd) Bool() (bool, error) { - if cmd.err != nil { - return false, cmd.err - } - return strconv.ParseBool(cmd.val) -} - -func (cmd *StringCmd) Int() (int, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.Atoi(cmd.Val()) -} - -func (cmd *StringCmd) Int64() (int64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.ParseInt(cmd.Val(), 10, 64) -} - -func (cmd *StringCmd) Uint64() (uint64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.ParseUint(cmd.Val(), 10, 64) -} - -func (cmd *StringCmd) Float32() (float32, error) { - if cmd.err != nil { - return 0, cmd.err - } - f, err := strconv.ParseFloat(cmd.Val(), 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -func (cmd *StringCmd) Float64() (float64, error) { - if cmd.err != nil { - return 0, cmd.err - } - return strconv.ParseFloat(cmd.Val(), 64) -} - -func (cmd *StringCmd) Time() (time.Time, error) { - if cmd.err != nil { - return time.Time{}, cmd.err - } - return time.Parse(time.RFC3339Nano, cmd.Val()) -} - -func (cmd *StringCmd) Scan(val interface{}) error { - if cmd.err != nil { - return cmd.err - } - return proto.Scan([]byte(cmd.val), val) -} - -func (cmd *StringCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringCmd) readReply(rd *proto.Reader) (err error) { - cmd.val, err = rd.ReadString() - return err -} - -//------------------------------------------------------------------------------ - -type FloatCmd struct { - baseCmd - - val float64 -} - -var _ Cmder = (*FloatCmd)(nil) - -func NewFloatCmd(ctx context.Context, args ...interface{}) *FloatCmd { - return &FloatCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *FloatCmd) SetVal(val float64) { - cmd.val = val -} - -func (cmd *FloatCmd) Val() float64 { - return cmd.val -} - -func (cmd *FloatCmd) Result() (float64, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *FloatCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *FloatCmd) readReply(rd *proto.Reader) (err error) { - cmd.val, err = rd.ReadFloatReply() - return err -} - -//------------------------------------------------------------------------------ - -type FloatSliceCmd struct { - baseCmd - - val []float64 -} - -var _ Cmder = (*FloatSliceCmd)(nil) - -func NewFloatSliceCmd(ctx context.Context, args ...interface{}) *FloatSliceCmd { - return &FloatSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *FloatSliceCmd) SetVal(val []float64) { - cmd.val = val -} - -func (cmd *FloatSliceCmd) Val() []float64 { - return cmd.val -} - -func (cmd *FloatSliceCmd) Result() ([]float64, error) { - return cmd.val, cmd.err -} - -func (cmd *FloatSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *FloatSliceCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]float64, n) - for i := 0; i < len(cmd.val); i++ { - switch num, err := rd.ReadFloatReply(); { - case err == Nil: - cmd.val[i] = 0 - case err != nil: - return nil, err - default: - cmd.val[i] = num - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type StringSliceCmd struct { - baseCmd - - val []string -} - -var _ Cmder = (*StringSliceCmd)(nil) - -func NewStringSliceCmd(ctx context.Context, args ...interface{}) *StringSliceCmd { - return &StringSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *StringSliceCmd) SetVal(val []string) { - cmd.val = val -} - -func (cmd *StringSliceCmd) Val() []string { - return cmd.val -} - -func (cmd *StringSliceCmd) Result() ([]string, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *StringSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringSliceCmd) ScanSlice(container interface{}) error { - return proto.ScanSlice(cmd.Val(), container) -} - -func (cmd *StringSliceCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]string, n) - for i := 0; i < len(cmd.val); i++ { - switch s, err := rd.ReadString(); { - case err == Nil: - cmd.val[i] = "" - case err != nil: - return nil, err - default: - cmd.val[i] = s - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type BoolSliceCmd struct { - baseCmd - - val []bool -} - -var _ Cmder = (*BoolSliceCmd)(nil) - -func NewBoolSliceCmd(ctx context.Context, args ...interface{}) *BoolSliceCmd { - return &BoolSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *BoolSliceCmd) SetVal(val []bool) { - cmd.val = val -} - -func (cmd *BoolSliceCmd) Val() []bool { - return cmd.val -} - -func (cmd *BoolSliceCmd) Result() ([]bool, error) { - return cmd.val, cmd.err -} - -func (cmd *BoolSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *BoolSliceCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]bool, n) - for i := 0; i < len(cmd.val); i++ { - n, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.val[i] = n == 1 - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type StringStringMapCmd struct { - baseCmd - - val map[string]string -} - -var _ Cmder = (*StringStringMapCmd)(nil) - -func NewStringStringMapCmd(ctx context.Context, args ...interface{}) *StringStringMapCmd { - return &StringStringMapCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *StringStringMapCmd) SetVal(val map[string]string) { - cmd.val = val -} - -func (cmd *StringStringMapCmd) Val() map[string]string { - return cmd.val -} - -func (cmd *StringStringMapCmd) Result() (map[string]string, error) { - return cmd.val, cmd.err -} - -func (cmd *StringStringMapCmd) String() string { - return cmdString(cmd, cmd.val) -} - -// Scan scans the results from the map into a destination struct. The map keys -// are matched in the Redis struct fields by the `redis:"field"` tag. -func (cmd *StringStringMapCmd) Scan(dest interface{}) error { - if cmd.err != nil { - return cmd.err - } - - strct, err := hscan.Struct(dest) - if err != nil { - return err - } - - for k, v := range cmd.val { - if err := strct.Scan(k, v); err != nil { - return err - } - } - - return nil -} - -func (cmd *StringStringMapCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make(map[string]string, n/2) - for i := int64(0); i < n; i += 2 { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - value, err := rd.ReadString() - if err != nil { - return nil, err - } - - cmd.val[key] = value - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type StringIntMapCmd struct { - baseCmd - - val map[string]int64 -} - -var _ Cmder = (*StringIntMapCmd)(nil) - -func NewStringIntMapCmd(ctx context.Context, args ...interface{}) *StringIntMapCmd { - return &StringIntMapCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *StringIntMapCmd) SetVal(val map[string]int64) { - cmd.val = val -} - -func (cmd *StringIntMapCmd) Val() map[string]int64 { - return cmd.val -} - -func (cmd *StringIntMapCmd) Result() (map[string]int64, error) { - return cmd.val, cmd.err -} - -func (cmd *StringIntMapCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringIntMapCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make(map[string]int64, n/2) - for i := int64(0); i < n; i += 2 { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - n, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - cmd.val[key] = n - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type StringStructMapCmd struct { - baseCmd - - val map[string]struct{} -} - -var _ Cmder = (*StringStructMapCmd)(nil) - -func NewStringStructMapCmd(ctx context.Context, args ...interface{}) *StringStructMapCmd { - return &StringStructMapCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *StringStructMapCmd) SetVal(val map[string]struct{}) { - cmd.val = val -} - -func (cmd *StringStructMapCmd) Val() map[string]struct{} { - return cmd.val -} - -func (cmd *StringStructMapCmd) Result() (map[string]struct{}, error) { - return cmd.val, cmd.err -} - -func (cmd *StringStructMapCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *StringStructMapCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make(map[string]struct{}, n) - for i := int64(0); i < n; i++ { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - cmd.val[key] = struct{}{} - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type XMessage struct { - ID string - Values map[string]interface{} -} - -type XMessageSliceCmd struct { - baseCmd - - val []XMessage -} - -var _ Cmder = (*XMessageSliceCmd)(nil) - -func NewXMessageSliceCmd(ctx context.Context, args ...interface{}) *XMessageSliceCmd { - return &XMessageSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XMessageSliceCmd) SetVal(val []XMessage) { - cmd.val = val -} - -func (cmd *XMessageSliceCmd) Val() []XMessage { - return cmd.val -} - -func (cmd *XMessageSliceCmd) Result() ([]XMessage, error) { - return cmd.val, cmd.err -} - -func (cmd *XMessageSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XMessageSliceCmd) readReply(rd *proto.Reader) error { - var err error - cmd.val, err = readXMessageSlice(rd) - return err -} - -func readXMessageSlice(rd *proto.Reader) ([]XMessage, error) { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - - msgs := make([]XMessage, n) - for i := 0; i < n; i++ { - var err error - msgs[i], err = readXMessage(rd) - if err != nil { - return nil, err - } - } - return msgs, nil -} - -func readXMessage(rd *proto.Reader) (XMessage, error) { - n, err := rd.ReadArrayLen() - if err != nil { - return XMessage{}, err - } - if n != 2 { - return XMessage{}, fmt.Errorf("got %d, wanted 2", n) - } - - id, err := rd.ReadString() - if err != nil { - return XMessage{}, err - } - - var values map[string]interface{} - - v, err := rd.ReadArrayReply(stringInterfaceMapParser) - if err != nil { - if err != proto.Nil { - return XMessage{}, err - } - } else { - values = v.(map[string]interface{}) - } - - return XMessage{ - ID: id, - Values: values, - }, nil -} - -// stringInterfaceMapParser implements proto.MultiBulkParse. -func stringInterfaceMapParser(rd *proto.Reader, n int64) (interface{}, error) { - m := make(map[string]interface{}, n/2) - for i := int64(0); i < n; i += 2 { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - value, err := rd.ReadString() - if err != nil { - return nil, err - } - - m[key] = value - } - return m, nil -} - -//------------------------------------------------------------------------------ - -type XStream struct { - Stream string - Messages []XMessage -} - -type XStreamSliceCmd struct { - baseCmd - - val []XStream -} - -var _ Cmder = (*XStreamSliceCmd)(nil) - -func NewXStreamSliceCmd(ctx context.Context, args ...interface{}) *XStreamSliceCmd { - return &XStreamSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XStreamSliceCmd) SetVal(val []XStream) { - cmd.val = val -} - -func (cmd *XStreamSliceCmd) Val() []XStream { - return cmd.val -} - -func (cmd *XStreamSliceCmd) Result() ([]XStream, error) { - return cmd.val, cmd.err -} - -func (cmd *XStreamSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XStreamSliceCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]XStream, n) - for i := 0; i < len(cmd.val); i++ { - i := i - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d, wanted 2", n) - } - - stream, err := rd.ReadString() - if err != nil { - return nil, err - } - - msgs, err := readXMessageSlice(rd) - if err != nil { - return nil, err - } - - cmd.val[i] = XStream{ - Stream: stream, - Messages: msgs, - } - return nil, nil - }) - if err != nil { - return nil, err - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type XPending struct { - Count int64 - Lower string - Higher string - Consumers map[string]int64 -} - -type XPendingCmd struct { - baseCmd - val *XPending -} - -var _ Cmder = (*XPendingCmd)(nil) - -func NewXPendingCmd(ctx context.Context, args ...interface{}) *XPendingCmd { - return &XPendingCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XPendingCmd) SetVal(val *XPending) { - cmd.val = val -} - -func (cmd *XPendingCmd) Val() *XPending { - return cmd.val -} - -func (cmd *XPendingCmd) Result() (*XPending, error) { - return cmd.val, cmd.err -} - -func (cmd *XPendingCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XPendingCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 4 { - return nil, fmt.Errorf("got %d, wanted 4", n) - } - - count, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - lower, err := rd.ReadString() - if err != nil && err != Nil { - return nil, err - } - - higher, err := rd.ReadString() - if err != nil && err != Nil { - return nil, err - } - - cmd.val = &XPending{ - Count: count, - Lower: lower, - Higher: higher, - } - _, err = rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - for i := int64(0); i < n; i++ { - _, err = rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d, wanted 2", n) - } - - consumerName, err := rd.ReadString() - if err != nil { - return nil, err - } - - consumerPending, err := rd.ReadInt() - if err != nil { - return nil, err - } - - if cmd.val.Consumers == nil { - cmd.val.Consumers = make(map[string]int64) - } - cmd.val.Consumers[consumerName] = consumerPending - - return nil, nil - }) - if err != nil { - return nil, err - } - } - return nil, nil - }) - if err != nil && err != Nil { - return nil, err - } - - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type XPendingExt struct { - ID string - Consumer string - Idle time.Duration - RetryCount int64 -} - -type XPendingExtCmd struct { - baseCmd - val []XPendingExt -} - -var _ Cmder = (*XPendingExtCmd)(nil) - -func NewXPendingExtCmd(ctx context.Context, args ...interface{}) *XPendingExtCmd { - return &XPendingExtCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XPendingExtCmd) SetVal(val []XPendingExt) { - cmd.val = val -} - -func (cmd *XPendingExtCmd) Val() []XPendingExt { - return cmd.val -} - -func (cmd *XPendingExtCmd) Result() ([]XPendingExt, error) { - return cmd.val, cmd.err -} - -func (cmd *XPendingExtCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XPendingExtCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]XPendingExt, 0, n) - for i := int64(0); i < n; i++ { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 4 { - return nil, fmt.Errorf("got %d, wanted 4", n) - } - - id, err := rd.ReadString() - if err != nil { - return nil, err - } - - consumer, err := rd.ReadString() - if err != nil && err != Nil { - return nil, err - } - - idle, err := rd.ReadIntReply() - if err != nil && err != Nil { - return nil, err - } - - retryCount, err := rd.ReadIntReply() - if err != nil && err != Nil { - return nil, err - } - - cmd.val = append(cmd.val, XPendingExt{ - ID: id, - Consumer: consumer, - Idle: time.Duration(idle) * time.Millisecond, - RetryCount: retryCount, - }) - return nil, nil - }) - if err != nil { - return nil, err - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type XAutoClaimCmd struct { - baseCmd - - start string - val []XMessage -} - -var _ Cmder = (*XAutoClaimCmd)(nil) - -func NewXAutoClaimCmd(ctx context.Context, args ...interface{}) *XAutoClaimCmd { - return &XAutoClaimCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XAutoClaimCmd) SetVal(val []XMessage, start string) { - cmd.val = val - cmd.start = start -} - -func (cmd *XAutoClaimCmd) Val() (messages []XMessage, start string) { - return cmd.val, cmd.start -} - -func (cmd *XAutoClaimCmd) Result() (messages []XMessage, start string, err error) { - return cmd.val, cmd.start, cmd.err -} - -func (cmd *XAutoClaimCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XAutoClaimCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d, wanted 2", n) - } - var err error - - cmd.start, err = rd.ReadString() - if err != nil { - return nil, err - } - - cmd.val, err = readXMessageSlice(rd) - if err != nil { - return nil, err - } - - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type XAutoClaimJustIDCmd struct { - baseCmd - - start string - val []string -} - -var _ Cmder = (*XAutoClaimJustIDCmd)(nil) - -func NewXAutoClaimJustIDCmd(ctx context.Context, args ...interface{}) *XAutoClaimJustIDCmd { - return &XAutoClaimJustIDCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XAutoClaimJustIDCmd) SetVal(val []string, start string) { - cmd.val = val - cmd.start = start -} - -func (cmd *XAutoClaimJustIDCmd) Val() (ids []string, start string) { - return cmd.val, cmd.start -} - -func (cmd *XAutoClaimJustIDCmd) Result() (ids []string, start string, err error) { - return cmd.val, cmd.start, cmd.err -} - -func (cmd *XAutoClaimJustIDCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XAutoClaimJustIDCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 2 { - return nil, fmt.Errorf("got %d, wanted 2", n) - } - var err error - - cmd.start, err = rd.ReadString() - if err != nil { - return nil, err - } - - nn, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - - cmd.val = make([]string, nn) - for i := 0; i < nn; i++ { - cmd.val[i], err = rd.ReadString() - if err != nil { - return nil, err - } - } - - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type XInfoConsumersCmd struct { - baseCmd - val []XInfoConsumer -} - -type XInfoConsumer struct { - Name string - Pending int64 - Idle int64 -} - -var _ Cmder = (*XInfoConsumersCmd)(nil) - -func NewXInfoConsumersCmd(ctx context.Context, stream string, group string) *XInfoConsumersCmd { - return &XInfoConsumersCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: []interface{}{"xinfo", "consumers", stream, group}, - }, - } -} - -func (cmd *XInfoConsumersCmd) SetVal(val []XInfoConsumer) { - cmd.val = val -} - -func (cmd *XInfoConsumersCmd) Val() []XInfoConsumer { - return cmd.val -} - -func (cmd *XInfoConsumersCmd) Result() ([]XInfoConsumer, error) { - return cmd.val, cmd.err -} - -func (cmd *XInfoConsumersCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XInfoConsumersCmd) readReply(rd *proto.Reader) error { - n, err := rd.ReadArrayLen() - if err != nil { - return err - } - - cmd.val = make([]XInfoConsumer, n) - - for i := 0; i < n; i++ { - cmd.val[i], err = readXConsumerInfo(rd) - if err != nil { - return err - } - } - - return nil -} - -func readXConsumerInfo(rd *proto.Reader) (XInfoConsumer, error) { - var consumer XInfoConsumer - - n, err := rd.ReadArrayLen() - if err != nil { - return consumer, err - } - if n != 6 { - return consumer, fmt.Errorf("redis: got %d elements in XINFO CONSUMERS reply, wanted 6", n) - } - - for i := 0; i < 3; i++ { - key, err := rd.ReadString() - if err != nil { - return consumer, err - } - - val, err := rd.ReadString() - if err != nil { - return consumer, err - } - - switch key { - case "name": - consumer.Name = val - case "pending": - consumer.Pending, err = strconv.ParseInt(val, 0, 64) - if err != nil { - return consumer, err - } - case "idle": - consumer.Idle, err = strconv.ParseInt(val, 0, 64) - if err != nil { - return consumer, err - } - default: - return consumer, fmt.Errorf("redis: unexpected content %s in XINFO CONSUMERS reply", key) - } - } - - return consumer, nil -} - -//------------------------------------------------------------------------------ - -type XInfoGroupsCmd struct { - baseCmd - val []XInfoGroup -} - -type XInfoGroup struct { - Name string - Consumers int64 - Pending int64 - LastDeliveredID string -} - -var _ Cmder = (*XInfoGroupsCmd)(nil) - -func NewXInfoGroupsCmd(ctx context.Context, stream string) *XInfoGroupsCmd { - return &XInfoGroupsCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: []interface{}{"xinfo", "groups", stream}, - }, - } -} - -func (cmd *XInfoGroupsCmd) SetVal(val []XInfoGroup) { - cmd.val = val -} - -func (cmd *XInfoGroupsCmd) Val() []XInfoGroup { - return cmd.val -} - -func (cmd *XInfoGroupsCmd) Result() ([]XInfoGroup, error) { - return cmd.val, cmd.err -} - -func (cmd *XInfoGroupsCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XInfoGroupsCmd) readReply(rd *proto.Reader) error { - n, err := rd.ReadArrayLen() - if err != nil { - return err - } - - cmd.val = make([]XInfoGroup, n) - - for i := 0; i < n; i++ { - cmd.val[i], err = readXGroupInfo(rd) - if err != nil { - return err - } - } - - return nil -} - -func readXGroupInfo(rd *proto.Reader) (XInfoGroup, error) { - var group XInfoGroup - - n, err := rd.ReadArrayLen() - if err != nil { - return group, err - } - if n != 8 { - return group, fmt.Errorf("redis: got %d elements in XINFO GROUPS reply, wanted 8", n) - } - - for i := 0; i < 4; i++ { - key, err := rd.ReadString() - if err != nil { - return group, err - } - - val, err := rd.ReadString() - if err != nil { - return group, err - } - - switch key { - case "name": - group.Name = val - case "consumers": - group.Consumers, err = strconv.ParseInt(val, 0, 64) - if err != nil { - return group, err - } - case "pending": - group.Pending, err = strconv.ParseInt(val, 0, 64) - if err != nil { - return group, err - } - case "last-delivered-id": - group.LastDeliveredID = val - default: - return group, fmt.Errorf("redis: unexpected content %s in XINFO GROUPS reply", key) - } - } - - return group, nil -} - -//------------------------------------------------------------------------------ - -type XInfoStreamCmd struct { - baseCmd - val *XInfoStream -} - -type XInfoStream struct { - Length int64 - RadixTreeKeys int64 - RadixTreeNodes int64 - Groups int64 - LastGeneratedID string - FirstEntry XMessage - LastEntry XMessage -} - -var _ Cmder = (*XInfoStreamCmd)(nil) - -func NewXInfoStreamCmd(ctx context.Context, stream string) *XInfoStreamCmd { - return &XInfoStreamCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: []interface{}{"xinfo", "stream", stream}, - }, - } -} - -func (cmd *XInfoStreamCmd) SetVal(val *XInfoStream) { - cmd.val = val -} - -func (cmd *XInfoStreamCmd) Val() *XInfoStream { - return cmd.val -} - -func (cmd *XInfoStreamCmd) Result() (*XInfoStream, error) { - return cmd.val, cmd.err -} - -func (cmd *XInfoStreamCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XInfoStreamCmd) readReply(rd *proto.Reader) error { - v, err := rd.ReadReply(xStreamInfoParser) - if err != nil { - return err - } - cmd.val = v.(*XInfoStream) - return nil -} - -func xStreamInfoParser(rd *proto.Reader, n int64) (interface{}, error) { - if n != 14 { - return nil, fmt.Errorf("redis: got %d elements in XINFO STREAM reply,"+ - "wanted 14", n) - } - var info XInfoStream - for i := 0; i < 7; i++ { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - switch key { - case "length": - info.Length, err = rd.ReadIntReply() - case "radix-tree-keys": - info.RadixTreeKeys, err = rd.ReadIntReply() - case "radix-tree-nodes": - info.RadixTreeNodes, err = rd.ReadIntReply() - case "groups": - info.Groups, err = rd.ReadIntReply() - case "last-generated-id": - info.LastGeneratedID, err = rd.ReadString() - case "first-entry": - info.FirstEntry, err = readXMessage(rd) - if err == Nil { - err = nil - } - case "last-entry": - info.LastEntry, err = readXMessage(rd) - if err == Nil { - err = nil - } - default: - return nil, fmt.Errorf("redis: unexpected content %s "+ - "in XINFO STREAM reply", key) - } - if err != nil { - return nil, err - } - } - return &info, nil -} - -//------------------------------------------------------------------------------ - -type XInfoStreamFullCmd struct { - baseCmd - val *XInfoStreamFull -} - -type XInfoStreamFull struct { - Length int64 - RadixTreeKeys int64 - RadixTreeNodes int64 - LastGeneratedID string - Entries []XMessage - Groups []XInfoStreamGroup -} - -type XInfoStreamGroup struct { - Name string - LastDeliveredID string - PelCount int64 - Pending []XInfoStreamGroupPending - Consumers []XInfoStreamConsumer -} - -type XInfoStreamGroupPending struct { - ID string - Consumer string - DeliveryTime time.Time - DeliveryCount int64 -} - -type XInfoStreamConsumer struct { - Name string - SeenTime time.Time - PelCount int64 - Pending []XInfoStreamConsumerPending -} - -type XInfoStreamConsumerPending struct { - ID string - DeliveryTime time.Time - DeliveryCount int64 -} - -var _ Cmder = (*XInfoStreamFullCmd)(nil) - -func NewXInfoStreamFullCmd(ctx context.Context, args ...interface{}) *XInfoStreamFullCmd { - return &XInfoStreamFullCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *XInfoStreamFullCmd) SetVal(val *XInfoStreamFull) { - cmd.val = val -} - -func (cmd *XInfoStreamFullCmd) Val() *XInfoStreamFull { - return cmd.val -} - -func (cmd *XInfoStreamFullCmd) Result() (*XInfoStreamFull, error) { - return cmd.val, cmd.err -} - -func (cmd *XInfoStreamFullCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *XInfoStreamFullCmd) readReply(rd *proto.Reader) error { - n, err := rd.ReadArrayLen() - if err != nil { - return err - } - if n != 12 { - return fmt.Errorf("redis: got %d elements in XINFO STREAM FULL reply,"+ - "wanted 12", n) - } - - cmd.val = &XInfoStreamFull{} - - for i := 0; i < 6; i++ { - key, err := rd.ReadString() - if err != nil { - return err - } - - switch key { - case "length": - cmd.val.Length, err = rd.ReadIntReply() - case "radix-tree-keys": - cmd.val.RadixTreeKeys, err = rd.ReadIntReply() - case "radix-tree-nodes": - cmd.val.RadixTreeNodes, err = rd.ReadIntReply() - case "last-generated-id": - cmd.val.LastGeneratedID, err = rd.ReadString() - case "entries": - cmd.val.Entries, err = readXMessageSlice(rd) - case "groups": - cmd.val.Groups, err = readStreamGroups(rd) - default: - return fmt.Errorf("redis: unexpected content %s "+ - "in XINFO STREAM reply", key) - } - if err != nil { - return err - } - } - return nil -} - -func readStreamGroups(rd *proto.Reader) ([]XInfoStreamGroup, error) { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - groups := make([]XInfoStreamGroup, 0, n) - for i := 0; i < n; i++ { - nn, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if nn != 10 { - return nil, fmt.Errorf("redis: got %d elements in XINFO STREAM FULL reply,"+ - "wanted 10", nn) - } - - group := XInfoStreamGroup{} - - for f := 0; f < 5; f++ { - key, err := rd.ReadString() - if err != nil { - return nil, err - } - - switch key { - case "name": - group.Name, err = rd.ReadString() - case "last-delivered-id": - group.LastDeliveredID, err = rd.ReadString() - case "pel-count": - group.PelCount, err = rd.ReadIntReply() - case "pending": - group.Pending, err = readXInfoStreamGroupPending(rd) - case "consumers": - group.Consumers, err = readXInfoStreamConsumers(rd) - default: - return nil, fmt.Errorf("redis: unexpected content %s "+ - "in XINFO STREAM reply", key) - } - - if err != nil { - return nil, err - } - } - - groups = append(groups, group) - } - - return groups, nil -} - -func readXInfoStreamGroupPending(rd *proto.Reader) ([]XInfoStreamGroupPending, error) { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - - pending := make([]XInfoStreamGroupPending, 0, n) - - for i := 0; i < n; i++ { - nn, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if nn != 4 { - return nil, fmt.Errorf("redis: got %d elements in XINFO STREAM FULL reply,"+ - "wanted 4", nn) - } - - p := XInfoStreamGroupPending{} - - p.ID, err = rd.ReadString() - if err != nil { - return nil, err - } - - p.Consumer, err = rd.ReadString() - if err != nil { - return nil, err - } - - delivery, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - p.DeliveryTime = time.Unix(delivery/1000, delivery%1000*int64(time.Millisecond)) - - p.DeliveryCount, err = rd.ReadIntReply() - if err != nil { - return nil, err - } - - pending = append(pending, p) - } - - return pending, nil -} - -func readXInfoStreamConsumers(rd *proto.Reader) ([]XInfoStreamConsumer, error) { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - - consumers := make([]XInfoStreamConsumer, 0, n) - - for i := 0; i < n; i++ { - nn, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if nn != 8 { - return nil, fmt.Errorf("redis: got %d elements in XINFO STREAM FULL reply,"+ - "wanted 8", nn) - } - - c := XInfoStreamConsumer{} - - for f := 0; f < 4; f++ { - cKey, err := rd.ReadString() - if err != nil { - return nil, err - } - - switch cKey { - case "name": - c.Name, err = rd.ReadString() - case "seen-time": - seen, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - c.SeenTime = time.Unix(seen/1000, seen%1000*int64(time.Millisecond)) - case "pel-count": - c.PelCount, err = rd.ReadIntReply() - case "pending": - pendingNumber, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - - c.Pending = make([]XInfoStreamConsumerPending, 0, pendingNumber) - - for pn := 0; pn < pendingNumber; pn++ { - nn, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if nn != 3 { - return nil, fmt.Errorf("redis: got %d elements in XINFO STREAM reply,"+ - "wanted 3", nn) - } - - p := XInfoStreamConsumerPending{} - - p.ID, err = rd.ReadString() - if err != nil { - return nil, err - } - - delivery, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - p.DeliveryTime = time.Unix(delivery/1000, delivery%1000*int64(time.Millisecond)) - - p.DeliveryCount, err = rd.ReadIntReply() - if err != nil { - return nil, err - } - - c.Pending = append(c.Pending, p) - } - default: - return nil, fmt.Errorf("redis: unexpected content %s "+ - "in XINFO STREAM reply", cKey) - } - if err != nil { - return nil, err - } - } - consumers = append(consumers, c) - } - - return consumers, nil -} - -//------------------------------------------------------------------------------ - -type ZSliceCmd struct { - baseCmd - - val []Z -} - -var _ Cmder = (*ZSliceCmd)(nil) - -func NewZSliceCmd(ctx context.Context, args ...interface{}) *ZSliceCmd { - return &ZSliceCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *ZSliceCmd) SetVal(val []Z) { - cmd.val = val -} - -func (cmd *ZSliceCmd) Val() []Z { - return cmd.val -} - -func (cmd *ZSliceCmd) Result() ([]Z, error) { - return cmd.val, cmd.err -} - -func (cmd *ZSliceCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *ZSliceCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]Z, n/2) - for i := 0; i < len(cmd.val); i++ { - member, err := rd.ReadString() - if err != nil { - return nil, err - } - - score, err := rd.ReadFloatReply() - if err != nil { - return nil, err - } - - cmd.val[i] = Z{ - Member: member, - Score: score, - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type ZWithKeyCmd struct { - baseCmd - - val *ZWithKey -} - -var _ Cmder = (*ZWithKeyCmd)(nil) - -func NewZWithKeyCmd(ctx context.Context, args ...interface{}) *ZWithKeyCmd { - return &ZWithKeyCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *ZWithKeyCmd) SetVal(val *ZWithKey) { - cmd.val = val -} - -func (cmd *ZWithKeyCmd) Val() *ZWithKey { - return cmd.val -} - -func (cmd *ZWithKeyCmd) Result() (*ZWithKey, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *ZWithKeyCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *ZWithKeyCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - if n != 3 { - return nil, fmt.Errorf("got %d elements, expected 3", n) - } - - cmd.val = &ZWithKey{} - var err error - - cmd.val.Key, err = rd.ReadString() - if err != nil { - return nil, err - } - - cmd.val.Member, err = rd.ReadString() - if err != nil { - return nil, err - } - - cmd.val.Score, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type ScanCmd struct { - baseCmd - - page []string - cursor uint64 - - process cmdable -} - -var _ Cmder = (*ScanCmd)(nil) - -func NewScanCmd(ctx context.Context, process cmdable, args ...interface{}) *ScanCmd { - return &ScanCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - process: process, - } -} - -func (cmd *ScanCmd) SetVal(page []string, cursor uint64) { - cmd.page = page - cmd.cursor = cursor -} - -func (cmd *ScanCmd) Val() (keys []string, cursor uint64) { - return cmd.page, cmd.cursor -} - -func (cmd *ScanCmd) Result() (keys []string, cursor uint64, err error) { - return cmd.page, cmd.cursor, cmd.err -} - -func (cmd *ScanCmd) String() string { - return cmdString(cmd, cmd.page) -} - -func (cmd *ScanCmd) readReply(rd *proto.Reader) (err error) { - cmd.page, cmd.cursor, err = rd.ReadScanReply() - return err -} - -// Iterator creates a new ScanIterator. -func (cmd *ScanCmd) Iterator() *ScanIterator { - return &ScanIterator{ - cmd: cmd, - } -} - -//------------------------------------------------------------------------------ - -type ClusterNode struct { - ID string - Addr string -} - -type ClusterSlot struct { - Start int - End int - Nodes []ClusterNode -} - -type ClusterSlotsCmd struct { - baseCmd - - val []ClusterSlot -} - -var _ Cmder = (*ClusterSlotsCmd)(nil) - -func NewClusterSlotsCmd(ctx context.Context, args ...interface{}) *ClusterSlotsCmd { - return &ClusterSlotsCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *ClusterSlotsCmd) SetVal(val []ClusterSlot) { - cmd.val = val -} - -func (cmd *ClusterSlotsCmd) Val() []ClusterSlot { - return cmd.val -} - -func (cmd *ClusterSlotsCmd) Result() ([]ClusterSlot, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *ClusterSlotsCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *ClusterSlotsCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]ClusterSlot, n) - for i := 0; i < len(cmd.val); i++ { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n < 2 { - err := fmt.Errorf("redis: got %d elements in cluster info, expected at least 2", n) - return nil, err - } - - start, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - end, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - nodes := make([]ClusterNode, n-2) - for j := 0; j < len(nodes); j++ { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n != 2 && n != 3 { - err := fmt.Errorf("got %d elements in cluster info address, expected 2 or 3", n) - return nil, err - } - - ip, err := rd.ReadString() - if err != nil { - return nil, err - } - - port, err := rd.ReadString() - if err != nil { - return nil, err - } - - nodes[j].Addr = net.JoinHostPort(ip, port) - - if n == 3 { - id, err := rd.ReadString() - if err != nil { - return nil, err - } - nodes[j].ID = id - } - } - - cmd.val[i] = ClusterSlot{ - Start: int(start), - End: int(end), - Nodes: nodes, - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -// GeoLocation is used with GeoAdd to add geospatial location. -type GeoLocation struct { - Name string - Longitude, Latitude, Dist float64 - GeoHash int64 -} - -// GeoRadiusQuery is used with GeoRadius to query geospatial index. -type GeoRadiusQuery struct { - Radius float64 - // Can be m, km, ft, or mi. Default is km. - Unit string - WithCoord bool - WithDist bool - WithGeoHash bool - Count int - // Can be ASC or DESC. Default is no sort order. - Sort string - Store string - StoreDist string -} - -type GeoLocationCmd struct { - baseCmd - - q *GeoRadiusQuery - locations []GeoLocation -} - -var _ Cmder = (*GeoLocationCmd)(nil) - -func NewGeoLocationCmd(ctx context.Context, q *GeoRadiusQuery, args ...interface{}) *GeoLocationCmd { - return &GeoLocationCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: geoLocationArgs(q, args...), - }, - q: q, - } -} - -func geoLocationArgs(q *GeoRadiusQuery, args ...interface{}) []interface{} { - args = append(args, q.Radius) - if q.Unit != "" { - args = append(args, q.Unit) - } else { - args = append(args, "km") - } - if q.WithCoord { - args = append(args, "withcoord") - } - if q.WithDist { - args = append(args, "withdist") - } - if q.WithGeoHash { - args = append(args, "withhash") - } - if q.Count > 0 { - args = append(args, "count", q.Count) - } - if q.Sort != "" { - args = append(args, q.Sort) - } - if q.Store != "" { - args = append(args, "store") - args = append(args, q.Store) - } - if q.StoreDist != "" { - args = append(args, "storedist") - args = append(args, q.StoreDist) - } - return args -} - -func (cmd *GeoLocationCmd) SetVal(locations []GeoLocation) { - cmd.locations = locations -} - -func (cmd *GeoLocationCmd) Val() []GeoLocation { - return cmd.locations -} - -func (cmd *GeoLocationCmd) Result() ([]GeoLocation, error) { - return cmd.locations, cmd.err -} - -func (cmd *GeoLocationCmd) String() string { - return cmdString(cmd, cmd.locations) -} - -func (cmd *GeoLocationCmd) readReply(rd *proto.Reader) error { - v, err := rd.ReadArrayReply(newGeoLocationSliceParser(cmd.q)) - if err != nil { - return err - } - cmd.locations = v.([]GeoLocation) - return nil -} - -func newGeoLocationSliceParser(q *GeoRadiusQuery) proto.MultiBulkParse { - return func(rd *proto.Reader, n int64) (interface{}, error) { - locs := make([]GeoLocation, 0, n) - for i := int64(0); i < n; i++ { - v, err := rd.ReadReply(newGeoLocationParser(q)) - if err != nil { - return nil, err - } - switch vv := v.(type) { - case string: - locs = append(locs, GeoLocation{ - Name: vv, - }) - case *GeoLocation: - // TODO: avoid copying - locs = append(locs, *vv) - default: - return nil, fmt.Errorf("got %T, expected string or *GeoLocation", v) - } - } - return locs, nil - } -} - -func newGeoLocationParser(q *GeoRadiusQuery) proto.MultiBulkParse { - return func(rd *proto.Reader, n int64) (interface{}, error) { - var loc GeoLocation - var err error - - loc.Name, err = rd.ReadString() - if err != nil { - return nil, err - } - if q.WithDist { - loc.Dist, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - } - if q.WithGeoHash { - loc.GeoHash, err = rd.ReadIntReply() - if err != nil { - return nil, err - } - } - if q.WithCoord { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n != 2 { - return nil, fmt.Errorf("got %d coordinates, expected 2", n) - } - - loc.Longitude, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - loc.Latitude, err = rd.ReadFloatReply() - if err != nil { - return nil, err - } - } - - return &loc, nil - } -} - -//------------------------------------------------------------------------------ - -// GeoSearchQuery is used for GEOSearch/GEOSearchStore command query. -type GeoSearchQuery struct { - Member string - - // Latitude and Longitude when using FromLonLat option. - Longitude float64 - Latitude float64 - - // Distance and unit when using ByRadius option. - // Can use m, km, ft, or mi. Default is km. - Radius float64 - RadiusUnit string - - // Height, width and unit when using ByBox option. - // Can be m, km, ft, or mi. Default is km. - BoxWidth float64 - BoxHeight float64 - BoxUnit string - - // Can be ASC or DESC. Default is no sort order. - Sort string - Count int - CountAny bool -} - -type GeoSearchLocationQuery struct { - GeoSearchQuery - - WithCoord bool - WithDist bool - WithHash bool -} - -type GeoSearchStoreQuery struct { - GeoSearchQuery - - // When using the StoreDist option, the command stores the items in a - // sorted set populated with their distance from the center of the circle or box, - // as a floating-point number, in the same unit specified for that shape. - StoreDist bool -} - -func geoSearchLocationArgs(q *GeoSearchLocationQuery, args []interface{}) []interface{} { - args = geoSearchArgs(&q.GeoSearchQuery, args) - - if q.WithCoord { - args = append(args, "withcoord") - } - if q.WithDist { - args = append(args, "withdist") - } - if q.WithHash { - args = append(args, "withhash") - } - - return args -} - -func geoSearchArgs(q *GeoSearchQuery, args []interface{}) []interface{} { - if q.Member != "" { - args = append(args, "frommember", q.Member) - } else { - args = append(args, "fromlonlat", q.Longitude, q.Latitude) - } - - if q.Radius > 0 { - if q.RadiusUnit == "" { - q.RadiusUnit = "km" - } - args = append(args, "byradius", q.Radius, q.RadiusUnit) - } else { - if q.BoxUnit == "" { - q.BoxUnit = "km" - } - args = append(args, "bybox", q.BoxWidth, q.BoxHeight, q.BoxUnit) - } - - if q.Sort != "" { - args = append(args, q.Sort) - } - - if q.Count > 0 { - args = append(args, "count", q.Count) - if q.CountAny { - args = append(args, "any") - } - } - - return args -} - -type GeoSearchLocationCmd struct { - baseCmd - - opt *GeoSearchLocationQuery - val []GeoLocation -} - -var _ Cmder = (*GeoSearchLocationCmd)(nil) - -func NewGeoSearchLocationCmd( - ctx context.Context, opt *GeoSearchLocationQuery, args ...interface{}, -) *GeoSearchLocationCmd { - return &GeoSearchLocationCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - opt: opt, - } -} - -func (cmd *GeoSearchLocationCmd) SetVal(val []GeoLocation) { - cmd.val = val -} - -func (cmd *GeoSearchLocationCmd) Val() []GeoLocation { - return cmd.val -} - -func (cmd *GeoSearchLocationCmd) Result() ([]GeoLocation, error) { - return cmd.val, cmd.err -} - -func (cmd *GeoSearchLocationCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *GeoSearchLocationCmd) readReply(rd *proto.Reader) error { - n, err := rd.ReadArrayLen() - if err != nil { - return err - } - - cmd.val = make([]GeoLocation, n) - for i := 0; i < n; i++ { - _, err = rd.ReadArrayLen() - if err != nil { - return err - } - - var loc GeoLocation - - loc.Name, err = rd.ReadString() - if err != nil { - return err - } - if cmd.opt.WithDist { - loc.Dist, err = rd.ReadFloatReply() - if err != nil { - return err - } - } - if cmd.opt.WithHash { - loc.GeoHash, err = rd.ReadIntReply() - if err != nil { - return err - } - } - if cmd.opt.WithCoord { - nn, err := rd.ReadArrayLen() - if err != nil { - return err - } - if nn != 2 { - return fmt.Errorf("got %d coordinates, expected 2", nn) - } - - loc.Longitude, err = rd.ReadFloatReply() - if err != nil { - return err - } - loc.Latitude, err = rd.ReadFloatReply() - if err != nil { - return err - } - } - - cmd.val[i] = loc - } - - return nil -} - -//------------------------------------------------------------------------------ - -type GeoPos struct { - Longitude, Latitude float64 -} - -type GeoPosCmd struct { - baseCmd - - val []*GeoPos -} - -var _ Cmder = (*GeoPosCmd)(nil) - -func NewGeoPosCmd(ctx context.Context, args ...interface{}) *GeoPosCmd { - return &GeoPosCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *GeoPosCmd) SetVal(val []*GeoPos) { - cmd.val = val -} - -func (cmd *GeoPosCmd) Val() []*GeoPos { - return cmd.val -} - -func (cmd *GeoPosCmd) Result() ([]*GeoPos, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *GeoPosCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *GeoPosCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]*GeoPos, n) - for i := 0; i < len(cmd.val); i++ { - i := i - _, err := rd.ReadReply(func(rd *proto.Reader, n int64) (interface{}, error) { - longitude, err := rd.ReadFloatReply() - if err != nil { - return nil, err - } - - latitude, err := rd.ReadFloatReply() - if err != nil { - return nil, err - } - - cmd.val[i] = &GeoPos{ - Longitude: longitude, - Latitude: latitude, - } - return nil, nil - }) - if err != nil { - if err == Nil { - cmd.val[i] = nil - continue - } - return nil, err - } - } - return nil, nil - }) - return err -} - -//------------------------------------------------------------------------------ - -type CommandInfo struct { - Name string - Arity int8 - Flags []string - ACLFlags []string - FirstKeyPos int8 - LastKeyPos int8 - StepCount int8 - ReadOnly bool -} - -type CommandsInfoCmd struct { - baseCmd - - val map[string]*CommandInfo -} - -var _ Cmder = (*CommandsInfoCmd)(nil) - -func NewCommandsInfoCmd(ctx context.Context, args ...interface{}) *CommandsInfoCmd { - return &CommandsInfoCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *CommandsInfoCmd) SetVal(val map[string]*CommandInfo) { - cmd.val = val -} - -func (cmd *CommandsInfoCmd) Val() map[string]*CommandInfo { - return cmd.val -} - -func (cmd *CommandsInfoCmd) Result() (map[string]*CommandInfo, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *CommandsInfoCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *CommandsInfoCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make(map[string]*CommandInfo, n) - for i := int64(0); i < n; i++ { - v, err := rd.ReadReply(commandInfoParser) - if err != nil { - return nil, err - } - vv := v.(*CommandInfo) - cmd.val[vv.Name] = vv - } - return nil, nil - }) - return err -} - -func commandInfoParser(rd *proto.Reader, n int64) (interface{}, error) { - const numArgRedis5 = 6 - const numArgRedis6 = 7 - - switch n { - case numArgRedis5, numArgRedis6: - // continue - default: - return nil, fmt.Errorf("redis: got %d elements in COMMAND reply, wanted 7", n) - } - - var cmd CommandInfo - var err error - - cmd.Name, err = rd.ReadString() - if err != nil { - return nil, err - } - - arity, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.Arity = int8(arity) - - _, err = rd.ReadReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.Flags = make([]string, n) - for i := 0; i < len(cmd.Flags); i++ { - switch s, err := rd.ReadString(); { - case err == Nil: - cmd.Flags[i] = "" - case err != nil: - return nil, err - default: - cmd.Flags[i] = s - } - } - return nil, nil - }) - if err != nil { - return nil, err - } - - firstKeyPos, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.FirstKeyPos = int8(firstKeyPos) - - lastKeyPos, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.LastKeyPos = int8(lastKeyPos) - - stepCount, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - cmd.StepCount = int8(stepCount) - - for _, flag := range cmd.Flags { - if flag == "readonly" { - cmd.ReadOnly = true - break - } - } - - if n == numArgRedis5 { - return &cmd, nil - } - - _, err = rd.ReadReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.ACLFlags = make([]string, n) - for i := 0; i < len(cmd.ACLFlags); i++ { - switch s, err := rd.ReadString(); { - case err == Nil: - cmd.ACLFlags[i] = "" - case err != nil: - return nil, err - default: - cmd.ACLFlags[i] = s - } - } - return nil, nil - }) - if err != nil { - return nil, err - } - - return &cmd, nil -} - -//------------------------------------------------------------------------------ - -type cmdsInfoCache struct { - fn func(ctx context.Context) (map[string]*CommandInfo, error) - - once internal.Once - cmds map[string]*CommandInfo -} - -func newCmdsInfoCache(fn func(ctx context.Context) (map[string]*CommandInfo, error)) *cmdsInfoCache { - return &cmdsInfoCache{ - fn: fn, - } -} - -func (c *cmdsInfoCache) Get(ctx context.Context) (map[string]*CommandInfo, error) { - err := c.once.Do(func() error { - cmds, err := c.fn(ctx) - if err != nil { - return err - } - - // Extensions have cmd names in upper case. Convert them to lower case. - for k, v := range cmds { - lower := internal.ToLower(k) - if lower != k { - cmds[lower] = v - } - } - - c.cmds = cmds - return nil - }) - return c.cmds, err -} - -//------------------------------------------------------------------------------ - -type SlowLog struct { - ID int64 - Time time.Time - Duration time.Duration - Args []string - // These are also optional fields emitted only by Redis 4.0 or greater: - // https://redis.io/commands/slowlog#output-format - ClientAddr string - ClientName string -} - -type SlowLogCmd struct { - baseCmd - - val []SlowLog -} - -var _ Cmder = (*SlowLogCmd)(nil) - -func NewSlowLogCmd(ctx context.Context, args ...interface{}) *SlowLogCmd { - return &SlowLogCmd{ - baseCmd: baseCmd{ - ctx: ctx, - args: args, - }, - } -} - -func (cmd *SlowLogCmd) SetVal(val []SlowLog) { - cmd.val = val -} - -func (cmd *SlowLogCmd) Val() []SlowLog { - return cmd.val -} - -func (cmd *SlowLogCmd) Result() ([]SlowLog, error) { - return cmd.Val(), cmd.Err() -} - -func (cmd *SlowLogCmd) String() string { - return cmdString(cmd, cmd.val) -} - -func (cmd *SlowLogCmd) readReply(rd *proto.Reader) error { - _, err := rd.ReadArrayReply(func(rd *proto.Reader, n int64) (interface{}, error) { - cmd.val = make([]SlowLog, n) - for i := 0; i < len(cmd.val); i++ { - n, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if n < 4 { - err := fmt.Errorf("redis: got %d elements in slowlog get, expected at least 4", n) - return nil, err - } - - id, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - - createdAt, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - createdAtTime := time.Unix(createdAt, 0) - - costs, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - costsDuration := time.Duration(costs) * time.Microsecond - - cmdLen, err := rd.ReadArrayLen() - if err != nil { - return nil, err - } - if cmdLen < 1 { - err := fmt.Errorf("redis: got %d elements commands reply in slowlog get, expected at least 1", cmdLen) - return nil, err - } - - cmdString := make([]string, cmdLen) - for i := 0; i < cmdLen; i++ { - cmdString[i], err = rd.ReadString() - if err != nil { - return nil, err - } - } - - var address, name string - for i := 4; i < n; i++ { - str, err := rd.ReadString() - if err != nil { - return nil, err - } - if i == 4 { - address = str - } else if i == 5 { - name = str - } - } - - cmd.val[i] = SlowLog{ - ID: id, - Time: createdAtTime, - Duration: costsDuration, - Args: cmdString, - ClientAddr: address, - ClientName: name, - } - } - return nil, nil - }) - return err -} diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command_test.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command_test.go deleted file mode 100644 index 168f9f6..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/command_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package redis_test - -import ( - "errors" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - redis "github.com/go-redis/redis/v8" -) - -var _ = Describe("Cmd", func() { - var client *redis.Client - - BeforeEach(func() { - client = redis.NewClient(redisOptions()) - Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - Expect(client.Close()).NotTo(HaveOccurred()) - }) - - It("implements Stringer", func() { - set := client.Set(ctx, "foo", "bar", 0) - Expect(set.String()).To(Equal("set foo bar: OK")) - - get := client.Get(ctx, "foo") - Expect(get.String()).To(Equal("get foo: bar")) - }) - - It("has val/err", func() { - set := client.Set(ctx, "key", "hello", 0) - Expect(set.Err()).NotTo(HaveOccurred()) - Expect(set.Val()).To(Equal("OK")) - - get := client.Get(ctx, "key") - Expect(get.Err()).NotTo(HaveOccurred()) - Expect(get.Val()).To(Equal("hello")) - - Expect(set.Err()).NotTo(HaveOccurred()) - Expect(set.Val()).To(Equal("OK")) - }) - - It("has helpers", func() { - set := client.Set(ctx, "key", "10", 0) - Expect(set.Err()).NotTo(HaveOccurred()) - - n, err := client.Get(ctx, "key").Int64() - Expect(err).NotTo(HaveOccurred()) - Expect(n).To(Equal(int64(10))) - - un, err := client.Get(ctx, "key").Uint64() - Expect(err).NotTo(HaveOccurred()) - Expect(un).To(Equal(uint64(10))) - - f, err := client.Get(ctx, "key").Float64() - Expect(err).NotTo(HaveOccurred()) - Expect(f).To(Equal(float64(10))) - }) - - It("supports float32", func() { - f := float32(66.97) - - err := client.Set(ctx, "float_key", f, 0).Err() - Expect(err).NotTo(HaveOccurred()) - - val, err := client.Get(ctx, "float_key").Float32() - Expect(err).NotTo(HaveOccurred()) - Expect(val).To(Equal(f)) - }) - - It("supports time.Time", func() { - tm := time.Date(2019, 1, 1, 9, 45, 10, 222125, time.UTC) - - err := client.Set(ctx, "time_key", tm, 0).Err() - Expect(err).NotTo(HaveOccurred()) - - s, err := client.Get(ctx, "time_key").Result() - Expect(err).NotTo(HaveOccurred()) - Expect(s).To(Equal("2019-01-01T09:45:10.000222125Z")) - - tm2, err := client.Get(ctx, "time_key").Time() - Expect(err).NotTo(HaveOccurred()) - Expect(tm2).To(BeTemporally("==", tm)) - }) - - It("allows to set custom error", func() { - e := errors.New("custom error") - cmd := redis.Cmd{} - cmd.SetErr(e) - _, err := cmd.Result() - Expect(err).To(Equal(e)) - }) -}) diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/commands.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/commands.go deleted file mode 100644 index bbfe089..0000000 --- a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/commands.go +++ /dev/null @@ -1,3475 +0,0 @@ -package redis - -import ( - "context" - "errors" - "io" - "time" - - "github.com/go-redis/redis/v8/internal" -) - -// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0, -// otherwise you will receive an error: (error) ERR syntax error. -// For example: -// -// rdb.Set(ctx, key, value, redis.KeepTTL) -const KeepTTL = -1 - -func usePrecise(dur time.Duration) bool { - return dur < time.Second || dur%time.Second != 0 -} - -func formatMs(ctx context.Context, dur time.Duration) int64 { - if dur > 0 && dur < time.Millisecond { - internal.Logger.Printf( - ctx, - "specified duration is %s, but minimal supported value is %s - truncating to 1ms", - dur, time.Millisecond, - ) - return 1 - } - return int64(dur / time.Millisecond) -} - -func formatSec(ctx context.Context, dur time.Duration) int64 { - if dur > 0 && dur < time.Second { - internal.Logger.Printf( - ctx, - "specified duration is %s, but minimal supported value is %s - truncating to 1s", - dur, time.Second, - ) - return 1 - } - return int64(dur / time.Second) -} - -func appendArgs(dst, src []interface{}) []interface{} { - if len(src) == 1 { - return appendArg(dst, src[0]) - } - - dst = append(dst, src...) - return dst -} - -func appendArg(dst []interface{}, arg interface{}) []interface{} { - switch arg := arg.(type) { - case []string: - for _, s := range arg { - dst = append(dst, s) - } - return dst - case []interface{}: - dst = append(dst, arg...) - return dst - case map[string]interface{}: - for k, v := range arg { - dst = append(dst, k, v) - } - return dst - case map[string]string: - for k, v := range arg { - dst = append(dst, k, v) - } - return dst - default: - return append(dst, arg) - } -} - -type Cmdable interface { - Pipeline() Pipeliner - Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) - - TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) - TxPipeline() Pipeliner - - Command(ctx context.Context) *CommandsInfoCmd - ClientGetName(ctx context.Context) *StringCmd - Echo(ctx context.Context, message interface{}) *StringCmd - Ping(ctx context.Context) *StatusCmd - Quit(ctx context.Context) *StatusCmd - Del(ctx context.Context, keys ...string) *IntCmd - Unlink(ctx context.Context, keys ...string) *IntCmd - Dump(ctx context.Context, key string) *StringCmd - Exists(ctx context.Context, keys ...string) *IntCmd - Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd - ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd - ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd - ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd - ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd - ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd - Keys(ctx context.Context, pattern string) *StringSliceCmd - Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd - Move(ctx context.Context, key string, db int) *BoolCmd - ObjectRefCount(ctx context.Context, key string) *IntCmd - ObjectEncoding(ctx context.Context, key string) *StringCmd - ObjectIdleTime(ctx context.Context, key string) *DurationCmd - Persist(ctx context.Context, key string) *BoolCmd - PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd - PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd - PTTL(ctx context.Context, key string) *DurationCmd - RandomKey(ctx context.Context) *StringCmd - Rename(ctx context.Context, key, newkey string) *StatusCmd - RenameNX(ctx context.Context, key, newkey string) *BoolCmd - Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd - RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd - Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd - SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd - SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd - Touch(ctx context.Context, keys ...string) *IntCmd - TTL(ctx context.Context, key string) *DurationCmd - Type(ctx context.Context, key string) *StatusCmd - Append(ctx context.Context, key, value string) *IntCmd - Decr(ctx context.Context, key string) *IntCmd - DecrBy(ctx context.Context, key string, decrement int64) *IntCmd - Get(ctx context.Context, key string) *StringCmd - GetRange(ctx context.Context, key string, start, end int64) *StringCmd - GetSet(ctx context.Context, key string, value interface{}) *StringCmd - GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd - GetDel(ctx context.Context, key string) *StringCmd - Incr(ctx context.Context, key string) *IntCmd - IncrBy(ctx context.Context, key string, value int64) *IntCmd - IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd - MGet(ctx context.Context, keys ...string) *SliceCmd - MSet(ctx context.Context, values ...interface{}) *StatusCmd - MSetNX(ctx context.Context, values ...interface{}) *BoolCmd - Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd - SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd - // TODO: rename to SetEx - SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd - SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd - SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd - SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd - StrLen(ctx context.Context, key string) *IntCmd - Copy(ctx context.Context, sourceKey string, destKey string, db int, replace bool) *IntCmd - - GetBit(ctx context.Context, key string, offset int64) *IntCmd - SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd - BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd - BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd - BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd - BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd - BitOpNot(ctx context.Context, destKey string, key string) *IntCmd - BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd - BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd - - Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd - ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd - SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd - HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd - ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd - - HDel(ctx context.Context, key string, fields ...string) *IntCmd - HExists(ctx context.Context, key, field string) *BoolCmd - HGet(ctx context.Context, key, field string) *StringCmd - HGetAll(ctx context.Context, key string) *StringStringMapCmd - HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd - HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd - HKeys(ctx context.Context, key string) *StringSliceCmd - HLen(ctx context.Context, key string) *IntCmd - HMGet(ctx context.Context, key string, fields ...string) *SliceCmd - HSet(ctx context.Context, key string, values ...interface{}) *IntCmd - HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd - HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd - HVals(ctx context.Context, key string) *StringSliceCmd - HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd - - BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd - BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd - BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd - LIndex(ctx context.Context, key string, index int64) *StringCmd - LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd - LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd - LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd - LLen(ctx context.Context, key string) *IntCmd - LPop(ctx context.Context, key string) *StringCmd - LPopCount(ctx context.Context, key string, count int) *StringSliceCmd - LPos(ctx context.Context, key string, value string, args LPosArgs) *IntCmd - LPosCount(ctx context.Context, key string, value string, count int64, args LPosArgs) *IntSliceCmd - LPush(ctx context.Context, key string, values ...interface{}) *IntCmd - LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd - LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd - LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd - LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd - LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd - RPop(ctx context.Context, key string) *StringCmd - RPopCount(ctx context.Context, key string, count int) *StringSliceCmd - RPopLPush(ctx context.Context, source, destination string) *StringCmd - RPush(ctx context.Context, key string, values ...interface{}) *IntCmd - RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd - LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd - BLMove(ctx context.Context, source, destination, srcpos, destpos string, timeout time.Duration) *StringCmd - - SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd - SCard(ctx context.Context, key string) *IntCmd - SDiff(ctx context.Context, keys ...string) *StringSliceCmd - SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd - SInter(ctx context.Context, keys ...string) *StringSliceCmd - SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd - SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd - SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd - SMembers(ctx context.Context, key string) *StringSliceCmd - SMembersMap(ctx context.Context, key string) *StringStructMapCmd - SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd - SPop(ctx context.Context, key string) *StringCmd - SPopN(ctx context.Context, key string, count int64) *StringSliceCmd - SRandMember(ctx context.Context, key string) *StringCmd - SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd - SRem(ctx context.Context, key string, members ...interface{}) *IntCmd - SUnion(ctx context.Context, keys ...string) *StringSliceCmd - SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd - - XAdd(ctx context.Context, a *XAddArgs) *StringCmd - XDel(ctx context.Context, stream string, ids ...string) *IntCmd - XLen(ctx context.Context, stream string) *IntCmd - XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd - XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd - XRevRange(ctx context.Context, stream string, start, stop string) *XMessageSliceCmd - XRevRangeN(ctx context.Context, stream string, start, stop string, count int64) *XMessageSliceCmd - XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd - XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd - XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd - XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd - XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd - XGroupDestroy(ctx context.Context, stream, group string) *IntCmd - XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd - XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd - XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd - XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd - XPending(ctx context.Context, stream, group string) *XPendingCmd - XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd - XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd - XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd - XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd - XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd - - // TODO: XTrim and XTrimApprox remove in v9. - XTrim(ctx context.Context, key string, maxLen int64) *IntCmd - XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmd - XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd - XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd - XTrimMinID(ctx context.Context, key string, minID string) *IntCmd - XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd - XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd - XInfoStream(ctx context.Context, key string) *XInfoStreamCmd - XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd - XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd - - BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd - BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd - - // TODO: remove - // ZAddCh - // ZIncr - // ZAddNXCh - // ZAddXXCh - // ZIncrNX - // ZIncrXX - // in v9. - // use ZAddArgs and ZAddArgsIncr. - - ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd - ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd - ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd - ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd - ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd - ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd - ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd - ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd - ZIncr(ctx context.Context, key string, member *Z) *FloatCmd - ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd - ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd - ZCard(ctx context.Context, key string) *IntCmd - ZCount(ctx context.Context, key, min, max string) *IntCmd - ZLexCount(ctx context.Context, key, min, max string) *IntCmd - ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd - ZInter(ctx context.Context, store *ZStore) *StringSliceCmd - ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd - ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd - ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd - ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd - ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd - ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd - ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd - ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd - ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd - ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd - ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd - ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd - ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd - ZRank(ctx context.Context, key, member string) *IntCmd - ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd - ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd - ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd - ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd - ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd - ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd - ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd - ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd - ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd - ZRevRank(ctx context.Context, key, member string) *IntCmd - ZScore(ctx context.Context, key, member string) *FloatCmd - ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd - ZUnion(ctx context.Context, store ZStore) *StringSliceCmd - ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd - ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd - ZDiff(ctx context.Context, keys ...string) *StringSliceCmd - ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd - ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd - - PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd - PFCount(ctx context.Context, keys ...string) *IntCmd - PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd - - BgRewriteAOF(ctx context.Context) *StatusCmd - BgSave(ctx context.Context) *StatusCmd - ClientKill(ctx context.Context, ipPort string) *StatusCmd - ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd - ClientList(ctx context.Context) *StringCmd - ClientPause(ctx context.Context, dur time.Duration) *BoolCmd - ClientID(ctx context.Context) *IntCmd - ConfigGet(ctx context.Context, parameter string) *SliceCmd - ConfigResetStat(ctx context.Context) *StatusCmd - ConfigSet(ctx context.Context, parameter, value string) *StatusCmd - ConfigRewrite(ctx context.Context) *StatusCmd - DBSize(ctx context.Context) *IntCmd - FlushAll(ctx context.Context) *StatusCmd - FlushAllAsync(ctx context.Context) *StatusCmd - FlushDB(ctx context.Context) *StatusCmd - FlushDBAsync(ctx context.Context) *StatusCmd - Info(ctx context.Context, section ...string) *StringCmd - LastSave(ctx context.Context) *IntCmd - Save(ctx context.Context) *StatusCmd - Shutdown(ctx context.Context) *StatusCmd - ShutdownSave(ctx context.Context) *StatusCmd - ShutdownNoSave(ctx context.Context) *StatusCmd - SlaveOf(ctx context.Context, host, port string) *StatusCmd - Time(ctx context.Context) *TimeCmd - DebugObject(ctx context.Context, key string) *StringCmd - ReadOnly(ctx context.Context) *StatusCmd - ReadWrite(ctx context.Context) *StatusCmd - MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd - - Eval(ctx context.Context, script string, keys []string, args ...interface{}) *Cmd - EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *Cmd - ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd - ScriptFlush(ctx context.Context) *StatusCmd - ScriptKill(ctx context.Context) *StatusCmd - ScriptLoad(ctx context.Context, script string) *StringCmd - - Publish(ctx context.Context, channel string, message interface{}) *IntCmd - PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd - PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd - PubSubNumPat(ctx context.Context) *IntCmd - - ClusterSlots(ctx context.Context) *ClusterSlotsCmd - ClusterNodes(ctx context.Context) *StringCmd - ClusterMeet(ctx context.Context, host, port string) *StatusCmd - ClusterForget(ctx context.Context, nodeID string) *StatusCmd - ClusterReplicate(ctx context.Context, nodeID string) *StatusCmd - ClusterResetSoft(ctx context.Context) *StatusCmd - ClusterResetHard(ctx context.Context) *StatusCmd - ClusterInfo(ctx context.Context) *StringCmd - ClusterKeySlot(ctx context.Context, key string) *IntCmd - ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd - ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd - ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd - ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd - ClusterDelSlotsRange(ctx context.Context, min, max int) *StatusCmd - ClusterSaveConfig(ctx context.Context) *StatusCmd - ClusterSlaves(ctx context.Context, nodeID string) *StringSliceCmd - ClusterFailover(ctx context.Context) *StatusCmd - ClusterAddSlots(ctx context.Context, slots ...int) *StatusCmd - ClusterAddSlotsRange(ctx context.Context, min, max int) *StatusCmd - - GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd - GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd - GeoRadius(ctx context.Context, key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd - GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, query *GeoRadiusQuery) *IntCmd - GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd - GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd - GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd - GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd - GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd - GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd - GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd -} - -type StatefulCmdable interface { - Cmdable - Auth(ctx context.Context, password string) *StatusCmd - AuthACL(ctx context.Context, username, password string) *StatusCmd - Select(ctx context.Context, index int) *StatusCmd - SwapDB(ctx context.Context, index1, index2 int) *StatusCmd - ClientSetName(ctx context.Context, name string) *BoolCmd -} - -var ( - _ Cmdable = (*Client)(nil) - _ Cmdable = (*Tx)(nil) - _ Cmdable = (*Ring)(nil) - _ Cmdable = (*ClusterClient)(nil) -) - -type cmdable func(ctx context.Context, cmd Cmder) error - -type statefulCmdable func(ctx context.Context, cmd Cmder) error - -//------------------------------------------------------------------------------ - -func (c statefulCmdable) Auth(ctx context.Context, password string) *StatusCmd { - cmd := NewStatusCmd(ctx, "auth", password) - _ = c(ctx, cmd) - return cmd -} - -// AuthACL Perform an AUTH command, using the given user and pass. -// Should be used to authenticate the current connection with one of the connections defined in the ACL list -// when connecting to a Redis 6.0 instance, or greater, that is using the Redis ACL system. -func (c statefulCmdable) AuthACL(ctx context.Context, username, password string) *StatusCmd { - cmd := NewStatusCmd(ctx, "auth", username, password) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Wait(ctx context.Context, numSlaves int, timeout time.Duration) *IntCmd { - cmd := NewIntCmd(ctx, "wait", numSlaves, int(timeout/time.Millisecond)) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -func (c statefulCmdable) Select(ctx context.Context, index int) *StatusCmd { - cmd := NewStatusCmd(ctx, "select", index) - _ = c(ctx, cmd) - return cmd -} - -func (c statefulCmdable) SwapDB(ctx context.Context, index1, index2 int) *StatusCmd { - cmd := NewStatusCmd(ctx, "swapdb", index1, index2) - _ = c(ctx, cmd) - return cmd -} - -// ClientSetName assigns a name to the connection. -func (c statefulCmdable) ClientSetName(ctx context.Context, name string) *BoolCmd { - cmd := NewBoolCmd(ctx, "client", "setname", name) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) Command(ctx context.Context) *CommandsInfoCmd { - cmd := NewCommandsInfoCmd(ctx, "command") - _ = c(ctx, cmd) - return cmd -} - -// ClientGetName returns the name of the connection. -func (c cmdable) ClientGetName(ctx context.Context) *StringCmd { - cmd := NewStringCmd(ctx, "client", "getname") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Echo(ctx context.Context, message interface{}) *StringCmd { - cmd := NewStringCmd(ctx, "echo", message) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Ping(ctx context.Context) *StatusCmd { - cmd := NewStatusCmd(ctx, "ping") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Quit(_ context.Context) *StatusCmd { - panic("not implemented") -} - -func (c cmdable) Del(ctx context.Context, keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "del" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Unlink(ctx context.Context, keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "unlink" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Dump(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "dump", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Exists(ctx context.Context, keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "exists" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd { - return c.expire(ctx, key, expiration, "") -} - -func (c cmdable) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd { - return c.expire(ctx, key, expiration, "NX") -} - -func (c cmdable) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd { - return c.expire(ctx, key, expiration, "XX") -} - -func (c cmdable) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd { - return c.expire(ctx, key, expiration, "GT") -} - -func (c cmdable) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd { - return c.expire(ctx, key, expiration, "LT") -} - -func (c cmdable) expire( - ctx context.Context, key string, expiration time.Duration, mode string, -) *BoolCmd { - args := make([]interface{}, 3, 4) - args[0] = "expire" - args[1] = key - args[2] = formatSec(ctx, expiration) - if mode != "" { - args = append(args, mode) - } - - cmd := NewBoolCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd { - cmd := NewBoolCmd(ctx, "expireat", key, tm.Unix()) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Keys(ctx context.Context, pattern string) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "keys", pattern) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd { - cmd := NewStatusCmd( - ctx, - "migrate", - host, - port, - key, - db, - formatMs(ctx, timeout), - ) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Move(ctx context.Context, key string, db int) *BoolCmd { - cmd := NewBoolCmd(ctx, "move", key, db) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ObjectRefCount(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "object", "refcount", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ObjectEncoding(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "object", "encoding", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ObjectIdleTime(ctx context.Context, key string) *DurationCmd { - cmd := NewDurationCmd(ctx, time.Second, "object", "idletime", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Persist(ctx context.Context, key string) *BoolCmd { - cmd := NewBoolCmd(ctx, "persist", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd { - cmd := NewBoolCmd(ctx, "pexpire", key, formatMs(ctx, expiration)) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd { - cmd := NewBoolCmd( - ctx, - "pexpireat", - key, - tm.UnixNano()/int64(time.Millisecond), - ) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) PTTL(ctx context.Context, key string) *DurationCmd { - cmd := NewDurationCmd(ctx, time.Millisecond, "pttl", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RandomKey(ctx context.Context) *StringCmd { - cmd := NewStringCmd(ctx, "randomkey") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Rename(ctx context.Context, key, newkey string) *StatusCmd { - cmd := NewStatusCmd(ctx, "rename", key, newkey) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RenameNX(ctx context.Context, key, newkey string) *BoolCmd { - cmd := NewBoolCmd(ctx, "renamenx", key, newkey) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd { - cmd := NewStatusCmd( - ctx, - "restore", - key, - formatMs(ctx, ttl), - value, - ) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd { - cmd := NewStatusCmd( - ctx, - "restore", - key, - formatMs(ctx, ttl), - value, - "replace", - ) - _ = c(ctx, cmd) - return cmd -} - -type Sort struct { - By string - Offset, Count int64 - Get []string - Order string - Alpha bool -} - -func (sort *Sort) args(key string) []interface{} { - args := []interface{}{"sort", key} - if sort.By != "" { - args = append(args, "by", sort.By) - } - if sort.Offset != 0 || sort.Count != 0 { - args = append(args, "limit", sort.Offset, sort.Count) - } - for _, get := range sort.Get { - args = append(args, "get", get) - } - if sort.Order != "" { - args = append(args, sort.Order) - } - if sort.Alpha { - args = append(args, "alpha") - } - return args -} - -func (c cmdable) Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, sort.args(key)...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd { - args := sort.args(key) - if store != "" { - args = append(args, "store", store) - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd { - cmd := NewSliceCmd(ctx, sort.args(key)...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Touch(ctx context.Context, keys ...string) *IntCmd { - args := make([]interface{}, len(keys)+1) - args[0] = "touch" - for i, key := range keys { - args[i+1] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) TTL(ctx context.Context, key string) *DurationCmd { - cmd := NewDurationCmd(ctx, time.Second, "ttl", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Type(ctx context.Context, key string) *StatusCmd { - cmd := NewStatusCmd(ctx, "type", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Append(ctx context.Context, key, value string) *IntCmd { - cmd := NewIntCmd(ctx, "append", key, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Decr(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "decr", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) DecrBy(ctx context.Context, key string, decrement int64) *IntCmd { - cmd := NewIntCmd(ctx, "decrby", key, decrement) - _ = c(ctx, cmd) - return cmd -} - -// Get Redis `GET key` command. It returns redis.Nil error when key does not exist. -func (c cmdable) Get(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "get", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) GetRange(ctx context.Context, key string, start, end int64) *StringCmd { - cmd := NewStringCmd(ctx, "getrange", key, start, end) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) GetSet(ctx context.Context, key string, value interface{}) *StringCmd { - cmd := NewStringCmd(ctx, "getset", key, value) - _ = c(ctx, cmd) - return cmd -} - -// GetEx An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist). -// Requires Redis >= 6.2.0. -func (c cmdable) GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd { - args := make([]interface{}, 0, 4) - args = append(args, "getex", key) - if expiration > 0 { - if usePrecise(expiration) { - args = append(args, "px", formatMs(ctx, expiration)) - } else { - args = append(args, "ex", formatSec(ctx, expiration)) - } - } else if expiration == 0 { - args = append(args, "persist") - } - - cmd := NewStringCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// GetDel redis-server version >= 6.2.0. -func (c cmdable) GetDel(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "getdel", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Incr(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "incr", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) IncrBy(ctx context.Context, key string, value int64) *IntCmd { - cmd := NewIntCmd(ctx, "incrby", key, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd { - cmd := NewFloatCmd(ctx, "incrbyfloat", key, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) MGet(ctx context.Context, keys ...string) *SliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "mget" - for i, key := range keys { - args[1+i] = key - } - cmd := NewSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// MSet is like Set but accepts multiple values: -// - MSet("key1", "value1", "key2", "value2") -// - MSet([]string{"key1", "value1", "key2", "value2"}) -// - MSet(map[string]interface{}{"key1": "value1", "key2": "value2"}) -func (c cmdable) MSet(ctx context.Context, values ...interface{}) *StatusCmd { - args := make([]interface{}, 1, 1+len(values)) - args[0] = "mset" - args = appendArgs(args, values) - cmd := NewStatusCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// MSetNX is like SetNX but accepts multiple values: -// - MSetNX("key1", "value1", "key2", "value2") -// - MSetNX([]string{"key1", "value1", "key2", "value2"}) -// - MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"}) -func (c cmdable) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd { - args := make([]interface{}, 1, 1+len(values)) - args[0] = "msetnx" - args = appendArgs(args, values) - cmd := NewBoolCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// Set Redis `SET key value [expiration]` command. -// Use expiration for `SETEX`-like behavior. -// -// Zero expiration means the key has no expiration time. -// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0, -// otherwise you will receive an error: (error) ERR syntax error. -func (c cmdable) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd { - args := make([]interface{}, 3, 5) - args[0] = "set" - args[1] = key - args[2] = value - if expiration > 0 { - if usePrecise(expiration) { - args = append(args, "px", formatMs(ctx, expiration)) - } else { - args = append(args, "ex", formatSec(ctx, expiration)) - } - } else if expiration == KeepTTL { - args = append(args, "keepttl") - } - - cmd := NewStatusCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// SetArgs provides arguments for the SetArgs function. -type SetArgs struct { - // Mode can be `NX` or `XX` or empty. - Mode string - - // Zero `TTL` or `Expiration` means that the key has no expiration time. - TTL time.Duration - ExpireAt time.Time - - // When Get is true, the command returns the old value stored at key, or nil when key did not exist. - Get bool - - // KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0, - // otherwise you will receive an error: (error) ERR syntax error. - KeepTTL bool -} - -// SetArgs supports all the options that the SET command supports. -// It is the alternative to the Set function when you want -// to have more control over the options. -func (c cmdable) SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd { - args := []interface{}{"set", key, value} - - if a.KeepTTL { - args = append(args, "keepttl") - } - - if !a.ExpireAt.IsZero() { - args = append(args, "exat", a.ExpireAt.Unix()) - } - if a.TTL > 0 { - if usePrecise(a.TTL) { - args = append(args, "px", formatMs(ctx, a.TTL)) - } else { - args = append(args, "ex", formatSec(ctx, a.TTL)) - } - } - - if a.Mode != "" { - args = append(args, a.Mode) - } - - if a.Get { - args = append(args, "get") - } - - cmd := NewStatusCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// SetEX Redis `SETEX key expiration value` command. -func (c cmdable) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd { - cmd := NewStatusCmd(ctx, "setex", key, formatSec(ctx, expiration), value) - _ = c(ctx, cmd) - return cmd -} - -// SetNX Redis `SET key value [expiration] NX` command. -// -// Zero expiration means the key has no expiration time. -// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0, -// otherwise you will receive an error: (error) ERR syntax error. -func (c cmdable) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd { - var cmd *BoolCmd - switch expiration { - case 0: - // Use old `SETNX` to support old Redis versions. - cmd = NewBoolCmd(ctx, "setnx", key, value) - case KeepTTL: - cmd = NewBoolCmd(ctx, "set", key, value, "keepttl", "nx") - default: - if usePrecise(expiration) { - cmd = NewBoolCmd(ctx, "set", key, value, "px", formatMs(ctx, expiration), "nx") - } else { - cmd = NewBoolCmd(ctx, "set", key, value, "ex", formatSec(ctx, expiration), "nx") - } - } - - _ = c(ctx, cmd) - return cmd -} - -// SetXX Redis `SET key value [expiration] XX` command. -// -// Zero expiration means the key has no expiration time. -// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0, -// otherwise you will receive an error: (error) ERR syntax error. -func (c cmdable) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd { - var cmd *BoolCmd - switch expiration { - case 0: - cmd = NewBoolCmd(ctx, "set", key, value, "xx") - case KeepTTL: - cmd = NewBoolCmd(ctx, "set", key, value, "keepttl", "xx") - default: - if usePrecise(expiration) { - cmd = NewBoolCmd(ctx, "set", key, value, "px", formatMs(ctx, expiration), "xx") - } else { - cmd = NewBoolCmd(ctx, "set", key, value, "ex", formatSec(ctx, expiration), "xx") - } - } - - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd { - cmd := NewIntCmd(ctx, "setrange", key, offset, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) StrLen(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "strlen", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd { - args := []interface{}{"copy", sourceKey, destKey, "DB", db} - if replace { - args = append(args, "REPLACE") - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) GetBit(ctx context.Context, key string, offset int64) *IntCmd { - cmd := NewIntCmd(ctx, "getbit", key, offset) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd { - cmd := NewIntCmd( - ctx, - "setbit", - key, - offset, - value, - ) - _ = c(ctx, cmd) - return cmd -} - -type BitCount struct { - Start, End int64 -} - -func (c cmdable) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd { - args := []interface{}{"bitcount", key} - if bitCount != nil { - args = append( - args, - bitCount.Start, - bitCount.End, - ) - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) bitOp(ctx context.Context, op, destKey string, keys ...string) *IntCmd { - args := make([]interface{}, 3+len(keys)) - args[0] = "bitop" - args[1] = op - args[2] = destKey - for i, key := range keys { - args[3+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd { - return c.bitOp(ctx, "and", destKey, keys...) -} - -func (c cmdable) BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd { - return c.bitOp(ctx, "or", destKey, keys...) -} - -func (c cmdable) BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd { - return c.bitOp(ctx, "xor", destKey, keys...) -} - -func (c cmdable) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd { - return c.bitOp(ctx, "not", destKey, key) -} - -func (c cmdable) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd { - args := make([]interface{}, 3+len(pos)) - args[0] = "bitpos" - args[1] = key - args[2] = bit - switch len(pos) { - case 0: - case 1: - args[3] = pos[0] - case 2: - args[3] = pos[0] - args[4] = pos[1] - default: - panic("too many arguments") - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd { - a := make([]interface{}, 0, 2+len(args)) - a = append(a, "bitfield") - a = append(a, key) - a = append(a, args...) - cmd := NewIntSliceCmd(ctx, a...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"scan", cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(ctx, c, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd { - args := []interface{}{"scan", cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - if keyType != "" { - args = append(args, "type", keyType) - } - cmd := NewScanCmd(ctx, c, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"sscan", key, cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(ctx, c, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"hscan", key, cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(ctx, c, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd { - args := []interface{}{"zscan", key, cursor} - if match != "" { - args = append(args, "match", match) - } - if count > 0 { - args = append(args, "count", count) - } - cmd := NewScanCmd(ctx, c, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) HDel(ctx context.Context, key string, fields ...string) *IntCmd { - args := make([]interface{}, 2+len(fields)) - args[0] = "hdel" - args[1] = key - for i, field := range fields { - args[2+i] = field - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HExists(ctx context.Context, key, field string) *BoolCmd { - cmd := NewBoolCmd(ctx, "hexists", key, field) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HGet(ctx context.Context, key, field string) *StringCmd { - cmd := NewStringCmd(ctx, "hget", key, field) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HGetAll(ctx context.Context, key string) *StringStringMapCmd { - cmd := NewStringStringMapCmd(ctx, "hgetall", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd { - cmd := NewIntCmd(ctx, "hincrby", key, field, incr) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd { - cmd := NewFloatCmd(ctx, "hincrbyfloat", key, field, incr) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HKeys(ctx context.Context, key string) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "hkeys", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HLen(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "hlen", key) - _ = c(ctx, cmd) - return cmd -} - -// HMGet returns the values for the specified fields in the hash stored at key. -// It returns an interface{} to distinguish between empty string and nil value. -func (c cmdable) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd { - args := make([]interface{}, 2+len(fields)) - args[0] = "hmget" - args[1] = key - for i, field := range fields { - args[2+i] = field - } - cmd := NewSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// HSet accepts values in following formats: -// - HSet("myhash", "key1", "value1", "key2", "value2") -// - HSet("myhash", []string{"key1", "value1", "key2", "value2"}) -// - HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"}) -// -// Note that it requires Redis v4 for multiple field/value pairs support. -func (c cmdable) HSet(ctx context.Context, key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "hset" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// HMSet is a deprecated version of HSet left for compatibility with Redis 3. -func (c cmdable) HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "hmset" - args[1] = key - args = appendArgs(args, values) - cmd := NewBoolCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd { - cmd := NewBoolCmd(ctx, "hsetnx", key, field, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) HVals(ctx context.Context, key string) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "hvals", key) - _ = c(ctx, cmd) - return cmd -} - -// HRandField redis-server version >= 6.2.0. -func (c cmdable) HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd { - args := make([]interface{}, 0, 4) - - // Although count=0 is meaningless, redis accepts count=0. - args = append(args, "hrandfield", key, count) - if withValues { - args = append(args, "withvalues") - } - - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "blpop" - for i, key := range keys { - args[1+i] = key - } - args[len(args)-1] = formatSec(ctx, timeout) - cmd := NewStringSliceCmd(ctx, args...) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "brpop" - for i, key := range keys { - args[1+i] = key - } - args[len(keys)+1] = formatSec(ctx, timeout) - cmd := NewStringSliceCmd(ctx, args...) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd { - cmd := NewStringCmd( - ctx, - "brpoplpush", - source, - destination, - formatSec(ctx, timeout), - ) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LIndex(ctx context.Context, key string, index int64) *StringCmd { - cmd := NewStringCmd(ctx, "lindex", key, index) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd { - cmd := NewIntCmd(ctx, "linsert", key, op, pivot, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd { - cmd := NewIntCmd(ctx, "linsert", key, "before", pivot, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd { - cmd := NewIntCmd(ctx, "linsert", key, "after", pivot, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LLen(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "llen", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LPop(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "lpop", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LPopCount(ctx context.Context, key string, count int) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "lpop", key, count) - _ = c(ctx, cmd) - return cmd -} - -type LPosArgs struct { - Rank, MaxLen int64 -} - -func (c cmdable) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd { - args := []interface{}{"lpos", key, value} - if a.Rank != 0 { - args = append(args, "rank", a.Rank) - } - if a.MaxLen != 0 { - args = append(args, "maxlen", a.MaxLen) - } - - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd { - args := []interface{}{"lpos", key, value, "count", count} - if a.Rank != 0 { - args = append(args, "rank", a.Rank) - } - if a.MaxLen != 0 { - args = append(args, "maxlen", a.MaxLen) - } - cmd := NewIntSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "lpush" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "lpushx" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd { - cmd := NewStringSliceCmd( - ctx, - "lrange", - key, - start, - stop, - ) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd { - cmd := NewIntCmd(ctx, "lrem", key, count, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd { - cmd := NewStatusCmd(ctx, "lset", key, index, value) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd { - cmd := NewStatusCmd( - ctx, - "ltrim", - key, - start, - stop, - ) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RPop(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "rpop", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RPopCount(ctx context.Context, key string, count int) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "rpop", key, count) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RPopLPush(ctx context.Context, source, destination string) *StringCmd { - cmd := NewStringCmd(ctx, "rpoplpush", source, destination) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "rpush" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(values)) - args[0] = "rpushx" - args[1] = key - args = appendArgs(args, values) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd { - cmd := NewStringCmd(ctx, "lmove", source, destination, srcpos, destpos) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) BLMove( - ctx context.Context, source, destination, srcpos, destpos string, timeout time.Duration, -) *StringCmd { - cmd := NewStringCmd(ctx, "blmove", source, destination, srcpos, destpos, formatSec(ctx, timeout)) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "sadd" - args[1] = key - args = appendArgs(args, members) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SCard(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "scard", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SDiff(ctx context.Context, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "sdiff" - for i, key := range keys { - args[1+i] = key - } - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "sdiffstore" - args[1] = destination - for i, key := range keys { - args[2+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SInter(ctx context.Context, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "sinter" - for i, key := range keys { - args[1+i] = key - } - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "sinterstore" - args[1] = destination - for i, key := range keys { - args[2+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd { - cmd := NewBoolCmd(ctx, "sismember", key, member) - _ = c(ctx, cmd) - return cmd -} - -// SMIsMember Redis `SMISMEMBER key member [member ...]` command. -func (c cmdable) SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "smismember" - args[1] = key - args = appendArgs(args, members) - cmd := NewBoolSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// SMembers Redis `SMEMBERS key` command output as a slice. -func (c cmdable) SMembers(ctx context.Context, key string) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "smembers", key) - _ = c(ctx, cmd) - return cmd -} - -// SMembersMap Redis `SMEMBERS key` command output as a map. -func (c cmdable) SMembersMap(ctx context.Context, key string) *StringStructMapCmd { - cmd := NewStringStructMapCmd(ctx, "smembers", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd { - cmd := NewBoolCmd(ctx, "smove", source, destination, member) - _ = c(ctx, cmd) - return cmd -} - -// SPop Redis `SPOP key` command. -func (c cmdable) SPop(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "spop", key) - _ = c(ctx, cmd) - return cmd -} - -// SPopN Redis `SPOP key count` command. -func (c cmdable) SPopN(ctx context.Context, key string, count int64) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "spop", key, count) - _ = c(ctx, cmd) - return cmd -} - -// SRandMember Redis `SRANDMEMBER key` command. -func (c cmdable) SRandMember(ctx context.Context, key string) *StringCmd { - cmd := NewStringCmd(ctx, "srandmember", key) - _ = c(ctx, cmd) - return cmd -} - -// SRandMemberN Redis `SRANDMEMBER key count` command. -func (c cmdable) SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "srandmember", key, count) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "srem" - args[1] = key - args = appendArgs(args, members) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SUnion(ctx context.Context, keys ...string) *StringSliceCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "sunion" - for i, key := range keys { - args[1+i] = key - } - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "sunionstore" - args[1] = destination - for i, key := range keys { - args[2+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -// XAddArgs accepts values in the following formats: -// - XAddArgs.Values = []interface{}{"key1", "value1", "key2", "value2"} -// - XAddArgs.Values = []string("key1", "value1", "key2", "value2") -// - XAddArgs.Values = map[string]interface{}{"key1": "value1", "key2": "value2"} -// -// Note that map will not preserve the order of key-value pairs. -// MaxLen/MaxLenApprox and MinID are in conflict, only one of them can be used. -type XAddArgs struct { - Stream string - NoMkStream bool - MaxLen int64 // MAXLEN N - - // Deprecated: use MaxLen+Approx, remove in v9. - MaxLenApprox int64 // MAXLEN ~ N - - MinID string - // Approx causes MaxLen and MinID to use "~" matcher (instead of "="). - Approx bool - Limit int64 - ID string - Values interface{} -} - -// XAdd a.Limit has a bug, please confirm it and use it. -// issue: https://github.com/redis/redis/issues/9046 -func (c cmdable) XAdd(ctx context.Context, a *XAddArgs) *StringCmd { - args := make([]interface{}, 0, 11) - args = append(args, "xadd", a.Stream) - if a.NoMkStream { - args = append(args, "nomkstream") - } - switch { - case a.MaxLen > 0: - if a.Approx { - args = append(args, "maxlen", "~", a.MaxLen) - } else { - args = append(args, "maxlen", a.MaxLen) - } - case a.MaxLenApprox > 0: - // TODO remove in v9. - args = append(args, "maxlen", "~", a.MaxLenApprox) - case a.MinID != "": - if a.Approx { - args = append(args, "minid", "~", a.MinID) - } else { - args = append(args, "minid", a.MinID) - } - } - if a.Limit > 0 { - args = append(args, "limit", a.Limit) - } - if a.ID != "" { - args = append(args, a.ID) - } else { - args = append(args, "*") - } - args = appendArg(args, a.Values) - - cmd := NewStringCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XDel(ctx context.Context, stream string, ids ...string) *IntCmd { - args := []interface{}{"xdel", stream} - for _, id := range ids { - args = append(args, id) - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XLen(ctx context.Context, stream string) *IntCmd { - cmd := NewIntCmd(ctx, "xlen", stream) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd(ctx, "xrange", stream, start, stop) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd(ctx, "xrange", stream, start, stop, "count", count) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XRevRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd(ctx, "xrevrange", stream, start, stop) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XRevRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd { - cmd := NewXMessageSliceCmd(ctx, "xrevrange", stream, start, stop, "count", count) - _ = c(ctx, cmd) - return cmd -} - -type XReadArgs struct { - Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2 - Count int64 - Block time.Duration -} - -func (c cmdable) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd { - args := make([]interface{}, 0, 6+len(a.Streams)) - args = append(args, "xread") - - keyPos := int8(1) - if a.Count > 0 { - args = append(args, "count") - args = append(args, a.Count) - keyPos += 2 - } - if a.Block >= 0 { - args = append(args, "block") - args = append(args, int64(a.Block/time.Millisecond)) - keyPos += 2 - } - args = append(args, "streams") - keyPos++ - for _, s := range a.Streams { - args = append(args, s) - } - - cmd := NewXStreamSliceCmd(ctx, args...) - if a.Block >= 0 { - cmd.setReadTimeout(a.Block) - } - cmd.SetFirstKeyPos(keyPos) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd { - return c.XRead(ctx, &XReadArgs{ - Streams: streams, - Block: -1, - }) -} - -func (c cmdable) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd { - cmd := NewStatusCmd(ctx, "xgroup", "create", stream, group, start) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd { - cmd := NewStatusCmd(ctx, "xgroup", "create", stream, group, start, "mkstream") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd { - cmd := NewStatusCmd(ctx, "xgroup", "setid", stream, group, start) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd { - cmd := NewIntCmd(ctx, "xgroup", "destroy", stream, group) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd { - cmd := NewIntCmd(ctx, "xgroup", "createconsumer", stream, group, consumer) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd { - cmd := NewIntCmd(ctx, "xgroup", "delconsumer", stream, group, consumer) - _ = c(ctx, cmd) - return cmd -} - -type XReadGroupArgs struct { - Group string - Consumer string - Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2 - Count int64 - Block time.Duration - NoAck bool -} - -func (c cmdable) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd { - args := make([]interface{}, 0, 10+len(a.Streams)) - args = append(args, "xreadgroup", "group", a.Group, a.Consumer) - - keyPos := int8(4) - if a.Count > 0 { - args = append(args, "count", a.Count) - keyPos += 2 - } - if a.Block >= 0 { - args = append(args, "block", int64(a.Block/time.Millisecond)) - keyPos += 2 - } - if a.NoAck { - args = append(args, "noack") - keyPos++ - } - args = append(args, "streams") - keyPos++ - for _, s := range a.Streams { - args = append(args, s) - } - - cmd := NewXStreamSliceCmd(ctx, args...) - if a.Block >= 0 { - cmd.setReadTimeout(a.Block) - } - cmd.SetFirstKeyPos(keyPos) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd { - args := []interface{}{"xack", stream, group} - for _, id := range ids { - args = append(args, id) - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XPending(ctx context.Context, stream, group string) *XPendingCmd { - cmd := NewXPendingCmd(ctx, "xpending", stream, group) - _ = c(ctx, cmd) - return cmd -} - -type XPendingExtArgs struct { - Stream string - Group string - Idle time.Duration - Start string - End string - Count int64 - Consumer string -} - -func (c cmdable) XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd { - args := make([]interface{}, 0, 9) - args = append(args, "xpending", a.Stream, a.Group) - if a.Idle != 0 { - args = append(args, "idle", formatMs(ctx, a.Idle)) - } - args = append(args, a.Start, a.End, a.Count) - if a.Consumer != "" { - args = append(args, a.Consumer) - } - cmd := NewXPendingExtCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -type XAutoClaimArgs struct { - Stream string - Group string - MinIdle time.Duration - Start string - Count int64 - Consumer string -} - -func (c cmdable) XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd { - args := xAutoClaimArgs(ctx, a) - cmd := NewXAutoClaimCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd { - args := xAutoClaimArgs(ctx, a) - args = append(args, "justid") - cmd := NewXAutoClaimJustIDCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func xAutoClaimArgs(ctx context.Context, a *XAutoClaimArgs) []interface{} { - args := make([]interface{}, 0, 8) - args = append(args, "xautoclaim", a.Stream, a.Group, a.Consumer, formatMs(ctx, a.MinIdle), a.Start) - if a.Count > 0 { - args = append(args, "count", a.Count) - } - return args -} - -type XClaimArgs struct { - Stream string - Group string - Consumer string - MinIdle time.Duration - Messages []string -} - -func (c cmdable) XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd { - args := xClaimArgs(a) - cmd := NewXMessageSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd { - args := xClaimArgs(a) - args = append(args, "justid") - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func xClaimArgs(a *XClaimArgs) []interface{} { - args := make([]interface{}, 0, 5+len(a.Messages)) - args = append(args, - "xclaim", - a.Stream, - a.Group, a.Consumer, - int64(a.MinIdle/time.Millisecond)) - for _, id := range a.Messages { - args = append(args, id) - } - return args -} - -// xTrim If approx is true, add the "~" parameter, otherwise it is the default "=" (redis default). -// example: -// XTRIM key MAXLEN/MINID threshold LIMIT limit. -// XTRIM key MAXLEN/MINID ~ threshold LIMIT limit. -// The redis-server version is lower than 6.2, please set limit to 0. -func (c cmdable) xTrim( - ctx context.Context, key, strategy string, - approx bool, threshold interface{}, limit int64, -) *IntCmd { - args := make([]interface{}, 0, 7) - args = append(args, "xtrim", key, strategy) - if approx { - args = append(args, "~") - } - args = append(args, threshold) - if limit > 0 { - args = append(args, "limit", limit) - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// Deprecated: use XTrimMaxLen, remove in v9. -func (c cmdable) XTrim(ctx context.Context, key string, maxLen int64) *IntCmd { - return c.xTrim(ctx, key, "maxlen", false, maxLen, 0) -} - -// Deprecated: use XTrimMaxLenApprox, remove in v9. -func (c cmdable) XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmd { - return c.xTrim(ctx, key, "maxlen", true, maxLen, 0) -} - -// XTrimMaxLen No `~` rules are used, `limit` cannot be used. -// cmd: XTRIM key MAXLEN maxLen -func (c cmdable) XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd { - return c.xTrim(ctx, key, "maxlen", false, maxLen, 0) -} - -// XTrimMaxLenApprox LIMIT has a bug, please confirm it and use it. -// issue: https://github.com/redis/redis/issues/9046 -// cmd: XTRIM key MAXLEN ~ maxLen LIMIT limit -func (c cmdable) XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd { - return c.xTrim(ctx, key, "maxlen", true, maxLen, limit) -} - -// XTrimMinID No `~` rules are used, `limit` cannot be used. -// cmd: XTRIM key MINID minID -func (c cmdable) XTrimMinID(ctx context.Context, key string, minID string) *IntCmd { - return c.xTrim(ctx, key, "minid", false, minID, 0) -} - -// XTrimMinIDApprox LIMIT has a bug, please confirm it and use it. -// issue: https://github.com/redis/redis/issues/9046 -// cmd: XTRIM key MINID ~ minID LIMIT limit -func (c cmdable) XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd { - return c.xTrim(ctx, key, "minid", true, minID, limit) -} - -func (c cmdable) XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd { - cmd := NewXInfoConsumersCmd(ctx, key, group) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd { - cmd := NewXInfoGroupsCmd(ctx, key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) XInfoStream(ctx context.Context, key string) *XInfoStreamCmd { - cmd := NewXInfoStreamCmd(ctx, key) - _ = c(ctx, cmd) - return cmd -} - -// XInfoStreamFull XINFO STREAM FULL [COUNT count] -// redis-server >= 6.0. -func (c cmdable) XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd { - args := make([]interface{}, 0, 6) - args = append(args, "xinfo", "stream", key, "full") - if count > 0 { - args = append(args, "count", count) - } - cmd := NewXInfoStreamFullCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -// Z represents sorted set member. -type Z struct { - Score float64 - Member interface{} -} - -// ZWithKey represents sorted set member including the name of the key where it was popped. -type ZWithKey struct { - Z - Key string -} - -// ZStore is used as an arg to ZInter/ZInterStore and ZUnion/ZUnionStore. -type ZStore struct { - Keys []string - Weights []float64 - // Can be SUM, MIN or MAX. - Aggregate string -} - -func (z ZStore) len() (n int) { - n = len(z.Keys) - if len(z.Weights) > 0 { - n += 1 + len(z.Weights) - } - if z.Aggregate != "" { - n += 2 - } - return n -} - -func (z ZStore) appendArgs(args []interface{}) []interface{} { - for _, key := range z.Keys { - args = append(args, key) - } - if len(z.Weights) > 0 { - args = append(args, "weights") - for _, weights := range z.Weights { - args = append(args, weights) - } - } - if z.Aggregate != "" { - args = append(args, "aggregate", z.Aggregate) - } - return args -} - -// BZPopMax Redis `BZPOPMAX key [key ...] timeout` command. -func (c cmdable) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "bzpopmax" - for i, key := range keys { - args[1+i] = key - } - args[len(args)-1] = formatSec(ctx, timeout) - cmd := NewZWithKeyCmd(ctx, args...) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -// BZPopMin Redis `BZPOPMIN key [key ...] timeout` command. -func (c cmdable) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd { - args := make([]interface{}, 1+len(keys)+1) - args[0] = "bzpopmin" - for i, key := range keys { - args[1+i] = key - } - args[len(args)-1] = formatSec(ctx, timeout) - cmd := NewZWithKeyCmd(ctx, args...) - cmd.setReadTimeout(timeout) - _ = c(ctx, cmd) - return cmd -} - -// ZAddArgs WARN: The GT, LT and NX options are mutually exclusive. -type ZAddArgs struct { - NX bool - XX bool - LT bool - GT bool - Ch bool - Members []Z -} - -func (c cmdable) zAddArgs(key string, args ZAddArgs, incr bool) []interface{} { - a := make([]interface{}, 0, 6+2*len(args.Members)) - a = append(a, "zadd", key) - - // The GT, LT and NX options are mutually exclusive. - if args.NX { - a = append(a, "nx") - } else { - if args.XX { - a = append(a, "xx") - } - if args.GT { - a = append(a, "gt") - } else if args.LT { - a = append(a, "lt") - } - } - if args.Ch { - a = append(a, "ch") - } - if incr { - a = append(a, "incr") - } - for _, m := range args.Members { - a = append(a, m.Score) - a = append(a, m.Member) - } - return a -} - -func (c cmdable) ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd { - cmd := NewIntCmd(ctx, c.zAddArgs(key, args, false)...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd { - cmd := NewFloatCmd(ctx, c.zAddArgs(key, args, true)...) - _ = c(ctx, cmd) - return cmd -} - -// TODO: Compatible with v8 api, will be removed in v9. -func (c cmdable) zAdd(ctx context.Context, key string, args ZAddArgs, members ...*Z) *IntCmd { - args.Members = make([]Z, len(members)) - for i, m := range members { - args.Members[i] = *m - } - cmd := NewIntCmd(ctx, c.zAddArgs(key, args, false)...) - _ = c(ctx, cmd) - return cmd -} - -// ZAdd Redis `ZADD key score member [score member ...]` command. -func (c cmdable) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd { - return c.zAdd(ctx, key, ZAddArgs{}, members...) -} - -// ZAddNX Redis `ZADD key NX score member [score member ...]` command. -func (c cmdable) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd { - return c.zAdd(ctx, key, ZAddArgs{ - NX: true, - }, members...) -} - -// ZAddXX Redis `ZADD key XX score member [score member ...]` command. -func (c cmdable) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd { - return c.zAdd(ctx, key, ZAddArgs{ - XX: true, - }, members...) -} - -// ZAddCh Redis `ZADD key CH score member [score member ...]` command. -// Deprecated: Use -// client.ZAddArgs(ctx, ZAddArgs{ -// Ch: true, -// Members: []Z, -// }) -// remove in v9. -func (c cmdable) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd { - return c.zAdd(ctx, key, ZAddArgs{ - Ch: true, - }, members...) -} - -// ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command. -// Deprecated: Use -// client.ZAddArgs(ctx, ZAddArgs{ -// NX: true, -// Ch: true, -// Members: []Z, -// }) -// remove in v9. -func (c cmdable) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd { - return c.zAdd(ctx, key, ZAddArgs{ - NX: true, - Ch: true, - }, members...) -} - -// ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command. -// Deprecated: Use -// client.ZAddArgs(ctx, ZAddArgs{ -// XX: true, -// Ch: true, -// Members: []Z, -// }) -// remove in v9. -func (c cmdable) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd { - return c.zAdd(ctx, key, ZAddArgs{ - XX: true, - Ch: true, - }, members...) -} - -// ZIncr Redis `ZADD key INCR score member` command. -// Deprecated: Use -// client.ZAddArgsIncr(ctx, ZAddArgs{ -// Members: []Z, -// }) -// remove in v9. -func (c cmdable) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd { - return c.ZAddArgsIncr(ctx, key, ZAddArgs{ - Members: []Z{*member}, - }) -} - -// ZIncrNX Redis `ZADD key NX INCR score member` command. -// Deprecated: Use -// client.ZAddArgsIncr(ctx, ZAddArgs{ -// NX: true, -// Members: []Z, -// }) -// remove in v9. -func (c cmdable) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd { - return c.ZAddArgsIncr(ctx, key, ZAddArgs{ - NX: true, - Members: []Z{*member}, - }) -} - -// ZIncrXX Redis `ZADD key XX INCR score member` command. -// Deprecated: Use -// client.ZAddArgsIncr(ctx, ZAddArgs{ -// XX: true, -// Members: []Z, -// }) -// remove in v9. -func (c cmdable) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd { - return c.ZAddArgsIncr(ctx, key, ZAddArgs{ - XX: true, - Members: []Z{*member}, - }) -} - -func (c cmdable) ZCard(ctx context.Context, key string) *IntCmd { - cmd := NewIntCmd(ctx, "zcard", key) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZCount(ctx context.Context, key, min, max string) *IntCmd { - cmd := NewIntCmd(ctx, "zcount", key, min, max) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZLexCount(ctx context.Context, key, min, max string) *IntCmd { - cmd := NewIntCmd(ctx, "zlexcount", key, min, max) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd { - cmd := NewFloatCmd(ctx, "zincrby", key, increment, member) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd { - args := make([]interface{}, 0, 3+store.len()) - args = append(args, "zinterstore", destination, len(store.Keys)) - args = store.appendArgs(args) - cmd := NewIntCmd(ctx, args...) - cmd.SetFirstKeyPos(3) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZInter(ctx context.Context, store *ZStore) *StringSliceCmd { - args := make([]interface{}, 0, 2+store.len()) - args = append(args, "zinter", len(store.Keys)) - args = store.appendArgs(args) - cmd := NewStringSliceCmd(ctx, args...) - cmd.SetFirstKeyPos(2) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd { - args := make([]interface{}, 0, 3+store.len()) - args = append(args, "zinter", len(store.Keys)) - args = store.appendArgs(args) - args = append(args, "withscores") - cmd := NewZSliceCmd(ctx, args...) - cmd.SetFirstKeyPos(2) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd { - args := make([]interface{}, 2+len(members)) - args[0] = "zmscore" - args[1] = key - for i, member := range members { - args[2+i] = member - } - cmd := NewFloatSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd { - args := []interface{}{ - "zpopmax", - key, - } - - switch len(count) { - case 0: - break - case 1: - args = append(args, count[0]) - default: - panic("too many arguments") - } - - cmd := NewZSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd { - args := []interface{}{ - "zpopmin", - key, - } - - switch len(count) { - case 0: - break - case 1: - args = append(args, count[0]) - default: - panic("too many arguments") - } - - cmd := NewZSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// ZRangeArgs is all the options of the ZRange command. -// In version> 6.2.0, you can replace the(cmd): -// ZREVRANGE, -// ZRANGEBYSCORE, -// ZREVRANGEBYSCORE, -// ZRANGEBYLEX, -// ZREVRANGEBYLEX. -// Please pay attention to your redis-server version. -// -// Rev, ByScore, ByLex and Offset+Count options require redis-server 6.2.0 and higher. -type ZRangeArgs struct { - Key string - - // When the ByScore option is provided, the open interval(exclusive) can be set. - // By default, the score intervals specified by and are closed (inclusive). - // It is similar to the deprecated(6.2.0+) ZRangeByScore command. - // For example: - // ZRangeArgs{ - // Key: "example-key", - // Start: "(3", - // Stop: 8, - // ByScore: true, - // } - // cmd: "ZRange example-key (3 8 ByScore" (3 < score <= 8). - // - // For the ByLex option, it is similar to the deprecated(6.2.0+) ZRangeByLex command. - // You can set the and options as follows: - // ZRangeArgs{ - // Key: "example-key", - // Start: "[abc", - // Stop: "(def", - // ByLex: true, - // } - // cmd: "ZRange example-key [abc (def ByLex" - // - // For normal cases (ByScore==false && ByLex==false), and should be set to the index range (int). - // You can read the documentation for more information: https://redis.io/commands/zrange - Start interface{} - Stop interface{} - - // The ByScore and ByLex options are mutually exclusive. - ByScore bool - ByLex bool - - Rev bool - - // limit offset count. - Offset int64 - Count int64 -} - -func (z ZRangeArgs) appendArgs(args []interface{}) []interface{} { - // For Rev+ByScore/ByLex, we need to adjust the position of and . - if z.Rev && (z.ByScore || z.ByLex) { - args = append(args, z.Key, z.Stop, z.Start) - } else { - args = append(args, z.Key, z.Start, z.Stop) - } - - if z.ByScore { - args = append(args, "byscore") - } else if z.ByLex { - args = append(args, "bylex") - } - if z.Rev { - args = append(args, "rev") - } - if z.Offset != 0 || z.Count != 0 { - args = append(args, "limit", z.Offset, z.Count) - } - return args -} - -func (c cmdable) ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd { - args := make([]interface{}, 0, 9) - args = append(args, "zrange") - args = z.appendArgs(args) - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd { - args := make([]interface{}, 0, 10) - args = append(args, "zrange") - args = z.appendArgs(args) - args = append(args, "withscores") - cmd := NewZSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd { - return c.ZRangeArgs(ctx, ZRangeArgs{ - Key: key, - Start: start, - Stop: stop, - }) -} - -func (c cmdable) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd { - return c.ZRangeArgsWithScores(ctx, ZRangeArgs{ - Key: key, - Start: start, - Stop: stop, - }) -} - -type ZRangeBy struct { - Min, Max string - Offset, Count int64 -} - -func (c cmdable) zRangeBy(ctx context.Context, zcmd, key string, opt *ZRangeBy, withScores bool) *StringSliceCmd { - args := []interface{}{zcmd, key, opt.Min, opt.Max} - if withScores { - args = append(args, "withscores") - } - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd { - return c.zRangeBy(ctx, "zrangebyscore", key, opt, false) -} - -func (c cmdable) ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd { - return c.zRangeBy(ctx, "zrangebylex", key, opt, false) -} - -func (c cmdable) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd { - args := []interface{}{"zrangebyscore", key, opt.Min, opt.Max, "withscores"} - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewZSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd { - args := make([]interface{}, 0, 10) - args = append(args, "zrangestore", dst) - args = z.appendArgs(args) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRank(ctx context.Context, key, member string) *IntCmd { - cmd := NewIntCmd(ctx, "zrank", key, member) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(members)) - args[0] = "zrem" - args[1] = key - args = appendArgs(args, members) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd { - cmd := NewIntCmd( - ctx, - "zremrangebyrank", - key, - start, - stop, - ) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd { - cmd := NewIntCmd(ctx, "zremrangebyscore", key, min, max) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd { - cmd := NewIntCmd(ctx, "zremrangebylex", key, min, max) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd { - cmd := NewStringSliceCmd(ctx, "zrevrange", key, start, stop) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd { - cmd := NewZSliceCmd(ctx, "zrevrange", key, start, stop, "withscores") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) zRevRangeBy(ctx context.Context, zcmd, key string, opt *ZRangeBy) *StringSliceCmd { - args := []interface{}{zcmd, key, opt.Max, opt.Min} - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd { - return c.zRevRangeBy(ctx, "zrevrangebyscore", key, opt) -} - -func (c cmdable) ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd { - return c.zRevRangeBy(ctx, "zrevrangebylex", key, opt) -} - -func (c cmdable) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd { - args := []interface{}{"zrevrangebyscore", key, opt.Max, opt.Min, "withscores"} - if opt.Offset != 0 || opt.Count != 0 { - args = append( - args, - "limit", - opt.Offset, - opt.Count, - ) - } - cmd := NewZSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZRevRank(ctx context.Context, key, member string) *IntCmd { - cmd := NewIntCmd(ctx, "zrevrank", key, member) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZScore(ctx context.Context, key, member string) *FloatCmd { - cmd := NewFloatCmd(ctx, "zscore", key, member) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZUnion(ctx context.Context, store ZStore) *StringSliceCmd { - args := make([]interface{}, 0, 2+store.len()) - args = append(args, "zunion", len(store.Keys)) - args = store.appendArgs(args) - cmd := NewStringSliceCmd(ctx, args...) - cmd.SetFirstKeyPos(2) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd { - args := make([]interface{}, 0, 3+store.len()) - args = append(args, "zunion", len(store.Keys)) - args = store.appendArgs(args) - args = append(args, "withscores") - cmd := NewZSliceCmd(ctx, args...) - cmd.SetFirstKeyPos(2) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd { - args := make([]interface{}, 0, 3+store.len()) - args = append(args, "zunionstore", dest, len(store.Keys)) - args = store.appendArgs(args) - cmd := NewIntCmd(ctx, args...) - cmd.SetFirstKeyPos(3) - _ = c(ctx, cmd) - return cmd -} - -// ZRandMember redis-server version >= 6.2.0. -func (c cmdable) ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd { - args := make([]interface{}, 0, 4) - - // Although count=0 is meaningless, redis accepts count=0. - args = append(args, "zrandmember", key, count) - if withScores { - args = append(args, "withscores") - } - - cmd := NewStringSliceCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -// ZDiff redis-server version >= 6.2.0. -func (c cmdable) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "zdiff" - args[1] = len(keys) - for i, key := range keys { - args[i+2] = key - } - - cmd := NewStringSliceCmd(ctx, args...) - cmd.SetFirstKeyPos(2) - _ = c(ctx, cmd) - return cmd -} - -// ZDiffWithScores redis-server version >= 6.2.0. -func (c cmdable) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd { - args := make([]interface{}, 3+len(keys)) - args[0] = "zdiff" - args[1] = len(keys) - for i, key := range keys { - args[i+2] = key - } - args[len(keys)+2] = "withscores" - - cmd := NewZSliceCmd(ctx, args...) - cmd.SetFirstKeyPos(2) - _ = c(ctx, cmd) - return cmd -} - -// ZDiffStore redis-server version >=6.2.0. -func (c cmdable) ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd { - args := make([]interface{}, 0, 3+len(keys)) - args = append(args, "zdiffstore", destination, len(keys)) - for _, key := range keys { - args = append(args, key) - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd { - args := make([]interface{}, 2, 2+len(els)) - args[0] = "pfadd" - args[1] = key - args = appendArgs(args, els) - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) PFCount(ctx context.Context, keys ...string) *IntCmd { - args := make([]interface{}, 1+len(keys)) - args[0] = "pfcount" - for i, key := range keys { - args[1+i] = key - } - cmd := NewIntCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd { - args := make([]interface{}, 2+len(keys)) - args[0] = "pfmerge" - args[1] = dest - for i, key := range keys { - args[2+i] = key - } - cmd := NewStatusCmd(ctx, args...) - _ = c(ctx, cmd) - return cmd -} - -//------------------------------------------------------------------------------ - -func (c cmdable) BgRewriteAOF(ctx context.Context) *StatusCmd { - cmd := NewStatusCmd(ctx, "bgrewriteaof") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) BgSave(ctx context.Context) *StatusCmd { - cmd := NewStatusCmd(ctx, "bgsave") - _ = c(ctx, cmd) - return cmd -} - -func (c cmdable) ClientKill(ctx context.Context, ipPort string) *StatusCmd { - cmd := NewStatusCmd(ctx, "client", "kill", ipPort) - _ = c(ctx, cmd) - return cmd -} - -// ClientKillByFilter is new style syntax, while the ClientKill is old -// -// CLIENT KILL