Эх сурвалжийг харах

SVI Обновление вендоринга; 100.0%

SVI 9 сар өмнө
parent
commit
ca8a5e8d8f
100 өөрчлөгдсөн 1853 нэмэгдсэн , 2230 устгасан
  1. 11 12
      go.mod
  2. 24 26
      go.sum
  3. 2 0
      vendor/github.com/andybalholm/brotli/.gitignore
  4. 2 0
      vendor/github.com/andybalholm/brotli/compress_fragment_two_pass.go
  5. 1 1
      vendor/github.com/andybalholm/brotli/find_match_length.go
  6. 36 6
      vendor/github.com/andybalholm/brotli/matchfinder/m4.go
  7. 328 0
      vendor/github.com/andybalholm/brotli/matchfinder/pathfinder.go
  8. 3 0
      vendor/github.com/andybalholm/brotli/reader.go
  9. 17 5
      vendor/github.com/andybalholm/brotli/writer.go
  10. 1 0
      vendor/github.com/dgraph-io/badger/v4/CHANGELOG.md
  11. 2 2
      vendor/github.com/dgraph-io/badger/v4/Makefile
  12. 14 43
      vendor/github.com/dgraph-io/badger/v4/README.md
  13. 2 2
      vendor/github.com/dgraph-io/badger/v4/backup.go
  14. 3 2
      vendor/github.com/dgraph-io/badger/v4/batch.go
  15. 9 10
      vendor/github.com/dgraph-io/badger/v4/db.go
  16. 5 6
      vendor/github.com/dgraph-io/badger/v4/levels.go
  17. 25 22
      vendor/github.com/dgraph-io/badger/v4/manifest.go
  18. 1 3
      vendor/github.com/dgraph-io/badger/v4/memtable.go
  19. 3 5
      vendor/github.com/dgraph-io/badger/v4/options.go
  20. 34 3
      vendor/github.com/dgraph-io/badger/v4/stream.go
  21. 4 5
      vendor/github.com/dgraph-io/badger/v4/stream_writer.go
  22. 1 1
      vendor/github.com/dgraph-io/badger/v4/table/builder.go
  23. 3 3
      vendor/github.com/dgraph-io/badger/v4/table/table.go
  24. 1 3
      vendor/github.com/dgraph-io/badger/v4/trie/trie.go
  25. 3 3
      vendor/github.com/dgraph-io/badger/v4/txn.go
  26. 4 5
      vendor/github.com/dgraph-io/badger/v4/util.go
  27. 10 11
      vendor/github.com/dgraph-io/badger/v4/value.go
  28. 5 12
      vendor/github.com/dgraph-io/badger/v4/y/error.go
  29. 1 2
      vendor/github.com/dgraph-io/ristretto/v2/.gitignore
  30. 0 30
      vendor/github.com/dgraph-io/ristretto/v2/.golangci.yml
  31. 91 79
      vendor/github.com/dgraph-io/ristretto/v2/CHANGELOG.md
  32. 89 72
      vendor/github.com/dgraph-io/ristretto/v2/README.md
  33. 10 0
      vendor/github.com/dgraph-io/ristretto/v2/SECURITY.md
  34. 11 23
      vendor/github.com/dgraph-io/ristretto/v2/cache.go
  35. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/policy.go
  36. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/ring.go
  37. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/sketch.go
  38. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/store.go
  39. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/ttl.go
  40. 2 14
      vendor/github.com/dgraph-io/ristretto/v2/z/LICENSE
  41. 52 34
      vendor/github.com/dgraph-io/ristretto/v2/z/README.md
  42. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/allocator.go
  43. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/btree.go
  44. 8 20
      vendor/github.com/dgraph-io/ristretto/v2/z/buffer.go
  45. 5 0
      vendor/github.com/dgraph-io/ristretto/v2/z/calloc.go
  46. 2 1
      vendor/github.com/dgraph-io/ristretto/v2/z/calloc_32bit.go
  47. 2 1
      vendor/github.com/dgraph-io/ristretto/v2/z/calloc_jemalloc.go
  48. 10 22
      vendor/github.com/dgraph-io/ristretto/v2/z/file.go
  49. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/file_default.go
  50. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/file_linux.go
  51. 18 19
      vendor/github.com/dgraph-io/ristretto/v2/z/flags.go
  52. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/histogram.go
  53. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap.go
  54. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_darwin.go
  55. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_js.go
  56. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_linux.go
  57. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_plan9.go
  58. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_unix.go
  59. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_wasip1.go
  60. 3 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mmap_windows.go
  61. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mremap_nosize.go
  62. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/mremap_size.go
  63. 5 0
      vendor/github.com/dgraph-io/ristretto/v2/z/simd/baseline.go
  64. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/simd/search.go
  65. 2 13
      vendor/github.com/dgraph-io/ristretto/v2/z/z.go
  66. 9 7
      vendor/github.com/go-logr/logr/.golangci.yaml
  67. 4 4
      vendor/github.com/go-logr/logr/funcr/funcr.go
  68. 7 0
      vendor/github.com/gofiber/fiber/v2/.golangci.yml
  69. 44 0
      vendor/github.com/gofiber/fiber/v2/AGENTS.md
  70. 1 3
      vendor/github.com/gofiber/fiber/v2/app.go
  71. 70 41
      vendor/github.com/gofiber/fiber/v2/ctx.go
  72. 9 1
      vendor/github.com/gofiber/fiber/v2/internal/schema/cache.go
  73. 20 3
      vendor/github.com/gofiber/fiber/v2/internal/schema/decoder.go
  74. 5 5
      vendor/github.com/gofiber/fiber/v2/log/default.go
  75. 0 8
      vendor/github.com/gofiber/fiber/v2/mount.go
  76. 58 42
      vendor/github.com/gofiber/fiber/v2/router.go
  77. 0 24
      vendor/github.com/pkg/errors/.gitignore
  78. 0 10
      vendor/github.com/pkg/errors/.travis.yml
  79. 0 23
      vendor/github.com/pkg/errors/LICENSE
  80. 0 44
      vendor/github.com/pkg/errors/Makefile
  81. 0 59
      vendor/github.com/pkg/errors/README.md
  82. 0 32
      vendor/github.com/pkg/errors/appveyor.yml
  83. 0 288
      vendor/github.com/pkg/errors/errors.go
  84. 0 38
      vendor/github.com/pkg/errors/go113.go
  85. 0 177
      vendor/github.com/pkg/errors/stack.go
  86. 1 0
      vendor/github.com/valyala/fasthttp/.golangci.yml
  87. 232 185
      vendor/github.com/valyala/fasthttp/README.md
  88. 23 10
      vendor/github.com/valyala/fasthttp/args.go
  89. 0 2
      vendor/github.com/valyala/fasthttp/b2s.go
  90. 0 14
      vendor/github.com/valyala/fasthttp/b2s_old.go
  91. 5 0
      vendor/github.com/valyala/fasthttp/compress.go
  92. 0 2
      vendor/github.com/valyala/fasthttp/fasthttpadaptor/b2s.go
  93. 0 14
      vendor/github.com/valyala/fasthttp/fasthttpadaptor/b2s_old.go
  94. 2 2
      vendor/github.com/valyala/fasthttp/fasthttpadaptor/request.go
  95. 4 0
      vendor/github.com/valyala/fasthttp/fasthttputil/pipeconns.go
  96. 8 0
      vendor/github.com/valyala/fasthttp/fasthttputil/s2b.go
  97. 313 387
      vendor/github.com/valyala/fasthttp/header.go
  98. 109 5
      vendor/github.com/valyala/fasthttp/http.go
  99. 24 6
      vendor/github.com/valyala/fasthttp/peripconn.go
  100. BIN
      vendor/github.com/valyala/fasthttp/request_body.zst

+ 11 - 12
go.mod

@@ -4,32 +4,31 @@ go 1.24.2
 
 require (
 	github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b
-	github.com/dgraph-io/badger/v4 v4.6.0
-	github.com/gofiber/fiber/v2 v2.52.6
+	github.com/dgraph-io/badger/v4 v4.8.0
+	github.com/gofiber/fiber/v2 v2.52.9
 	github.com/google/uuid v1.6.0
 )
 
 require (
-	github.com/andybalholm/brotli v1.1.1 // indirect
+	github.com/andybalholm/brotli v1.2.0 // indirect
 	github.com/cespare/xxhash/v2 v2.3.0 // indirect
-	github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect
+	github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
 	github.com/dustin/go-humanize v1.0.1 // indirect
-	github.com/go-logr/logr v1.4.2 // indirect
+	github.com/go-logr/logr v1.4.3 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
 	github.com/google/flatbuffers v25.2.10+incompatible // indirect
 	github.com/klauspost/compress v1.18.0 // indirect
 	github.com/mattn/go-colorable v0.1.14 // indirect
 	github.com/mattn/go-isatty v0.0.20 // indirect
 	github.com/mattn/go-runewidth v0.0.16 // indirect
-	github.com/pkg/errors v0.9.1 // indirect
 	github.com/rivo/uniseg v0.4.7 // indirect
 	github.com/valyala/bytebufferpool v1.0.0 // indirect
-	github.com/valyala/fasthttp v1.60.0 // indirect
+	github.com/valyala/fasthttp v1.64.0 // indirect
 	go.opentelemetry.io/auto/sdk v1.1.0 // indirect
-	go.opentelemetry.io/otel v1.35.0 // indirect
-	go.opentelemetry.io/otel/metric v1.35.0 // indirect
-	go.opentelemetry.io/otel/trace v1.35.0 // indirect
-	golang.org/x/net v0.38.0 // indirect
-	golang.org/x/sys v0.31.0 // indirect
+	go.opentelemetry.io/otel v1.37.0 // indirect
+	go.opentelemetry.io/otel/metric v1.37.0 // indirect
+	go.opentelemetry.io/otel/trace v1.37.0 // indirect
+	golang.org/x/net v0.42.0 // indirect
+	golang.org/x/sys v0.34.0 // indirect
 	google.golang.org/protobuf v1.36.6 // indirect
 )

+ 24 - 26
go.sum

@@ -3,27 +3,27 @@ github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm
 github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk=
 github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
 github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
-github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
-github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
+github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
+github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
 github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
 github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/dgraph-io/badger/v4 v4.6.0 h1:acOwfOOZ4p1dPRnYzvkVm7rUk2Y21TgPVepCy5dJdFQ=
-github.com/dgraph-io/badger/v4 v4.6.0/go.mod h1:KSJ5VTuZNC3Sd+YhvVjk2nYua9UZnnTr/SkXvdtiPgI=
-github.com/dgraph-io/ristretto/v2 v2.1.0 h1:59LjpOJLNDULHh8MC4UaegN52lC4JnO2dITsie/Pa8I=
-github.com/dgraph-io/ristretto/v2 v2.1.0/go.mod h1:uejeqfYXpUomfse0+lO+13ATz4TypQYLJZzBSAemuB4=
-github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
-github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
+github.com/dgraph-io/badger/v4 v4.8.0 h1:JYph1ChBijCw8SLeybvPINizbDKWZ5n/GYbz2yhN/bs=
+github.com/dgraph-io/badger/v4 v4.8.0/go.mod h1:U6on6e8k/RTbUWxqKR0MvugJuVmkxSNc79ap4917h4w=
+github.com/dgraph-io/ristretto/v2 v2.2.0 h1:bkY3XzJcXoMuELV8F+vS8kzNgicwQFAaGINAEJdWGOM=
+github.com/dgraph-io/ristretto/v2 v2.2.0/go.mod h1:RZrm63UmcBAaYWC1DotLYBmTvgkrs0+XhBd7Npn7/zI=
+github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da h1:aIftn67I1fkbMa512G+w+Pxci9hJPB8oMnkcP3iZF38=
+github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
 github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
 github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
 github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
-github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
+github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
 github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/gofiber/fiber/v2 v2.52.6 h1:Rfp+ILPiYSvvVuIPvxrBns+HJp8qGLDnLJawAu27XVI=
-github.com/gofiber/fiber/v2 v2.52.6/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=
+github.com/gofiber/fiber/v2 v2.52.9 h1:YjKl5DOiyP3j0mO61u3NTmK7or8GzzWzCFzkboyP5cw=
+github.com/gofiber/fiber/v2 v2.52.9/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=
 github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q=
 github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
 github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
@@ -39,8 +39,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
 github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
 github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
 github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
-github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
-github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
@@ -50,19 +48,19 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
 github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
 github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
 github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
-github.com/valyala/fasthttp v1.60.0 h1:kBRYS0lOhVJ6V+bYN8PqAHELKHtXqwq9zNMLKx1MBsw=
-github.com/valyala/fasthttp v1.60.0/go.mod h1:iY4kDgV3Gc6EqhRZ8icqcmlG6bqhcDXfuHgTO4FXCvc=
+github.com/valyala/fasthttp v1.64.0 h1:QBygLLQmiAyiXuRhthf0tuRkqAFcrC42dckN2S+N3og=
+github.com/valyala/fasthttp v1.64.0/go.mod h1:dGmFxwkWXSK0NbOSJuF7AMVzU+lkHz0wQVvVITv2UQA=
 github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
 github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
 go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
-go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
-go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
-go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
-go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
-go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
-go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
+go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
+go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
+go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
+go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
+go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
+go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -70,8 +68,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
-golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
+golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
+golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -79,8 +77,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
-golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
+golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

+ 2 - 0
vendor/github.com/andybalholm/brotli/.gitignore

@@ -0,0 +1,2 @@
+cpu.out
+brotli.test

+ 2 - 0
vendor/github.com/andybalholm/brotli/compress_fragment_two_pass.go

@@ -229,6 +229,8 @@ func storeMetaBlockHeaderBW(len uint, is_uncompressed bool, bw *bitWriter) {
 		nibbles = 4
 	} else if len <= 1<<20 {
 		nibbles = 5
+	} else if len > 1<<24 {
+		panic("metablock too long")
 	}
 
 	bw.writeBits(2, uint64(nibbles)-4)

+ 1 - 1
vendor/github.com/andybalholm/brotli/find_match_length.go

@@ -17,7 +17,7 @@ func findMatchLengthWithLimit(s1 []byte, s2 []byte, limit uint) uint {
 	var matched uint = 0
 	_, _ = s1[limit-1], s2[limit-1] // bounds check
 	switch runtime.GOARCH {
-	case "amd64":
+	case "amd64", "arm64":
 		// Compare 8 bytes at at time.
 		for matched+8 <= limit {
 			w1 := binary.LittleEndian.Uint64(s1[matched:])

+ 36 - 6
vendor/github.com/andybalholm/brotli/matchfinder/m4.go

@@ -1,6 +1,7 @@
 package matchfinder
 
 import (
+	"bytes"
 	"encoding/binary"
 	"math/bits"
 	"runtime"
@@ -42,7 +43,7 @@ type M4 struct {
 	DistanceBitCost int
 
 	table []uint32
-	chain []uint16
+	chain []uint32
 
 	history []byte
 }
@@ -100,7 +101,7 @@ func (q *M4) FindMatches(dst []Match, src []byte) []Match {
 	e.NextEmit = len(q.history)
 	q.history = append(q.history, src...)
 	if q.ChainLength > 0 {
-		q.chain = append(q.chain, make([]uint16, len(src))...)
+		q.chain = append(q.chain, make([]uint32, len(src))...)
 	}
 	src = q.history
 
@@ -123,15 +124,25 @@ func (q *M4) FindMatches(dst []Match, src []byte) []Match {
 			matches = [3]absoluteMatch{}
 		}
 
+		// Look for a repeat match one byte after the current position.
+		if matches[0] == (absoluteMatch{}) && len(e.Dst) > 0 {
+			prevDistance := e.Dst[len(e.Dst)-1].Distance
+			if binary.LittleEndian.Uint32(src[i+1:]) == binary.LittleEndian.Uint32(src[i+1-prevDistance:]) {
+				// We have a 4-byte match.
+				m := extendMatch2(src, i+1, i+1-prevDistance, e.NextEmit+1)
+				if m.End-m.Start >= q.MinLength {
+					matches[0] = m
+				}
+			}
+		}
+
 		// Calculate and store the hash.
 		h := ((binary.LittleEndian.Uint64(src[i:]) & (1<<(8*q.HashLen) - 1)) * hashMul64) >> (64 - q.TableBits)
 		candidate := int(q.table[h])
 		q.table[h] = uint32(i)
 		if q.ChainLength > 0 && candidate != 0 {
 			delta := i - candidate
-			if delta < 1<<16 {
-				q.chain[i] = uint16(delta)
-			}
+			q.chain[i] = uint32(delta)
 		}
 
 		if i < matches[0].End && i != matches[0].End+2-q.HashLen {
@@ -220,6 +231,25 @@ func (q *M4) FindMatches(dst []Match, src []byte) []Match {
 			// Emit the first match, shortening it if necessary to avoid overlap with the second.
 			if matches[2].End > matches[1].Start {
 				matches[2].End = matches[1].Start
+				if q.ChainLength > 0 && matches[2].End-matches[2].Start >= q.MinLength {
+					// Since the match length was trimmed, we may be able to find a closer match
+					// to replace it.
+					pos := matches[2].Start
+					for {
+						delta := int(q.chain[pos])
+						if delta == 0 {
+							break
+						}
+						pos -= delta
+						if pos <= matches[2].Match {
+							break
+						}
+						if bytes.Equal(src[matches[2].Start:matches[2].End], src[pos:pos+matches[2].End-matches[2].Start]) {
+							matches[2].Match = pos
+							break
+						}
+					}
+				}
 			}
 			if matches[2].End-matches[2].Start >= q.MinLength && q.score(matches[2]) > 0 {
 				e.emit(matches[2])
@@ -261,7 +291,7 @@ const hashMul64 = 0x1E35A7BD1E35A7BD
 //	0 <= i && i < j && j <= len(src)
 func extendMatch(src []byte, i, j int) int {
 	switch runtime.GOARCH {
-	case "amd64":
+	case "amd64", "arm64":
 		// As long as we are 8 or more bytes before the end of src, we can load and
 		// compare 8 bytes at a time. If those 8 bytes are equal, repeat.
 		for j+8 < len(src) {

+ 328 - 0
vendor/github.com/andybalholm/brotli/matchfinder/pathfinder.go

@@ -0,0 +1,328 @@
+package matchfinder
+
+import (
+	"encoding/binary"
+	"math"
+	"math/bits"
+	"slices"
+)
+
+// Pathfinder is a MatchFinder that uses hash chains to find matches, and a
+// shortest-path optimizer to choose which matches to use.
+type Pathfinder struct {
+	// MaxDistance is the maximum distance (in bytes) to look back for
+	// a match. The default is 65535.
+	MaxDistance int
+
+	// MinLength is the length of the shortest match to return.
+	// The default is 4.
+	MinLength int
+
+	// HashLen is the number of bytes to use to calculate the hashes.
+	// The maximum is 8 and the default is 6.
+	HashLen int
+
+	// TableBits is the number of bits in the hash table indexes.
+	// The default is 17 (128K entries).
+	TableBits int
+
+	// ChainLength is how many entries to search on the "match chain" of older
+	// locations with the same hash as the current location.
+	ChainLength int
+
+	table []uint32
+	chain []uint32
+
+	history []byte
+
+	// holding onto buffers to reduce allocations:
+
+	arrivals     []arrival
+	foundMatches []absoluteMatch
+	matches      []Match
+}
+
+func (q *Pathfinder) Reset() {
+	for i := range q.table {
+		q.table[i] = 0
+	}
+	q.history = q.history[:0]
+	q.chain = q.chain[:0]
+}
+
+// An arrival represents how we got to a certain byte position.
+// The cost is the total cost to get there from the beginning of the block.
+// If distance > 0, the arrival is with a match.
+// If distance == 0, the arrival is with a run of literals.
+type arrival struct {
+	length   uint32
+	distance uint32
+	cost     float32
+}
+
+const (
+	baseMatchCost float32 = 4
+)
+
+func (q *Pathfinder) FindMatches(dst []Match, src []byte) []Match {
+	if q.MaxDistance == 0 {
+		q.MaxDistance = 65535
+	}
+	if q.MinLength == 0 {
+		q.MinLength = 4
+	}
+	if q.HashLen == 0 {
+		q.HashLen = 6
+	}
+	if q.TableBits == 0 {
+		q.TableBits = 17
+	}
+	if len(q.table) < 1<<q.TableBits {
+		q.table = make([]uint32, 1<<q.TableBits)
+	}
+
+	var histogram [256]uint32
+	for _, b := range src {
+		histogram[b]++
+	}
+	var byteCost [256]float32
+	for b, n := range histogram {
+		cost := max(math.Log2(float64(len(src))/float64(n)), 1)
+		byteCost[b] = float32(cost)
+	}
+
+	// Each element in arrivals corresponds to the position just after
+	// the corresponding byte in src.
+	arrivals := q.arrivals
+	if len(arrivals) < len(src) {
+		arrivals = make([]arrival, len(src))
+		q.arrivals = arrivals
+	} else {
+		arrivals = arrivals[:len(src)]
+		for i := range arrivals {
+			arrivals[i] = arrival{}
+		}
+	}
+
+	if len(q.history) > q.MaxDistance*2 {
+		// Trim down the history buffer.
+		delta := len(q.history) - q.MaxDistance
+		copy(q.history, q.history[delta:])
+		q.history = q.history[:q.MaxDistance]
+		q.chain = q.chain[:q.MaxDistance]
+
+		for i, v := range q.table {
+			newV := max(int(v)-delta, 0)
+			q.table[i] = uint32(newV)
+		}
+	}
+
+	// Append src to the history buffer.
+	historyLen := len(q.history)
+	q.history = append(q.history, src...)
+	q.chain = append(q.chain, make([]uint32, len(src))...)
+	src = q.history
+
+	// Calculate hashes and build the chain.
+	for i := historyLen; i < len(src)-7; i++ {
+		h := ((binary.LittleEndian.Uint64(src[i:]) & (1<<(8*q.HashLen) - 1)) * hashMul64) >> (64 - q.TableBits)
+		candidate := int(q.table[h])
+		q.table[h] = uint32(i)
+		if candidate != 0 {
+			delta := i - candidate
+			q.chain[i] = uint32(delta)
+		}
+	}
+
+	// Look for matches, and collect them in foundMatches. Later we'll figure out
+	// which ones to actually use.
+	foundMatches := q.foundMatches[:0]
+	var prevMatch absoluteMatch
+	i := historyLen
+	for i < len(src)-7 {
+		delta := q.chain[i]
+		if delta == 0 {
+			i++
+			continue
+		}
+		candidate := i - int(delta)
+		if candidate <= 0 || i-candidate > q.MaxDistance {
+			i++
+			continue
+		}
+
+		var currentMatch absoluteMatch
+
+		if i >= prevMatch.End && prevMatch != (absoluteMatch{}) {
+			// Look for a repeat match at i+1.
+			prevDistance := prevMatch.Start - prevMatch.Match
+			if binary.LittleEndian.Uint32(src[i+1:]) == binary.LittleEndian.Uint32(src[i+1-prevDistance:]) {
+				m := extendMatch2(src, i+1, i+1-prevDistance, i+1)
+				if m.End-m.Start > q.MinLength {
+					currentMatch = m
+					foundMatches = append(foundMatches, m)
+				}
+			}
+		}
+
+		if binary.LittleEndian.Uint32(src[candidate:]) == binary.LittleEndian.Uint32(src[i:]) {
+			m := extendMatch2(src, i, candidate, max(historyLen, prevMatch.Start))
+			if m.End-m.Start > q.MinLength {
+				currentMatch = m
+				foundMatches = append(foundMatches, m)
+			}
+		}
+
+		for range q.ChainLength {
+			delta := q.chain[candidate]
+			if delta == 0 {
+				break
+			}
+			candidate -= int(delta)
+			if candidate <= 0 || i-candidate > q.MaxDistance {
+				break
+			}
+			if binary.LittleEndian.Uint32(src[candidate:]) == binary.LittleEndian.Uint32(src[i:]) {
+				m := extendMatch2(src, i, candidate, max(historyLen, prevMatch.Start))
+				if m.End-m.Start > q.MinLength && m.End-m.Start > currentMatch.End-currentMatch.Start {
+					currentMatch = m
+					foundMatches = append(foundMatches, m)
+				}
+			}
+		}
+
+		if i < prevMatch.End && currentMatch.End-currentMatch.Start <= prevMatch.End-prevMatch.Start {
+			// We were looking for an overlapping match, but we didn't find one longer
+			// than the previous match. So we'll go back to sequential search,
+			// starting right after the previous match.
+			i = prevMatch.End
+			continue
+		}
+
+		if currentMatch == (absoluteMatch{}) {
+			// No match found. Continue with sequential search.
+			i++
+			continue
+		}
+
+		// We've found a match; now look for matches overlapping the end of it.
+		prevMatch = currentMatch
+		i = currentMatch.End + 2 - q.HashLen
+	}
+
+	q.foundMatches = foundMatches
+
+	slices.SortFunc(foundMatches, func(a, b absoluteMatch) int { return a.Start - b.Start })
+	matchIndex := 0
+	var pending absoluteMatch
+
+	for i := historyLen; i < len(src); i++ {
+		var arrivedHere arrival
+		if i > historyLen {
+			arrivedHere = arrivals[i-historyLen-1]
+		}
+
+		unmatched := 0
+		if arrivedHere.distance == 0 {
+			unmatched = int(arrivedHere.length)
+		}
+		prevDistance := 0
+		if i-unmatched > historyLen {
+			prevDistance = int(arrivals[i-historyLen-1-unmatched].distance)
+		}
+
+		literalCost := byteCost[src[i]]
+		nextArrival := &arrivals[i-historyLen]
+		if nextArrival.cost == 0 || arrivedHere.cost+literalCost < nextArrival.cost {
+			*nextArrival = arrival{
+				cost:   arrivedHere.cost + literalCost,
+				length: uint32(unmatched + 1),
+			}
+		}
+
+		for matchIndex < len(foundMatches) && foundMatches[matchIndex].Start == i {
+			m := foundMatches[matchIndex]
+			matchIndex++
+			if m.End > pending.End {
+				pending = m
+			}
+			matchCost := baseMatchCost + float32(bits.Len(uint(unmatched)))
+			if m.Start-m.Match != prevDistance {
+				matchCost += float32(bits.Len(uint(m.Start - m.Match)))
+			}
+			for j := m.Start + q.MinLength; j <= m.End; j++ {
+				adjustedCost := matchCost
+				if j-m.Start < 6 {
+					// Matches shorter than 6 are comparatively rare, and therefore
+					// have longer codes.
+					adjustedCost += float32(6-(j-m.Start)) * 2
+				}
+				a := &arrivals[j-historyLen-1]
+				if a.cost == 0 || arrivedHere.cost+adjustedCost < a.cost {
+					*a = arrival{
+						length:   uint32(j - m.Start),
+						distance: uint32(m.Start - m.Match),
+						cost:     arrivedHere.cost + adjustedCost,
+					}
+				}
+			}
+		}
+
+		// If a match from an earlier position extends far enough past the current
+		// position, try using the tail of it, starting from here.
+		if unmatched == 0 && pending.Start != i && pending.End >= i+q.MinLength &&
+			!(arrivedHere.length != 0 && arrivedHere.distance == uint32(pending.Start-pending.Match)) {
+			matchCost := baseMatchCost + float32(bits.Len(uint(pending.Start-pending.Match)))
+			for j := i + q.MinLength; j <= pending.End; j++ {
+				adjustedCost := matchCost
+				if j-i < 6 {
+					// Matches shorter than 6 are comparatively rare, and therefore
+					// have longer codes.
+					adjustedCost += float32(6-(j-i)) * 2
+				}
+				a := &arrivals[j-historyLen-1]
+				if a.cost == 0 || arrivedHere.cost+adjustedCost < a.cost {
+					*a = arrival{
+						length:   uint32(j - i),
+						distance: uint32(pending.Start - pending.Match),
+						cost:     arrivedHere.cost + adjustedCost,
+					}
+				}
+			}
+		}
+
+		delta := q.chain[i]
+		if delta == 0 {
+			continue
+		}
+		candidate := i - int(delta)
+		if candidate <= 0 || i-candidate > q.MaxDistance {
+			continue
+		}
+	}
+
+	// We've found the shortest path; now walk it backward and store the matches.
+	matches := q.matches[:0]
+	i = len(arrivals) - 1
+	for i >= 0 {
+		a := arrivals[i]
+		if a.distance > 0 {
+			matches = append(matches, Match{
+				Length:   int(a.length),
+				Distance: int(a.distance),
+			})
+			i -= int(a.length)
+		} else {
+			if len(matches) == 0 {
+				matches = append(matches, Match{})
+			}
+			matches[len(matches)-1].Unmatched = int(a.length)
+			i -= int(a.length)
+		}
+	}
+	q.matches = matches
+
+	slices.Reverse(matches)
+
+	return append(dst, matches...)
+}

+ 3 - 0
vendor/github.com/andybalholm/brotli/reader.go

@@ -49,6 +49,9 @@ func (r *Reader) Read(p []byte) (n int, err error) {
 	if !decoderHasMoreOutput(r) && len(r.in) == 0 {
 		m, readErr := r.src.Read(r.buf)
 		if m == 0 {
+			if readErr == io.EOF && r.state != stateDone {
+				readErr = io.ErrUnexpectedEOF
+			}
 			// If readErr is `nil`, we just proxy underlying stream behavior.
 			return 0, readErr
 		}

+ 17 - 5
vendor/github.com/andybalholm/brotli/writer.go

@@ -121,18 +121,18 @@ type nopCloser struct {
 func (nopCloser) Close() error { return nil }
 
 // NewWriterV2 is like NewWriterLevel, but it uses the new implementation
-// based on the matchfinder package. It currently supports up to level 7;
-// if a higher level is specified, level 7 will be used.
+// based on the matchfinder package. It currently supports up to level 9;
+// if a higher level is specified, level 9 will be used.
 func NewWriterV2(dst io.Writer, level int) *matchfinder.Writer {
 	var mf matchfinder.MatchFinder
 	if level < 2 {
 		mf = matchfinder.M0{Lazy: level == 1}
-	} else {
+	} else if level < 8 {
 		hashLen := 6
 		if level >= 6 {
 			hashLen = 5
 		}
-		chainLen := 64
+		chainLen := 16
 		switch level {
 		case 2:
 			chainLen = 0
@@ -149,7 +149,19 @@ func NewWriterV2(dst io.Writer, level int) *matchfinder.Writer {
 			MaxDistance:     1 << 20,
 			ChainLength:     chainLen,
 			HashLen:         hashLen,
-			DistanceBitCost: 57,
+			DistanceBitCost: 66,
+		}
+	} else {
+		chainLen := 32
+		hashLen := 5
+		if level == 8 {
+			chainLen = 4
+			hashLen = 6
+		}
+		mf = &matchfinder.Pathfinder{
+			MaxDistance: 1 << 20,
+			ChainLength: chainLen,
+			HashLen:     hashLen,
 		}
 	}
 

+ 1 - 0
vendor/github.com/dgraph-io/badger/v4/CHANGELOG.md

@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
 
 ## [Unreleased]
 
+- chore(deps): Remove dependency on github.com/pkg/errors (#2184)
 - chore(deps): Migrate from OpenCensus to OpenTelemetry (#2169)
 
 ## [4.5.1] - 2025-01-21

+ 2 - 2
vendor/github.com/dgraph-io/badger/v4/Makefile

@@ -5,7 +5,7 @@
 
 USER_ID      = $(shell id -u)
 HAS_JEMALLOC = $(shell test -f /usr/local/lib/libjemalloc.a && echo "jemalloc")
-JEMALLOC_URL = "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"
+JEMALLOC_URL = "https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2"
 
 
 .PHONY: all badger test jemalloc dependency
@@ -25,7 +25,7 @@ jemalloc:
 		echo "Downloading jemalloc..." ; \
 		curl -s -L ${JEMALLOC_URL} -o jemalloc.tar.bz2 ; \
 		tar xjf ./jemalloc.tar.bz2 ; \
-		cd jemalloc-5.2.1 ; \
+		cd jemalloc-5.3.0 ; \
 		./configure --with-jemalloc-prefix='je_' --with-malloc-conf='background_thread:true,metadata_thp:auto'; \
 		make ; \
 		if [ "$(USER_ID)" -eq "0" ]; then \

+ 14 - 43
vendor/github.com/dgraph-io/badger/v4/README.md

@@ -5,12 +5,12 @@
 [![Sourcegraph](https://sourcegraph.com/github.com/hypermodeinc/badger/-/badge.svg)](https://sourcegraph.com/github.com/hypermodeinc/badger?badge)
 [![ci-badger-tests](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-tests.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-tests.yml)
 [![ci-badger-bank-tests](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests.yml)
-[![ci-golang-lint](https://github.com/hypermodeinc/badger/actions/workflows/ci-golang-lint.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-golang-lint.yml)
+[![ci-badger-bank-tests-nightly](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests-nightly.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests-nightly.yml)
 
 ![Badger mascot](images/diggy-shadow.png)
 
 BadgerDB is an embeddable, persistent and fast key-value (KV) database written in pure Go. It is the
-underlying database for [Dgraph](https://dgraph.io), a fast, distributed graph database. It's meant
+underlying database for [Dgraph](https://github.com/hypermodeinc/dgraph), a fast, distributed graph database. It's meant
 to be a performant alternative to non-Go-based key-value stores like RocksDB.
 
 ## Project Status
@@ -24,18 +24,8 @@ Jaeger Tracing, UsenetExpress, and many more.
 
 The list of projects using Badger can be found [here](#projects-using-badger).
 
-Badger v1.0 was released in Nov 2017, and the latest version that is data-compatible with v1.0 is
-v1.6.0.
-
-Badger v2.0 was released in Nov 2019 with a new storage format which won't be compatible with all of
-the v1.x. Badger v2.0 supports compression, encryption and uses a cache to speed up lookup.
-
-Badger v3.0 was released in January 2021. This release improves compaction performance.
-
 Please consult the [Changelog] for more detailed information on releases.
 
-For more details on our version naming schema please read [Choosing a version](#choosing-a-version).
-
 [Changelog]: https://github.com/hypermodeinc/badger/blob/main/CHANGELOG.md
 
 ## Table of Contents
@@ -82,30 +72,6 @@ go install .
 
 This will install the badger command line utility into your $GOBIN path.
 
-#### Choosing a version
-
-BadgerDB is a pretty special package from the point of view that the most important change we can
-make to it is not on its API but rather on how data is stored on disk.
-
-This is why we follow a version naming schema that differs from Semantic Versioning.
-
-- New major versions are released when the data format on disk changes in an incompatible way.
-- New minor versions are released whenever the API changes but data compatibility is maintained.
-  Note that the changes on the API could be backward-incompatible - unlike Semantic Versioning.
-- New patch versions are released when there's no changes to the data format nor the API.
-
-Following these rules:
-
-- v1.5.0 and v1.6.0 can be used on top of the same files without any concerns, as their major
-  version is the same, therefore the data format on disk is compatible.
-- v1.6.0 and v2.0.0 are data incompatible as their major version implies, so files created with
-  v1.6.0 will need to be converted into the new format before they can be used by v2.0.0.
-- v2.x.x and v3.x.x are data incompatible as their major version implies, so files created with
-  v2.x.x will need to be converted into the new format before they can be used by v3.0.0.
-
-For a longer explanation on the reasons behind using a new versioning naming schema, you can read
-[VERSIONING](VERSIONING.md).
-
 ## Badger Documentation
 
 Badger Documentation is available at https://docs.hypermode.com/badger
@@ -114,10 +80,10 @@ Badger Documentation is available at https://docs.hypermode.com/badger
 
 ### Blog Posts
 
-1. [Introducing Badger: A fast key-value store written natively in Go](https://open.dgraph.io/post/badger/)
-2. [Make Badger crash resilient with ALICE](https://open.dgraph.io/post/alice/)
-3. [Badger vs LMDB vs BoltDB: Benchmarking key-value databases in Go](https://open.dgraph.io/post/badger-lmdb-boltdb/)
-4. [Concurrent ACID Transactions in Badger](https://open.dgraph.io/post/badger-txn/)
+1. [Introducing Badger: A fast key-value store written natively in Go](https://hypermode.com/blog/badger/)
+2. [Make Badger crash resilient with ALICE](https://hypermode.com/blog/alice/)
+3. [Badger vs LMDB vs BoltDB: Benchmarking key-value databases in Go](https://hypermode.com/blog/badger-lmdb-boltdb/)
+4. [Concurrent ACID Transactions in Badger](https://hypermode.com/blog/badger-txn/)
 
 ## Design
 
@@ -155,7 +121,7 @@ values from keys, significantly reducing the write amplification compared to a t
 rotating disks. As such RocksDB's design isn't aimed at SSDs.
 
 <sup>3</sup> SSI: Serializable Snapshot Isolation. For more details, see the blog post
-[Concurrent ACID Transactions in Badger](https://blog.dgraph.io/post/badger-txn/)
+[Concurrent ACID Transactions in Badger](https://hypermode.com/blog/badger-txn/)
 
 <sup>4</sup> Badger provides direct access to value versions via its Iterator API. Users can also
 specify how many versions to keep per key via Options.
@@ -277,6 +243,11 @@ Below is a list of known projects that use Badger:
   and badger db
 - [MightyMap](https://github.com/thisisdevelopment/mightymap) - Mightymap: Conveys both robustness
   and high capability, fitting for a powerful concurrent map.
+- [FlowG](https://github.com/link-society/flowg) - A low-code log processing facility
+- [Bluefin](https://github.com/blinklabs-io/bluefin) - Bluefin is a TUNA Proof of Work miner for
+  the Fortuna smart contract on the Cardano blockchain
+- [cDNSd](https://github.com/blinklabs-io/cdnsd) - A Cardano blockchain backed DNS server daemon
+- [Dingo](https://github.com/blinklabs-io/dingo) - A Cardano blockchain data node
 
 If you are using Badger in a project please send a pull request to add it to the list.
 
@@ -287,6 +258,6 @@ If you're interested in contributing to Badger see [CONTRIBUTING](./CONTRIBUTING
 ## Contact
 
 - Please use [Github issues](https://github.com/hypermodeinc/badger/issues) for filing bugs.
-- Please use [discuss.dgraph.io](https://discuss.dgraph.io) for questions, discussions, and feature
+- Please use [discuss.hypermode.com](https://discuss.hypermode.com) for questions, discussions, and feature
   requests.
-- Follow us on Twitter [@dgraphlabs](https://twitter.com/dgraphlabs).
+- Follow us on Twitter [@hypermodeinc](https://twitter.com/hypermodeinc).

+ 2 - 2
vendor/github.com/dgraph-io/badger/v4/backup.go

@@ -10,9 +10,9 @@ import (
 	"bytes"
 	"context"
 	"encoding/binary"
+	"fmt"
 	"io"
 
-	"github.com/pkg/errors"
 	"google.golang.org/protobuf/proto"
 
 	"github.com/dgraph-io/badger/v4/pb"
@@ -61,7 +61,7 @@ func (stream *Stream) Backup(w io.Writer, since uint64) (uint64, error) {
 				return list, nil
 			}
 			if item.Version() < since {
-				return nil, errors.Errorf("Backup: Item Version: %d less than sinceTs: %d",
+				return nil, fmt.Errorf("Backup: Item Version: %d less than sinceTs: %d",
 					item.Version(), since)
 			}
 

+ 3 - 2
vendor/github.com/dgraph-io/badger/v4/batch.go

@@ -6,10 +6,11 @@
 package badger
 
 import (
+	"errors"
+	"fmt"
 	"sync"
 	"sync/atomic"
 
-	"github.com/pkg/errors"
 	"google.golang.org/protobuf/proto"
 
 	"github.com/dgraph-io/badger/v4/pb"
@@ -220,7 +221,7 @@ func (wb *WriteBatch) Flush() error {
 
 	if err := wb.throttle.Finish(); err != nil {
 		if wb.Error() != nil {
-			return errors.Errorf("wb.err: %s err: %s", wb.Error(), err)
+			return fmt.Errorf("wb.err: %w err: %w", wb.Error(), err)
 		}
 		return err
 	}

+ 9 - 10
vendor/github.com/dgraph-io/badger/v4/db.go

@@ -9,7 +9,7 @@ import (
 	"bytes"
 	"context"
 	"encoding/binary"
-	stderrors "errors"
+	"errors"
 	"expvar"
 	"fmt"
 	"math"
@@ -22,7 +22,6 @@ import (
 	"time"
 
 	humanize "github.com/dustin/go-humanize"
-	"github.com/pkg/errors"
 
 	"github.com/dgraph-io/badger/v4/fb"
 	"github.com/dgraph-io/badger/v4/options"
@@ -145,14 +144,14 @@ func checkAndSetOptions(opt *Options) error {
 
 	// We are limiting opt.ValueThreshold to maxValueThreshold for now.
 	if opt.ValueThreshold > maxValueThreshold {
-		return errors.Errorf("Invalid ValueThreshold, must be less or equal to %d",
+		return fmt.Errorf("Invalid ValueThreshold, must be less or equal to %d",
 			maxValueThreshold)
 	}
 
 	// If ValueThreshold is greater than opt.maxBatchSize, we won't be able to push any data using
 	// the transaction APIs. Transaction batches entries into batches of size opt.maxBatchSize.
 	if opt.ValueThreshold > opt.maxBatchSize {
-		return errors.Errorf("Valuethreshold %d greater than max batch size of %d. Either "+
+		return fmt.Errorf("Valuethreshold %d greater than max batch size of %d. Either "+
 			"reduce opt.ValueThreshold or increase opt.BaseTableSize.",
 			opt.ValueThreshold, opt.maxBatchSize)
 	}
@@ -373,7 +372,7 @@ func Open(opt Options) (*DB, error) {
 	go db.threshold.listenForValueThresholdUpdate()
 
 	if err := db.initBannedNamespaces(); err != nil {
-		return db, errors.Wrapf(err, "While setting banned keys")
+		return db, fmt.Errorf("While setting banned keys: %w", err)
 	}
 
 	db.closers.writes = z.NewCloser(1)
@@ -787,7 +786,7 @@ func (db *DB) writeToLSM(b *request) error {
 	// running in InMemory mode. In InMemory mode, we don't write anything to the
 	// value log and that's why the length of b.Ptrs will always be zero.
 	if !db.opt.InMemory && len(b.Ptrs) != len(b.Entries) {
-		return errors.Errorf("Ptrs and Entries don't match: %+v", b)
+		return fmt.Errorf("Ptrs and Entries don't match: %+v", b)
 	}
 
 	for i, entry := range b.Entries {
@@ -1005,7 +1004,7 @@ func (db *DB) batchSetAsync(entries []*Entry, f func(error)) error {
 	return nil
 }
 
-var errNoRoom = stderrors.New("No room for write")
+var errNoRoom = errors.New("No room for write")
 
 // ensureRoomForWrite is always called serially.
 func (db *DB) ensureRoomForWrite() error {
@@ -1963,7 +1962,7 @@ func createDirs(opt Options) error {
 		}
 		if !dirExists {
 			if opt.ReadOnly {
-				return errors.Errorf("Cannot find directory %q for read-only open", path)
+				return fmt.Errorf("Cannot find directory %q for read-only open", path)
 			}
 			// Try to create the directory
 			err = os.MkdirAll(path, 0700)
@@ -2035,7 +2034,7 @@ func (db *DB) CacheMaxCost(cache CacheType, maxCost int64) (int64, error) {
 		case IndexCache:
 			return db.indexCache.MaxCost(), nil
 		default:
-			return 0, errors.Errorf("invalid cache type")
+			return 0, errors.New("invalid cache type")
 		}
 	}
 
@@ -2047,7 +2046,7 @@ func (db *DB) CacheMaxCost(cache CacheType, maxCost int64) (int64, error) {
 		db.indexCache.UpdateMaxCost(maxCost)
 		return maxCost, nil
 	default:
-		return 0, errors.Errorf("invalid cache type")
+		return 0, errors.New("invalid cache type")
 	}
 }
 

+ 5 - 6
vendor/github.com/dgraph-io/badger/v4/levels.go

@@ -9,7 +9,7 @@ import (
 	"bytes"
 	"context"
 	"encoding/hex"
-	stderrors "errors"
+	"errors"
 	"fmt"
 	"math"
 	"math/rand"
@@ -20,7 +20,6 @@ import (
 	"sync/atomic"
 	"time"
 
-	"github.com/pkg/errors"
 	"go.opentelemetry.io/otel"
 	"go.opentelemetry.io/otel/attribute"
 
@@ -227,7 +226,7 @@ func (s *levelsController) dropTree() (int, error) {
 		}
 	}
 	changeSet := pb.ManifestChangeSet{Changes: changes}
-	if err := s.kv.manifest.addChanges(changeSet.Changes); err != nil {
+	if err := s.kv.manifest.addChanges(changeSet.Changes, s.kv.opt); err != nil {
 		return 0, err
 	}
 
@@ -1438,7 +1437,7 @@ func (s *levelsController) runCompactDef(id, l int, cd compactDef) (err error) {
 	changeSet := buildChangeSet(&cd, newTables)
 
 	// We write to the manifest _before_ we delete files (and after we created files)
-	if err := s.kv.manifest.addChanges(changeSet.Changes); err != nil {
+	if err := s.kv.manifest.addChanges(changeSet.Changes, s.kv.opt); err != nil {
 		return err
 	}
 
@@ -1502,7 +1501,7 @@ func tablesToString(tables []*table.Table) []string {
 	return res
 }
 
-var errFillTables = stderrors.New("Unable to fill tables")
+var errFillTables = errors.New("Unable to fill tables")
 
 // doCompact picks some table on level l and compacts it away to the next level.
 func (s *levelsController) doCompact(id int, p compactionPriority) error {
@@ -1567,7 +1566,7 @@ func (s *levelsController) addLevel0Table(t *table.Table) error {
 		// deletes the table.)
 		err := s.kv.manifest.addChanges([]*pb.ManifestChange{
 			newCreateChange(t.ID(), 0, t.KeyID(), t.CompressionType()),
-		})
+		}, s.kv.opt)
 		if err != nil {
 			return err
 		}

+ 25 - 22
vendor/github.com/dgraph-io/badger/v4/manifest.go

@@ -9,7 +9,7 @@ import (
 	"bufio"
 	"bytes"
 	"encoding/binary"
-	stderrors "errors"
+	"errors"
 	"fmt"
 	"hash/crc32"
 	"io"
@@ -18,7 +18,6 @@ import (
 	"path/filepath"
 	"sync"
 
-	"github.com/pkg/errors"
 	"google.golang.org/protobuf/proto"
 
 	"github.com/dgraph-io/badger/v4/options"
@@ -106,10 +105,10 @@ func (m *Manifest) asChanges() []*pb.ManifestChange {
 	return changes
 }
 
-func (m *Manifest) clone() Manifest {
+func (m *Manifest) clone(opt Options) Manifest {
 	changeSet := pb.ManifestChangeSet{Changes: m.asChanges()}
 	ret := createManifest()
-	y.Check(applyChangeSet(&ret, &changeSet))
+	y.Check(applyChangeSet(&ret, &changeSet, opt))
 	return ret
 }
 
@@ -121,11 +120,11 @@ func openOrCreateManifestFile(opt Options) (
 		return &manifestFile{inMemory: true}, Manifest{}, nil
 	}
 	return helpOpenOrCreateManifestFile(opt.Dir, opt.ReadOnly, opt.ExternalMagicVersion,
-		manifestDeletionsRewriteThreshold)
+		manifestDeletionsRewriteThreshold, opt)
 }
 
 func helpOpenOrCreateManifestFile(dir string, readOnly bool, extMagic uint16,
-	deletionsThreshold int) (*manifestFile, Manifest, error) {
+	deletionsThreshold int, opt Options) (*manifestFile, Manifest, error) {
 
 	path := filepath.Join(dir, ManifestFilename)
 	var flags y.Flags
@@ -150,13 +149,13 @@ func helpOpenOrCreateManifestFile(dir string, readOnly bool, extMagic uint16,
 			fp:                        fp,
 			directory:                 dir,
 			externalMagic:             extMagic,
-			manifest:                  m.clone(),
+			manifest:                  m.clone(opt),
 			deletionsRewriteThreshold: deletionsThreshold,
 		}
 		return mf, m, nil
 	}
 
-	manifest, truncOffset, err := ReplayManifestFile(fp, extMagic)
+	manifest, truncOffset, err := ReplayManifestFile(fp, extMagic, opt)
 	if err != nil {
 		_ = fp.Close()
 		return nil, Manifest{}, err
@@ -178,7 +177,7 @@ func helpOpenOrCreateManifestFile(dir string, readOnly bool, extMagic uint16,
 		fp:                        fp,
 		directory:                 dir,
 		externalMagic:             extMagic,
-		manifest:                  manifest.clone(),
+		manifest:                  manifest.clone(opt),
 		deletionsRewriteThreshold: deletionsThreshold,
 	}
 	return mf, manifest, nil
@@ -195,7 +194,7 @@ func (mf *manifestFile) close() error {
 // we replay the MANIFEST file, we'll either replay all the changes or none of them.  (The truth of
 // this depends on the filesystem -- some might append garbage data if a system crash happens at
 // the wrong time.)
-func (mf *manifestFile) addChanges(changesParam []*pb.ManifestChange) error {
+func (mf *manifestFile) addChanges(changesParam []*pb.ManifestChange, opt Options) error {
 	if mf.inMemory {
 		return nil
 	}
@@ -208,7 +207,7 @@ func (mf *manifestFile) addChanges(changesParam []*pb.ManifestChange) error {
 	// Maybe we could use O_APPEND instead (on certain file systems)
 	mf.appendLock.Lock()
 	defer mf.appendLock.Unlock()
-	if err := applyChangeSet(&mf.manifest, &changes); err != nil {
+	if err := applyChangeSet(&mf.manifest, &changes, opt); err != nil {
 		return err
 	}
 	// Rewrite manifest if it'd shrink by 1/10 and it's big enough to care
@@ -342,8 +341,8 @@ func (r *countingReader) ReadByte() (b byte, err error) {
 }
 
 var (
-	errBadMagic    = stderrors.New("manifest has bad magic")
-	errBadChecksum = stderrors.New("manifest has checksum mismatch")
+	errBadMagic    = errors.New("manifest has bad magic")
+	errBadChecksum = errors.New("manifest has checksum mismatch")
 )
 
 // ReplayManifestFile reads the manifest file and constructs two manifest objects.  (We need one
@@ -351,7 +350,7 @@ var (
 // Also, returns the last offset after a completely read manifest entry -- the file must be
 // truncated at that point before further appends are made (if there is a partial entry after
 // that).  In normal conditions, truncOffset is the file size.
-func ReplayManifestFile(fp *os.File, extMagic uint16) (Manifest, int64, error) {
+func ReplayManifestFile(fp *os.File, extMagic uint16, opt Options) (Manifest, int64, error) {
 	r := countingReader{wrapped: bufio.NewReader(fp)}
 
 	var magicBuf [8]byte
@@ -399,7 +398,7 @@ func ReplayManifestFile(fp *os.File, extMagic uint16) (Manifest, int64, error) {
 		length := y.BytesToU32(lenCrcBuf[0:4])
 		// Sanity check to ensure we don't over-allocate memory.
 		if length > uint32(stat.Size()) {
-			return Manifest{}, 0, errors.Errorf(
+			return Manifest{}, 0, fmt.Errorf(
 				"Buffer length: %d greater than file size: %d. Manifest file might be corrupted",
 				length, stat.Size())
 		}
@@ -419,7 +418,7 @@ func ReplayManifestFile(fp *os.File, extMagic uint16) (Manifest, int64, error) {
 			return Manifest{}, 0, err
 		}
 
-		if err := applyChangeSet(&build, &changeSet); err != nil {
+		if err := applyChangeSet(&build, &changeSet, opt); err != nil {
 			return Manifest{}, 0, err
 		}
 	}
@@ -427,7 +426,7 @@ func ReplayManifestFile(fp *os.File, extMagic uint16) (Manifest, int64, error) {
 	return build, offset, nil
 }
 
-func applyManifestChange(build *Manifest, tc *pb.ManifestChange) error {
+func applyManifestChange(build *Manifest, tc *pb.ManifestChange, opt Options) error {
 	switch tc.Op {
 	case pb.ManifestChange_CREATE:
 		if _, ok := build.Tables[tc.Id]; ok {
@@ -446,10 +445,14 @@ func applyManifestChange(build *Manifest, tc *pb.ManifestChange) error {
 	case pb.ManifestChange_DELETE:
 		tm, ok := build.Tables[tc.Id]
 		if !ok {
-			return fmt.Errorf("MANIFEST removes non-existing table %d", tc.Id)
+			opt.Warningf("MANIFEST delete: table %d has already been removed", tc.Id)
+			for _, level := range build.Levels {
+				delete(level.Tables, tc.Id)
+			}
+		} else {
+			delete(build.Levels[tm.Level].Tables, tc.Id)
+			delete(build.Tables, tc.Id)
 		}
-		delete(build.Levels[tm.Level].Tables, tc.Id)
-		delete(build.Tables, tc.Id)
 		build.Deletions++
 	default:
 		return fmt.Errorf("MANIFEST file has invalid manifestChange op")
@@ -459,9 +462,9 @@ func applyManifestChange(build *Manifest, tc *pb.ManifestChange) error {
 
 // This is not a "recoverable" error -- opening the KV store fails because the MANIFEST file is
 // just plain broken.
-func applyChangeSet(build *Manifest, changeSet *pb.ManifestChangeSet) error {
+func applyChangeSet(build *Manifest, changeSet *pb.ManifestChangeSet, opt Options) error {
 	for _, change := range changeSet.Changes {
-		if err := applyManifestChange(build, change); err != nil {
+		if err := applyManifestChange(build, change, opt); err != nil {
 			return err
 		}
 	}

+ 1 - 3
vendor/github.com/dgraph-io/badger/v4/memtable.go

@@ -22,8 +22,6 @@ import (
 	"sync"
 	"sync/atomic"
 
-	"github.com/pkg/errors"
-
 	"github.com/dgraph-io/badger/v4/pb"
 	"github.com/dgraph-io/badger/v4/skl"
 	"github.com/dgraph-io/badger/v4/y"
@@ -147,7 +145,7 @@ func (db *DB) newMemTable() (*memTable, error) {
 		db.opt.Errorf("Got error: %v for id: %d\n", err, db.nextMemFid)
 		return nil, y.Wrapf(err, "newMemTable")
 	}
-	return nil, errors.Errorf("File %s already exists", mt.wal.Fd.Name())
+	return nil, fmt.Errorf("File %s already exists", mt.wal.Fd.Name())
 }
 
 func (db *DB) mtFilePath(fid int) string {

+ 3 - 5
vendor/github.com/dgraph-io/badger/v4/options.go

@@ -13,8 +13,6 @@ import (
 	"strings"
 	"time"
 
-	"github.com/pkg/errors"
-
 	"github.com/dgraph-io/badger/v4/options"
 	"github.com/dgraph-io/badger/v4/table"
 	"github.com/dgraph-io/badger/v4/y"
@@ -234,10 +232,10 @@ func parseCompression(cStr string) (options.CompressionType, int, error) {
 		y.Check(err)
 		if level <= 0 {
 			return 0, 0,
-				errors.Errorf("ERROR: compression level(%v) must be greater than zero", level)
+				fmt.Errorf("ERROR: compression level(%v) must be greater than zero", level)
 		}
 	} else if len(cStrSplit) > 2 {
-		return 0, 0, errors.Errorf("ERROR: Invalid badger.compression argument")
+		return 0, 0, fmt.Errorf("ERROR: Invalid badger.compression argument")
 	}
 	switch cType {
 	case "zstd":
@@ -247,7 +245,7 @@ func parseCompression(cStr string) (options.CompressionType, int, error) {
 	case "none":
 		return options.None, 0, nil
 	}
-	return 0, 0, errors.Errorf("ERROR: compression type (%s) invalid", cType)
+	return 0, 0, fmt.Errorf("ERROR: compression type (%s) invalid", cType)
 }
 
 // generateSuperFlag generates an identical SuperFlag string from the provided Options.

+ 34 - 3
vendor/github.com/dgraph-io/badger/v4/stream.go

@@ -75,6 +75,14 @@ type Stream struct {
 	//
 	// Note: Calls to KeyToList are concurrent.
 	KeyToList func(key []byte, itr *Iterator) (*pb.KVList, error)
+	// UseKeyToListWithThreadId is used to indicate that KeyToListWithThreadId should be used
+	// instead of KeyToList. This is a new api that can be used to figure out parallelism
+	// of the stream. Each threadId would be run serially. KeyToList being concurrent makes you
+	// take care of concurrency in KeyToList. Here threadId could be used to do some things serially.
+	// Once a thread finishes FinishThread() would be called.
+	UseKeyToListWithThreadId bool
+	KeyToListWithThreadId    func(key []byte, itr *Iterator, threadId int) (*pb.KVList, error)
+	FinishThread             func(threadId int) (*pb.KVList, error)
 
 	// This is the method where Stream sends the final output. All calls to Send are done by a
 	// single goroutine, i.e. logic within Send method can expect single threaded execution.
@@ -143,7 +151,7 @@ func (st *Stream) ToList(key []byte, itr *Iterator) (*pb.KVList, error) {
 // keyRange is [start, end), including start, excluding end. Do ensure that the start,
 // end byte slices are owned by keyRange struct.
 func (st *Stream) produceRanges(ctx context.Context) {
-	ranges := st.db.Ranges(st.Prefix, 16)
+	ranges := st.db.Ranges(st.Prefix, st.NumGo)
 	y.AssertTrue(len(ranges) > 0)
 	y.AssertTrue(ranges[0].left == nil)
 	y.AssertTrue(ranges[len(ranges)-1].right == nil)
@@ -186,7 +194,7 @@ func (st *Stream) produceKVs(ctx context.Context, threadId int) error {
 		iterOpts := DefaultIteratorOptions
 		iterOpts.AllVersions = true
 		iterOpts.Prefix = st.Prefix
-		iterOpts.PrefetchValues = false
+		iterOpts.PrefetchValues = true
 		iterOpts.SinceTs = st.SinceTs
 		itr := txn.NewIterator(iterOpts)
 		itr.ThreadId = threadId
@@ -233,7 +241,13 @@ func (st *Stream) produceKVs(ctx context.Context, threadId int) error {
 
 			// Now convert to key value.
 			itr.Alloc.Reset()
-			list, err := st.KeyToList(item.KeyCopy(nil), itr)
+			var list *pb.KVList
+			var err error
+			if st.UseKeyToListWithThreadId {
+				list, err = st.KeyToListWithThreadId(item.KeyCopy(nil), itr, threadId)
+			} else {
+				list, err = st.KeyToList(item.KeyCopy(nil), itr)
+			}
 			if err != nil {
 				st.db.opt.Warningf("While reading key: %x, got error: %v", item.Key(), err)
 				continue
@@ -252,6 +266,23 @@ func (st *Stream) produceKVs(ctx context.Context, threadId int) error {
 				}
 			}
 		}
+
+		if st.UseKeyToListWithThreadId {
+			if kvs, err := st.FinishThread(threadId); err != nil {
+				return err
+			} else {
+				for _, kv := range kvs.Kv {
+					kv.StreamId = streamId
+					KVToBuffer(kv, outList)
+					if outList.LenNoPadding() < batchSize {
+						continue
+					}
+					if err := sendIt(); err != nil {
+						return err
+					}
+				}
+			}
+		}
 		// Mark the stream as done.
 		if st.doneMarkers {
 			kv := &pb.KV{

+ 4 - 5
vendor/github.com/dgraph-io/badger/v4/stream_writer.go

@@ -10,8 +10,7 @@ import (
 	"fmt"
 	"sync"
 
-	humanize "github.com/dustin/go-humanize"
-	"github.com/pkg/errors"
+	"github.com/dustin/go-humanize"
 	"google.golang.org/protobuf/proto"
 
 	"github.com/dgraph-io/badger/v4/pb"
@@ -119,7 +118,7 @@ func (sw *StreamWriter) PrepareIncremental() error {
 		// on the tree, all the data will go to Lmax. All the levels above will be empty
 		// after flatten call. Now, we should be able to use incremental stream writer again.
 		if err := sw.db.Flatten(3); err != nil {
-			return errors.Wrapf(err, "error during flatten in StreamWriter")
+			return fmt.Errorf("error during flatten in StreamWriter: %w", err)
 		}
 		sw.prevLevel = len(sw.db.Levels()) - 1
 	}
@@ -417,7 +416,7 @@ func (w *sortedWriter) handleRequests() {
 // Add adds key and vs to sortedWriter.
 func (w *sortedWriter) Add(key []byte, vs y.ValueStruct) error {
 	if len(w.lastKey) > 0 && y.CompareKeys(key, w.lastKey) <= 0 {
-		return errors.Errorf("keys not in sorted order (last key: %s, key: %s)",
+		return fmt.Errorf("keys not in sorted order (last key: %s, key: %s)",
 			hex.Dump(w.lastKey), hex.Dump(key))
 	}
 
@@ -505,7 +504,7 @@ func (w *sortedWriter) createTable(builder *table.Builder) error {
 		Level:       uint32(lhandler.level),
 		Compression: uint32(tbl.CompressionType()),
 	}
-	if err := w.db.manifest.addChanges([]*pb.ManifestChange{change}); err != nil {
+	if err := w.db.manifest.addChanges([]*pb.ManifestChange{change}, w.db.opt); err != nil {
 		return err
 	}
 

+ 1 - 1
vendor/github.com/dgraph-io/badger/v4/table/builder.go

@@ -7,6 +7,7 @@ package table
 
 import (
 	"crypto/aes"
+	"errors"
 	"math"
 	"runtime"
 	"sync"
@@ -15,7 +16,6 @@ import (
 
 	fbs "github.com/google/flatbuffers/go"
 	"github.com/klauspost/compress/s2"
-	"github.com/pkg/errors"
 	"google.golang.org/protobuf/proto"
 
 	"github.com/dgraph-io/badger/v4/fb"

+ 3 - 3
vendor/github.com/dgraph-io/badger/v4/table/table.go

@@ -9,6 +9,7 @@ import (
 	"bytes"
 	"crypto/aes"
 	"encoding/binary"
+	"errors"
 	"fmt"
 	"math"
 	"os"
@@ -22,7 +23,6 @@ import (
 
 	"github.com/klauspost/compress/snappy"
 	"github.com/klauspost/compress/zstd"
-	"github.com/pkg/errors"
 	"google.golang.org/protobuf/proto"
 
 	"github.com/dgraph-io/badger/v4/fb"
@@ -250,7 +250,7 @@ func CreateTable(fname string, builder *Builder) (*Table, error) {
 	} else if err != nil {
 		return nil, y.Wrapf(err, "while creating table: %s", fname)
 	} else {
-		return nil, errors.Errorf("file already exists: %s", fname)
+		return nil, fmt.Errorf("file already exists: %s", fname)
 	}
 
 	written := bd.Copy(mf.Data)
@@ -281,7 +281,7 @@ func OpenTable(mf *z.MmapFile, opts Options) (*Table, error) {
 	id, ok := ParseFileID(filename)
 	if !ok {
 		mf.Close(-1)
-		return nil, errors.Errorf("Invalid filename: %s", filename)
+		return nil, fmt.Errorf("Invalid filename: %s", filename)
 	}
 	t := &Table{
 		MmapFile:   mf,

+ 1 - 3
vendor/github.com/dgraph-io/badger/v4/trie/trie.go

@@ -10,8 +10,6 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/pkg/errors"
-
 	"github.com/dgraph-io/badger/v4/pb"
 	"github.com/dgraph-io/badger/v4/y"
 )
@@ -123,7 +121,7 @@ func (t *Trie) fix(m pb.Match, id uint64, op int) error {
 
 	ignore, err := parseIgnoreBytes(m.IgnoreBytes)
 	if err != nil {
-		return errors.Wrapf(err, "while parsing ignore bytes: %s", m.IgnoreBytes)
+		return fmt.Errorf( "while parsing ignore bytes: %s: %w", m.IgnoreBytes,err)
 	}
 	for len(ignore) < len(m.Prefix) {
 		ignore = append(ignore, false)

+ 3 - 3
vendor/github.com/dgraph-io/badger/v4/txn.go

@@ -9,14 +9,14 @@ import (
 	"bytes"
 	"context"
 	"encoding/hex"
+	"errors"
+	"fmt"
 	"math"
 	"sort"
 	"strconv"
 	"sync"
 	"sync/atomic"
 
-	"github.com/pkg/errors"
-
 	"github.com/dgraph-io/badger/v4/y"
 	"github.com/dgraph-io/ristretto/v2/z"
 )
@@ -344,7 +344,7 @@ func (txn *Txn) checkSize(e *Entry) error {
 }
 
 func exceedsSize(prefix string, max int64, key []byte) error {
-	return errors.Errorf("%s with size %d exceeded %d limit. %s:\n%s",
+	return fmt.Errorf("%s with size %d exceeded %d limit. %s:\n%s",
 		prefix, len(key), max, prefix, hex.Dump(key[:1<<10]))
 }
 

+ 4 - 5
vendor/github.com/dgraph-io/badger/v4/util.go

@@ -7,12 +7,11 @@ package badger
 
 import (
 	"encoding/hex"
+	"fmt"
 	"math/rand"
 	"os"
 	"time"
 
-	"github.com/pkg/errors"
-
 	"github.com/dgraph-io/badger/v4/table"
 	"github.com/dgraph-io/badger/v4/y"
 )
@@ -37,11 +36,11 @@ func (s *levelHandler) validate() error {
 	numTables := len(s.tables)
 	for j := 1; j < numTables; j++ {
 		if j >= len(s.tables) {
-			return errors.Errorf("Level %d, j=%d numTables=%d", s.level, j, numTables)
+			return fmt.Errorf("Level %d, j=%d numTables=%d", s.level, j, numTables)
 		}
 
 		if y.CompareKeys(s.tables[j-1].Biggest(), s.tables[j].Smallest()) >= 0 {
-			return errors.Errorf(
+			return fmt.Errorf(
 				"Inter: Biggest(j-1)[%d] \n%s\n vs Smallest(j)[%d]: \n%s\n: "+
 					"level=%d j=%d numTables=%d",
 				s.tables[j-1].ID(), hex.Dump(s.tables[j-1].Biggest()), s.tables[j].ID(),
@@ -49,7 +48,7 @@ func (s *levelHandler) validate() error {
 		}
 
 		if y.CompareKeys(s.tables[j].Smallest(), s.tables[j].Biggest()) > 0 {
-			return errors.Errorf(
+			return fmt.Errorf(
 				"Intra: \n%s\n vs \n%s\n: level=%d j=%d numTables=%d",
 				hex.Dump(s.tables[j].Smallest()), hex.Dump(s.tables[j].Biggest()), s.level, j, numTables)
 		}

+ 10 - 11
vendor/github.com/dgraph-io/badger/v4/value.go

@@ -8,7 +8,7 @@ package badger
 import (
 	"bytes"
 	"context"
-	stderrors "errors"
+	"errors"
 	"fmt"
 	"hash"
 	"hash/crc32"
@@ -21,7 +21,6 @@ import (
 	"sync"
 	"sync/atomic"
 
-	"github.com/pkg/errors"
 	"go.opentelemetry.io/otel"
 	"go.opentelemetry.io/otel/attribute"
 
@@ -54,8 +53,8 @@ const (
 	vlogHeaderSize = 20
 )
 
-var errStop = stderrors.New("Stop iteration")
-var errTruncate = stderrors.New("Do truncate")
+var errStop = errors.New("Stop iteration")
+var errTruncate = errors.New("Do truncate")
 
 type logEntry func(e Entry, vp valuePointer) error
 
@@ -165,7 +164,7 @@ func (vlog *valueLog) rewrite(f *logFile) error {
 	for _, fid := range vlog.filesToBeDeleted {
 		if fid == f.fid {
 			vlog.filesLock.RUnlock()
-			return errors.Errorf("value log file already marked for deletion fid: %d", fid)
+			return fmt.Errorf("value log file already marked for deletion fid: %d", fid)
 		}
 	}
 	maxFid := vlog.maxFid
@@ -194,7 +193,7 @@ func (vlog *valueLog) rewrite(f *logFile) error {
 
 		// Value is still present in value log.
 		if len(vs.Value) == 0 {
-			return errors.Errorf("Empty value: %+v", vs)
+			return fmt.Errorf("Empty value: %+v", vs)
 		}
 		var vp valuePointer
 		vp.Decode(vs.Value)
@@ -334,7 +333,7 @@ func (vlog *valueLog) rewrite(f *logFile) error {
 		// Just a sanity-check.
 		if _, ok := vlog.filesMap[f.fid]; !ok {
 			vlog.filesLock.Unlock()
-			return errors.Errorf("Unable to find fid: %d", f.fid)
+			return fmt.Errorf("Unable to find fid: %d", f.fid)
 		}
 		if vlog.iteratorCount() == 0 {
 			delete(vlog.filesMap, f.fid)
@@ -754,7 +753,7 @@ func (vlog *valueLog) validateWrites(reqs []*request) error {
 		size := estimateRequestSize(req)
 		estimatedVlogOffset := vlogOffset + size
 		if estimatedVlogOffset > uint64(maxVlogFileSize) {
-			return errors.Errorf("Request size offset %d is bigger than maximum offset %d",
+			return fmt.Errorf("Request size offset %d is bigger than maximum offset %d",
 				estimatedVlogOffset, maxVlogFileSize)
 		}
 
@@ -906,7 +905,7 @@ func (vlog *valueLog) getFileRLocked(vp valuePointer) (*logFile, error) {
 	ret, ok := vlog.filesMap[vp.Fid]
 	if !ok {
 		// log file has gone away, we can't do anything. Return.
-		return nil, errors.Errorf("file with ID: %d not found", vp.Fid)
+		return nil, fmt.Errorf("file with ID: %d not found", vp.Fid)
 	}
 
 	// Check for valid offset if we are reading from writable log.
@@ -916,7 +915,7 @@ func (vlog *valueLog) getFileRLocked(vp valuePointer) (*logFile, error) {
 	if !vlog.opt.ReadOnly && vp.Fid == maxFid {
 		currentOffset := vlog.woffset()
 		if vp.Offset >= currentOffset {
-			return nil, errors.Errorf(
+			return nil, fmt.Errorf(
 				"Invalid value pointer offset: %d greater than current offset: %d",
 				vp.Offset, currentOffset)
 		}
@@ -961,7 +960,7 @@ func (vlog *valueLog) Read(vp valuePointer, _ *y.Slice) ([]byte, func(), error)
 	}
 	if uint32(len(kv)) < h.klen+h.vlen {
 		vlog.db.opt.Errorf("Invalid read: vp: %+v", vp)
-		return nil, nil, errors.Errorf("Invalid read: Len: %d read at:[%d:%d]",
+		return nil, nil, fmt.Errorf("Invalid read: Len: %d read at:[%d:%d]",
 			len(kv), h.klen, h.klen+h.vlen)
 	}
 	return kv[h.klen : h.klen+h.vlen], cb, nil

+ 5 - 12
vendor/github.com/dgraph-io/badger/v4/y/error.go

@@ -18,10 +18,9 @@ package y
 // (3) You want to generate a new error with stack trace info. Use x.Errorf.
 
 import (
+	"errors"
 	"fmt"
 	"log"
-
-	"github.com/pkg/errors"
 )
 
 var debugMode = false
@@ -41,14 +40,14 @@ func Check2(_ interface{}, err error) {
 // AssertTrue asserts that b is true. Otherwise, it would log fatal.
 func AssertTrue(b bool) {
 	if !b {
-		log.Fatalf("%+v", errors.Errorf("Assert failed"))
+		log.Fatalf("%+v", errors.New("Assert failed"))
 	}
 }
 
 // AssertTruef is AssertTrue with extra info.
 func AssertTruef(b bool, format string, args ...interface{}) {
 	if !b {
-		log.Fatalf("%+v", errors.Errorf(format, args...))
+		log.Fatalf("%+v", fmt.Errorf(format, args...))
 	}
 }
 
@@ -60,18 +59,12 @@ func Wrap(err error, msg string) error {
 		}
 		return fmt.Errorf("%s err: %+v", msg, err)
 	}
-	return errors.Wrap(err, msg)
+	return fmt.Errorf("%s: %w", msg, err)
 }
 
 // Wrapf is Wrap with extra info.
 func Wrapf(err error, format string, args ...interface{}) error {
-	if !debugMode {
-		if err == nil {
-			return nil
-		}
-		return fmt.Errorf(format+" error: %+v", append(args, err)...)
-	}
-	return errors.Wrapf(err, format, args...)
+	return Wrap(err, fmt.Sprintf(format, args...))
 }
 
 func CombineErrors(one, other error) error {

+ 1 - 2
vendor/github.com/dgraph-io/ristretto/v2/.gitignore

@@ -1,3 +1,2 @@
 # IDE
-.idea
-.vscode
+.idea

+ 0 - 30
vendor/github.com/dgraph-io/ristretto/v2/.golangci.yml

@@ -1,30 +0,0 @@
-run:
-  skip-dirs:
-  skip-files:
-
-linters-settings:
-  lll:
-    line-length: 120
-  staticcheck:
-    checks:
-      - all
-      - '-SA1019' # it is okay to use math/rand at times.
-  gosec:
-    excludes:
-      - G404  # it is okay to use math/rand at times.
-      - G115  # presents false positives for conversion
-
-linters:
-  disable-all: true
-  enable:
-    - errcheck
-    - gofmt
-    - goimports
-    - gosec
-    - gosimple
-    - govet
-    - ineffassign
-    - lll
-    - staticcheck
-    - unconvert
-    - unused

+ 91 - 79
vendor/github.com/dgraph-io/ristretto/v2/CHANGELOG.md

@@ -1,49 +1,57 @@
 # Changelog
+
 All notable changes to this project will be documented in this file.
 
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project will adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) starting v1.0.0.
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project will
+adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) starting v1.0.0.
+
+## [Unreleased]
+
+**Changed**
+
+- Remove dependency: github.com/pkg/errors (#443)
+
+**Fixed**
 
+- Switch from using a sync.Waitgroup, to closing a channel of struct{} (#442)
 
 ## [v2.0.1] - 2024-12-11
 
-### Fixed
+**Fixed**
 
 - Wait for goroutines to finish (#423)
 - Bump golang.org/x/sys from 0.27.0 to 0.28.0 in the minor group (#421)
 - Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 in the minor group (#420)
 - Bump golang.org/x/sys from 0.26.0 to 0.27.0 in the minor group (#419)
 
-**Full Changelog**: https://github.com/dgraph-io/ristretto/compare/v2.0.0...v2.0.1
-
+**Full Changelog**: https://github.com/hypermodeinc/ristretto/compare/v2.0.0...v2.0.1
 
 ## [v2.0.0] - 2024-11-11
 
-### Breaking
-
-- [Support generic API](https://github.com/dgraph-io/ristretto/pull/321)
-- [Restrict generic key type to only those supported](https://github.com/dgraph-io/ristretto/pull/371)
+**Breaking**
 
-### Added
+- [Support generic API](https://github.com/hypermodeinc/ristretto/pull/321)
+- [Restrict generic key type to only those supported](https://github.com/hypermodeinc/ristretto/pull/371)
 
-- [Fix build with GOOS=js GOARCH=wasm](https://github.com/dgraph-io/ristretto/pull/375)
+**Added**
 
-### Fixed
+- [Fix build with GOOS=js GOARCH=wasm](https://github.com/hypermodeinc/ristretto/pull/375)
 
-- [Disable mmap size check on arm arch as well as arm64](https://github.com/dgraph-io/ristretto/pull/366)
-- [Upgrade xxhash dependency to v2.2.0](https://github.com/dgraph-io/ristretto/pull/367)
-- [fix: race in close](https://github.com/dgraph-io/ristretto/pull/384)
-- [Fix some memory leaks in TTL implementation](https://github.com/dgraph-io/ristretto/pull/358)
-- [stop using rand.Seed()](https://github.com/dgraph-io/ristretto/pull/385)
-- [chore(deps): bump the actions group with 4 updates](https://github.com/dgraph-io/ristretto/pull/392)
-- [chore(deps): bump the minor group with 3 updates](https://github.com/dgraph-io/ristretto/pull/391)
-- [chore(deps): bump golang.org/x/sys from 0.25.0 to 0.26.0 in the minor group](https://github.com/dgraph-io/ristretto/pull/402)
-- [Remove the policy interface](https://github.com/dgraph-io/ristretto/pull/393)
-- [Perform validation to ensure that the three parameters, NumCounters, …](https://github.com/dgraph-io/ristretto/pull/410)
-- [set min version to go 1.21 in go.mod](https://github.com/dgraph-io/ristretto/pull/411)
+**Fixed**
 
-**Full Changelog**: https://github.com/dgraph-io/ristretto/compare/v0.2.0...v2.0.0
+- [Disable mmap size check on arm arch as well as arm64](https://github.com/hypermodeinc/ristretto/pull/366)
+- [Upgrade xxhash dependency to v2.2.0](https://github.com/hypermodeinc/ristretto/pull/367)
+- [fix: race in close](https://github.com/hypermodeinc/ristretto/pull/384)
+- [Fix some memory leaks in TTL implementation](https://github.com/hypermodeinc/ristretto/pull/358)
+- [stop using rand.Seed()](https://github.com/hypermodeinc/ristretto/pull/385)
+- [chore(deps): bump the actions group with 4 updates](https://github.com/hypermodeinc/ristretto/pull/392)
+- [chore(deps): bump the minor group with 3 updates](https://github.com/hypermodeinc/ristretto/pull/391)
+- [chore(deps): bump golang.org/x/sys from 0.25.0 to 0.26.0 in the minor group](https://github.com/hypermodeinc/ristretto/pull/402)
+- [Remove the policy interface](https://github.com/hypermodeinc/ristretto/pull/393)
+- [Perform validation to ensure that the three parameters, NumCounters, …](https://github.com/hypermodeinc/ristretto/pull/410)
+- [set min version to go 1.21 in go.mod](https://github.com/hypermodeinc/ristretto/pull/411)
 
+**Full Changelog**: https://github.com/hypermodeinc/ristretto/compare/v0.2.0...v2.0.0
 
 ## [v1.0.0]
 
@@ -55,55 +63,60 @@ and this project will adhere to [Semantic Versioning](http://semver.org/spec/v2.
 
 ## [v0.2.0] - 2024-10-06
 
-### Added
+**Added**
 
-- [fix: support compilation to wasip1 by @achille-roussel](https://github.com/dgraph-io/ristretto/pull/344)
-- [add config for cleanup ticker duration by @singhvikash11](https://github.com/dgraph-io/ristretto/pull/342)
+- [fix: support compilation to wasip1 by @achille-roussel](https://github.com/hypermodeinc/ristretto/pull/344)
+- [add config for cleanup ticker duration by @singhvikash11](https://github.com/hypermodeinc/ristretto/pull/342)
 
-### Fixed
-- [docs(readme): Use new Wait method by @angadn](https://github.com/dgraph-io/ristretto/pull/327)
-- [docs: format example on readme by @rfyiamcool](https://github.com/dgraph-io/ristretto/pull/339)
-- [Fix flakes in TestDropUpdates by @evanj](https://github.com/dgraph-io/ristretto/pull/334)
-- [docs(Cache): document Wait, clarify Get by @evanj](https://github.com/dgraph-io/ristretto/pull/333)
-- [chore: fix typo error by @proost](https://github.com/dgraph-io/ristretto/pull/341)
-- [remove glog dependency by @jhawk28](https://github.com/dgraph-io/ristretto/pull/350)
-- [fix(OnEvict): Set missing Expiration field on evicted items by @0x1ee7](https://github.com/dgraph-io/ristretto/pull/345)
-- [uint32 -> uint64 in slice methods by @mocurin](https://github.com/dgraph-io/ristretto/pull/323)
-- [fix: cleanupTicker not being stopped by @IlyaFloppy](https://github.com/dgraph-io/ristretto/pull/343)
+**Fixed**
 
-**Full Changelog**: https://github.com/dgraph-io/ristretto/compare/v0.1.1...v0.2.0
+- [docs(readme): Use new Wait method by @angadn](https://github.com/hypermodeinc/ristretto/pull/327)
+- [docs: format example on readme by @rfyiamcool](https://github.com/hypermodeinc/ristretto/pull/339)
+- [Fix flakes in TestDropUpdates by @evanj](https://github.com/hypermodeinc/ristretto/pull/334)
+- [docs(Cache): document Wait, clarify Get by @evanj](https://github.com/hypermodeinc/ristretto/pull/333)
+- [chore: fix typo error by @proost](https://github.com/hypermodeinc/ristretto/pull/341)
+- [remove glog dependency by @jhawk28](https://github.com/hypermodeinc/ristretto/pull/350)
+- [fix(OnEvict): Set missing Expiration field on evicted items by @0x1ee7](https://github.com/hypermodeinc/ristretto/pull/345)
+- [uint32 -> uint64 in slice methods by @mocurin](https://github.com/hypermodeinc/ristretto/pull/323)
+- [fix: cleanupTicker not being stopped by @IlyaFloppy](https://github.com/hypermodeinc/ristretto/pull/343)
 
+**Full Changelog**: https://github.com/hypermodeinc/ristretto/compare/v0.1.1...v0.2.0
 
 ## [0.1.1] - 2022-10-12
 
-[0.1.1]: https://github.com/dgraph-io/ristretto/compare/v0.1.0..v0.1.1
-This release fixes certain arm64 build issues in the z package.  It also
-incorporates CI steps in our repository.
+[0.1.1]: https://github.com/hypermodeinc/ristretto/compare/v0.1.0..v0.1.1
+
+This release fixes certain arm64 build issues in the z package. It also incorporates CI steps in our
+repository.
+
+**Changed**
 
-### Changed
-- [chore(docs): Include SpiceDB in the list of projects using Ristretto (#285)](https://github.com/dgraph-io/ristretto/pull/311)
+- [chore(docs): Include SpiceDB in the list of projects using Ristretto (#285)](https://github.com/hypermodeinc/ristretto/pull/311)
 
-### Added
-- [Run CI Jobs via Github Actions #304](https://github.com/dgraph-io/ristretto/pull/304)
+**Added**
 
-### Fixed
-- [fix(build): update x/sys dependency](https://github.com/dgraph-io/ristretto/pull/308)
-- [fix(z): Address inconsistent mremap return arguments with arm64](https://github.com/dgraph-io/ristretto/pull/309)
-- [fix(z): runtime error: index out of range for !amd64 env #287](https://github.com/dgraph-io/ristretto/pull/307)
+- [Run CI Jobs via Github Actions #304](https://github.com/hypermodeinc/ristretto/pull/304)
 
+**Fixed**
+
+- [fix(build): update x/sys dependency](https://github.com/hypermodeinc/ristretto/pull/308)
+- [fix(z): Address inconsistent mremap return arguments with arm64](https://github.com/hypermodeinc/ristretto/pull/309)
+- [fix(z): runtime error: index out of range for !amd64 env #287](https://github.com/hypermodeinc/ristretto/pull/307)
 
 ## [0.1.0] - 2021-06-03
 
-[0.1.0]: https://github.com/dgraph-io/ristretto/compare/v0.0.3..v0.1.0
-This release contains bug fixes and improvements to Ristretto. It also contains
-major updates to the z package. The z package contains types such as Tree (B+
-tree), Buffer, Mmap file, etc. All these types are used in Badger and Dgraph to
-improve performance and reduce memory requirements.
+[0.1.0]: https://github.com/hypermodeinc/ristretto/compare/v0.0.3..v0.1.0
+
+This release contains bug fixes and improvements to Ristretto. It also contains major updates to the
+z package. The z package contains types such as Tree (B+ tree), Buffer, Mmap file, etc. All these
+types are used in Badger and Dgraph to improve performance and reduce memory requirements.
+
+**Changed**
 
-### Changed
 - Make item public. Add a new onReject call for rejected items. (#180)
 
-### Added
+**Added**
+
 - Use z.Buffer backing for B+ tree (#268)
 - expose GetTTL function (#270)
 - docs(README): Ristretto is production-ready. (#267)
@@ -120,7 +133,8 @@ improve performance and reduce memory requirements.
 - Add life expectancy histogram (#182)
 - Add mechanism to wait for items to be processed. (#184)
 
-### Fixed
+**Fixed**
+
 - change expiration type from int64 to time.Time (#277)
 - fix(buffer): make buffer capacity atleast defaultCapacity (#273)
 - Fixes for z.PersistentTree (#272)
@@ -132,7 +146,8 @@ improve performance and reduce memory requirements.
 - Use Fibonacci for latency numbers
 - cache: fix race when clearning a cache (#261)
 - Check for keys without values in superflags (#259)
-- chore(perf): using tags instead of runtime callers to improve the performance of leak detection (#255)
+- chore(perf): using tags instead of runtime callers to improve the performance of leak detection
+  (#255)
 - fix(Flags): panic on user errors (#256)
 - fix SuperFlagHelp newline (#252)
 - fix(arm): Fix crashing under ARMv6 due to memory mis-alignment (#239)
@@ -155,7 +170,7 @@ improve performance and reduce memory requirements.
 - Add a BufferFrom
 - Bring z.Allocator and z.AllocatorPool back
 - Fix(z.Allocator): Make Allocator use Go memory
-- Updated ZeroOut to use a simple for loop.  (#231)
+- Updated ZeroOut to use a simple for loop. (#231)
 - Add concurrency back
 - Add a test to check concurrency of Allocator.
 - Fix(buffer): Expose padding by z.Buffer's APIs and fix test (#222)
@@ -216,45 +231,42 @@ improve performance and reduce memory requirements.
 - Add histogram.Mean() method (#188)
 - Introduce Calloc: Manual Memory Management via jemalloc (#186)
 
-
 ## [0.0.3] - 2020-07-06
 
-[0.0.3]: https://github.com/dgraph-io/ristretto/compare/v0.0.2..v0.0.3
+[0.0.3]: https://github.com/hypermodeinc/ristretto/compare/v0.0.2..v0.0.3
 
-### Changed
+**Changed**
 
-### Added
+**Added**
 
-### Fixed
-
-- z: use MemHashString and xxhash.Sum64String ([#153][])
-- Check conflict key before updating expiration map. ([#154][])
-- Fix race condition in Cache.Clear ([#133][])
-- Improve handling of updated items ([#168][])
-- Fix droppedSets count while updating the item ([#171][])
+**Fixed**
 
+- z: use MemHashString and xxhash.Sum64String (#153)
+- Check conflict key before updating expiration map. (#154)
+- Fix race condition in Cache.Clear (#133)
+- Improve handling of updated items (#168)
+- Fix droppedSets count while updating the item (#171)
 
 ## [0.0.2] - 2020-02-24
 
-[0.0.2]: https://github.com/dgraph-io/ristretto/compare/v0.0.1..v0.0.2
+[0.0.2]: https://github.com/hypermodeinc/ristretto/compare/v0.0.1..v0.0.2
 
-### Added
+**Added**
 
 - Sets with TTL. ([#122][])
 
-### Fixed
+**Fixed**
 
 - Fix the way metrics are handled for deletions. ([#111][])
 - Support nil `*Cache` values in `Clear` and `Close`. ([#119][])
 - Delete item immediately. ([#113][])
 - Remove key from policy after TTL eviction. ([#130][])
 
-[#111]: https://github.com/dgraph-io/ristretto/issues/111
-[#113]: https://github.com/dgraph-io/ristretto/issues/113
-[#119]: https://github.com/dgraph-io/ristretto/issues/119
-[#122]: https://github.com/dgraph-io/ristretto/issues/122
-[#130]: https://github.com/dgraph-io/ristretto/issues/130
-
+[#111]: https://github.com/hypermodeinc/ristretto/issues/111
+[#113]: https://github.com/hypermodeinc/ristretto/issues/113
+[#119]: https://github.com/hypermodeinc/ristretto/issues/119
+[#122]: https://github.com/hypermodeinc/ristretto/issues/122
+[#130]: https://github.com/hypermodeinc/ristretto/issues/130
 
 ## 0.0.1
 

+ 89 - 72
vendor/github.com/dgraph-io/ristretto/v2/README.md

@@ -1,28 +1,32 @@
 # Ristretto
-[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/dgraph-io/ristretto/v2)
-[![ci-ristretto-tests](https://github.com/dgraph-io/ristretto/actions/workflows/ci-ristretto-tests.yml/badge.svg)](https://github.com/dgraph-io/ristretto/actions/workflows/ci-ristretto-tests.yml)
-[![ci-ristretto-lint](https://github.com/dgraph-io/ristretto/actions/workflows/ci-ristretto-lint.yml/badge.svg)](https://github.com/dgraph-io/ristretto/actions/workflows/ci-ristretto-lint.yml)
-[![Coverage Status](https://coveralls.io/repos/github/dgraph-io/ristretto/badge.svg?branch=main)](https://coveralls.io/github/dgraph-io/ristretto?branch=main)
+
+[![GitHub License](https://img.shields.io/github/license/hypermodeinc/ristretto)](https://github.com/hypermodeinc/ristretto?tab=Apache-2.0-1-ov-file#readme)
+[![chat](https://img.shields.io/discord/1267579648657850441)](https://discord.hypermode.com)
+[![GitHub Repo stars](https://img.shields.io/github/stars/hypermodeinc/ristretto)](https://github.com/hypermodeinc/ristretto/stargazers)
+[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/hypermodeinc/ristretto)](https://github.com/hypermodeinc/ristretto/commits/main/)
 [![Go Report Card](https://img.shields.io/badge/go%20report-A%2B-brightgreen)](https://goreportcard.com/report/github.com/dgraph-io/ristretto)
 
 Ristretto is a fast, concurrent cache library built with a focus on performance and correctness.
 
 The motivation to build Ristretto comes from the need for a contention-free cache in [Dgraph][].
 
-[Dgraph]: https://github.com/dgraph-io/dgraph
-
+[Dgraph]: https://github.com/hypermodeinc/dgraph
 
 ## Features
 
-* **High Hit Ratios** - with our unique admission/eviction policy pairing, Ristretto's performance is best in class.
-	* **Eviction: SampledLFU** - on par with exact LRU and better performance on Search and Database traces.
-	* **Admission: TinyLFU** - extra performance with little memory overhead (12 bits per counter).
-* **Fast Throughput** - we use a variety of techniques for managing contention and the result is excellent throughput.
-* **Cost-Based Eviction** - any large new item deemed valuable can evict multiple smaller items (cost could be anything).
-* **Fully Concurrent** - you can use as many goroutines as you want with little throughput degradation.
-* **Metrics** - optional performance metrics for throughput, hit ratios, and other stats.
-* **Simple API** - just figure out your ideal `Config` values and you're off and running.
-
+- **High Hit Ratios** - with our unique admission/eviction policy pairing, Ristretto's performance
+  is best in class.
+  - **Eviction: SampledLFU** - on par with exact LRU and better performance on Search and Database
+    traces.
+  - **Admission: TinyLFU** - extra performance with little memory overhead (12 bits per counter).
+- **Fast Throughput** - we use a variety of techniques for managing contention and the result is
+  excellent throughput.
+- **Cost-Based Eviction** - any large new item deemed valuable can evict multiple smaller items
+  (cost could be anything).
+- **Fully Concurrent** - you can use as many goroutines as you want with little throughput
+  degradation.
+- **Metrics** - optional performance metrics for throughput, hit ratios, and other stats.
+- **Simple API** - just figure out your ideal `Config` values and you're off and running.
 
 ## Status
 
@@ -31,11 +35,14 @@ Ristretto is production-ready. See [Projects using Ristretto](#projects-using-ri
 ## Getting Started
 
 ### Installing
-To start using Ristretto, install Go 1.21 or above. Ristretto needs go modules. From your project, run the following command
+
+To start using Ristretto, install Go 1.21 or above. Ristretto needs go modules. From your project,
+run the following command
 
 ```sh
-$ go get github.com/dgraph-io/ristretto/v2
+go get github.com/dgraph-io/ristretto/v2
 ```
+
 This will retrieve the library.
 
 #### Choosing a version
@@ -43,8 +50,9 @@ This will retrieve the library.
 Following these rules:
 
 - v1.x.x is the first version used in most programs with Ristretto dependencies.
-- v2.x.x is the new version with support for generics, for which it has a slightly different interface. 
-This version is designed to solve compatibility problems of programs using the old version of Ristretto. If you start writing a new program, it is recommended to use this version.
+- v2.x.x is the new version with support for generics, for which it has a slightly different
+  interface. This version is designed to solve compatibility problems of programs using the old
+  version of Ristretto. If you start writing a new program, it is recommended to use this version.
 
 ## Usage
 
@@ -52,61 +60,63 @@ This version is designed to solve compatibility problems of programs using the o
 package main
 
 import (
-	"fmt"
+  "fmt"
 
-	"github.com/dgraph-io/ristretto/v2"
+  "github.com/dgraph-io/ristretto/v2"
 )
 
 func main() {
-	cache, err := ristretto.NewCache(&ristretto.Config[string, string]{
-		NumCounters: 1e7,     // number of keys to track frequency of (10M).
-		MaxCost:     1 << 30, // maximum cost of cache (1GB).
-		BufferItems: 64,      // number of keys per Get buffer.
-	})
-	if err != nil {
-		panic(err)
-	}
-	defer cache.Close()
-
-	// set a value with a cost of 1
-	cache.Set("key", "value", 1)
-
-	// wait for value to pass through buffers
-	cache.Wait()
-
-	// get value from cache
-	value, found := cache.Get("key")
-	if !found {
-		panic("missing value")
-	}
-	fmt.Println(value)
-
-	// del value from cache
-	cache.Del("key")
+  cache, err := ristretto.NewCache(&ristretto.Config[string, string]{
+    NumCounters: 1e7,     // number of keys to track frequency of (10M).
+    MaxCost:     1 << 30, // maximum cost of cache (1GB).
+    BufferItems: 64,      // number of keys per Get buffer.
+  })
+  if err != nil {
+    panic(err)
+  }
+  defer cache.Close()
+
+  // set a value with a cost of 1
+  cache.Set("key", "value", 1)
+
+  // wait for value to pass through buffers
+  cache.Wait()
+
+  // get value from cache
+  value, found := cache.Get("key")
+  if !found {
+    panic("missing value")
+  }
+  fmt.Println(value)
+
+  // del value from cache
+  cache.Del("key")
 }
 ```
 
-
 ## Benchmarks
 
-The benchmarks can be found in https://github.com/dgraph-io/benchmarks/tree/master/cachebench/ristretto.
+The benchmarks can be found in
+https://github.com/hypermodeinc/dgraph-benchmarks/tree/main/cachebench/ristretto.
 
 ### Hit Ratios for Search
 
-This trace is described as "disk read accesses initiated by a large commercial
-search engine in response to various web search requests."
+This trace is described as "disk read accesses initiated by a large commercial search engine in
+response to various web search requests."
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Hit%20Ratios%20-%20Search%20(ARC-S3).svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Hit%20Ratios%20-%20Search%20(ARC-S3).svg"
+  alt="Graph showing hit ratios comparison for search workload">
 </p>
 
 ### Hit Ratio for Database
 
-This trace is described as "a database server running at a commercial site
-running an ERP application on top of a commercial database."
+This trace is described as "a database server running at a commercial site running an ERP
+application on top of a commercial database."
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Hit%20Ratios%20-%20Database%20(ARC-DS1).svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Hit%20Ratios%20-%20Database%20(ARC-DS1).svg"
+  alt="Graph showing hit ratios comparison for database workload">
 </p>
 
 ### Hit Ratio for Looping
@@ -114,7 +124,8 @@ running an ERP application on top of a commercial database."
 This trace demonstrates a looping access pattern.
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Hit%20Ratios%20-%20Glimpse%20(LIRS-GLI).svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Hit%20Ratios%20-%20Glimpse%20(LIRS-GLI).svg"
+  alt="Graph showing hit ratios comparison for looping access pattern">
 </p>
 
 ### Hit Ratio for CODASYL
@@ -122,50 +133,56 @@ This trace demonstrates a looping access pattern.
 This trace is described as "references to a CODASYL database for a one hour period."
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Hit%20Ratios%20-%20CODASYL%20(ARC-OLTP).svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Hit%20Ratios%20-%20CODASYL%20(ARC-OLTP).svg"
+  alt="Graph showing hit ratios comparison for CODASYL workload">
 </p>
 
 ### Throughput for Mixed Workload
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Throughput%20-%20Mixed.svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Throughput%20-%20Mixed.svg"
+  alt="Graph showing throughput comparison for mixed workload">
 </p>
 
 ### Throughput ffor Read Workload
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Throughput%20-%20Read%20(Zipfian).svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Throughput%20-%20Read%20(Zipfian).svg"
+  alt="Graph showing throughput comparison for read workload">
 </p>
 
 ### Through for Write Workload
 
 <p align="center">
-	<img src="https://raw.githubusercontent.com/dgraph-io/ristretto/master/benchmarks/Throughput%20-%20Write%20(Zipfian).svg">
+  <img src="https://raw.githubusercontent.com/hypermodeinc/ristretto/main/benchmarks/Throughput%20-%20Write%20(Zipfian).svg"
+  alt="Graph showing throughput comparison for write workload">
 </p>
 
-
 ## Projects Using Ristretto
 
 Below is a list of known projects that use Ristretto:
 
-- [Badger](https://github.com/dgraph-io/badger) - Embeddable key-value DB in Go
-- [Dgraph](https://github.com/dgraph-io/dgraph) - Horizontally scalable and distributed GraphQL database with a graph backend
-
+- [Badger](https://github.com/hypermodeinc/badger) - Embeddable key-value DB in Go
+- [Dgraph](https://github.com/hypermodeinc/dgraph) - Horizontally scalable and distributed GraphQL
+  database with a graph backend
 
 ## FAQ
 
 ### How are you achieving this performance? What shortcuts are you taking?
 
-We go into detail in the [Ristretto blog post](https://blog.dgraph.io/post/introducing-ristretto-high-perf-go-cache/),
-but in short: our throughput performance can be attributed to a mix of batching and eventual consistency. Our hit ratio
-performance is mostly due to an excellent [admission policy](https://arxiv.org/abs/1512.00727) and SampledLFU eviction policy.
+We go into detail in the
+[Ristretto blog post](https://hypermode.com/blog/introducing-ristretto-high-perf-go-cache/), but in
+short: our throughput performance can be attributed to a mix of batching and eventual consistency.
+Our hit ratio performance is mostly due to an excellent
+[admission policy](https://arxiv.org/abs/1512.00727) and SampledLFU eviction policy.
 
-As for "shortcuts," the only thing Ristretto does that could be construed as one is dropping some Set calls. That means
-a Set call for a new item (updates are guaranteed) isn't guaranteed to make it into the cache. The new item could be
-dropped at two points: when passing through the Set buffer or when passing through the admission policy. However, this
-doesn't affect hit ratios much at all as we expect the most popular items to be Set multiple times and eventually make
-it in the cache.
+As for "shortcuts," the only thing Ristretto does that could be construed as one is dropping some
+Set calls. That means a Set call for a new item (updates are guaranteed) isn't guaranteed to make it
+into the cache. The new item could be dropped at two points: when passing through the Set buffer or
+when passing through the admission policy. However, this doesn't affect hit ratios much at all as we
+expect the most popular items to be Set multiple times and eventually make it in the cache.
 
 ### Is Ristretto distributed?
 
-No, it's just like any other Go library that you can import into your project and use in a single process.
+No, it's just like any other Go library that you can import into your project and use in a single
+process.

+ 10 - 0
vendor/github.com/dgraph-io/ristretto/v2/SECURITY.md

@@ -0,0 +1,10 @@
+# Reporting Security Concerns
+
+We take the security of Ristretto very seriously. If you believe you have found a security vulnerability
+in Ristretto, we encourage you to let us know right away.
+
+We will investigate all legitimate reports and do our best to quickly fix the problem. Please report
+any issues or vulnerabilities via GitHub Security Advisories instead of posting a public issue in
+GitHub. You can also send security communications to security@hypermode.com.
+
+Please include the version identifier and details on how the vulnerability can be exploited.

+ 11 - 23
vendor/github.com/dgraph-io/ristretto/v2/cache.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 // Ristretto is a fast, fixed size, in-memory cache with a dual focus on
@@ -163,7 +152,7 @@ type Config[K Key, V any] struct {
 	// is not set, the default keyToHash function is used.
 	//
 	// Ristretto has a variety of defaults depending on the underlying interface type
-	// https://github.com/dgraph-io/ristretto/blob/master/z/z.go#L19-L41).
+	// https://github.com/hypermodeinc/ristretto/blob/main/z/z.go#L19-L41).
 	//
 	// Note that if you want 128bit hashes you should use the both the values
 	// in the return of the function. If you want to use 64bit hashes, you can
@@ -209,7 +198,7 @@ type Item[V any] struct {
 	Value      V
 	Cost       int64
 	Expiration time.Time
-	wg         *sync.WaitGroup
+	wait       chan struct{}
 }
 
 // NewCache returns a new Cache instance and any configuration errors, if any.
@@ -281,10 +270,9 @@ func (c *Cache[K, V]) Wait() {
 	if c == nil || c.isClosed.Load() {
 		return
 	}
-	wg := &sync.WaitGroup{}
-	wg.Add(1)
-	c.setBuf <- &Item[V]{wg: wg}
-	wg.Wait()
+	wait := make(chan struct{})
+	c.setBuf <- &Item[V]{wait: wait}
+	<-wait
 }
 
 // Get returns the value (if any) and a boolean representing whether the
@@ -460,8 +448,8 @@ loop:
 	for {
 		select {
 		case i := <-c.setBuf:
-			if i.wg != nil {
-				i.wg.Done()
+			if i.wait != nil {
+				close(i.wait)
 				continue
 			}
 			if i.flag != itemUpdate {
@@ -533,8 +521,8 @@ func (c *Cache[K, V]) processItems() {
 	for {
 		select {
 		case i := <-c.setBuf:
-			if i.wg != nil {
-				i.wg.Done()
+			if i.wait != nil {
+				close(i.wait)
 				continue
 			}
 			// Calculate item cost value if new or update.

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/policy.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package ristretto

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/ring.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package ristretto

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/sketch.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package ristretto

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/store.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package ristretto

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/ttl.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package ristretto

+ 2 - 14
vendor/github.com/dgraph-io/ristretto/v2/z/LICENSE

@@ -47,18 +47,6 @@ rtutil.go
 Modifications:
 
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
-

+ 52 - 34
vendor/github.com/dgraph-io/ristretto/v2/z/README.md

@@ -1,41 +1,53 @@
 ## bbloom: a bitset Bloom filter for go/golang
+
 ===
 
-package implements a fast bloom filter with real 'bitset' and JSONMarshal/JSONUnmarshal to store/reload the Bloom filter.
+package implements a fast bloom filter with real 'bitset' and JSONMarshal/JSONUnmarshal to
+store/reload the Bloom filter.
 
-NOTE: the package uses unsafe.Pointer to set and read the bits from the bitset. If you're uncomfortable with using the unsafe package, please consider using my bloom filter package at github.com/AndreasBriese/bloom
+NOTE: the package uses unsafe.Pointer to set and read the bits from the bitset. If you're
+uncomfortable with using the unsafe package, please consider using my bloom filter package at
+github.com/AndreasBriese/bloom
 
 ===
 
-changelog 11/2015: new thread safe methods AddTS(), HasTS(), AddIfNotHasTS() following a suggestion from Srdjan Marinovic (github @a-little-srdjan), who used this to code a bloomfilter cache.
+changelog 11/2015: new thread safe methods AddTS(), HasTS(), AddIfNotHasTS() following a suggestion
+from Srdjan Marinovic (github @a-little-srdjan), who used this to code a bloomfilter cache.
 
-This bloom filter was developed to strengthen a website-log database and was tested and optimized for this log-entry mask: "2014/%02i/%02i %02i:%02i:%02i /info.html".
-Nonetheless bbloom should work with any other form of entries.
+This bloom filter was developed to strengthen a website-log database and was tested and optimized
+for this log-entry mask: "2014/%02i/%02i %02i:%02i:%02i /info.html". Nonetheless bbloom should work
+with any other form of entries.
 
-~~Hash function is a modified Berkeley DB sdbm hash (to optimize for smaller strings). sdbm  http://www.cse.yorku.ca/~oz/hash.html~~
+~~Hash function is a modified Berkeley DB sdbm hash (to optimize for smaller strings). sdbm
+http://www.cse.yorku.ca/~oz/hash.html~~
 
-Found sipHash (SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein.) to be about as fast. sipHash had been ported by Dimtry Chestnyk to Go (github.com/dchest/siphash )
+Found sipHash (SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J.
+Bernstein.) to be about as fast. sipHash had been ported by Dimtry Chestnyk to Go
+(github.com/dchest/siphash )
 
 Minimum hashset size is: 512 ([4]uint64; will be set automatically).
 
-###install
+### install
 
 ```sh
 go get github.com/AndreasBriese/bbloom
 ```
 
-###test
-+ change to folder ../bbloom
-+ create wordlist in file "words.txt" (you might use `python permut.py`)
-+ run 'go test -bench=.' within the folder
+### test
+
+- change to folder ../bbloom
+- create wordlist in file "words.txt" (you might use `python permut.py`)
+- run 'go test -bench=.' within the folder
 
 ```go
 go test -bench=.
 ```
 
-~~If you've installed the GOCONVEY TDD-framework http://goconvey.co/ you can run the tests automatically.~~
+~~If you've installed the GOCONVEY TDD-framework http://goconvey.co/ you can run the tests
+automatically.~~
 
-using go's testing framework now (have in mind that the op timing is related to 65536 operations of Add, Has, AddIfNotHas respectively)
+using go's testing framework now (have in mind that the op timing is related to 65536 operations of
+Add, Has, AddIfNotHas respectively)
 
 ### usage
 
@@ -43,10 +55,10 @@ after installation add
 
 ```go
 import (
-	...
-	"github.com/AndreasBriese/bbloom"
-	...
-	)
+  ...
+  "github.com/AndreasBriese/bbloom"
+  ...
+  )
 ```
 
 at your header. In the program use
@@ -107,23 +119,29 @@ to work with the bloom filter.
 
 ### why 'fast'?
 
-It's about 3 times faster than William Fitzgeralds bitset bloom filter https://github.com/willf/bloom . And it is about so fast as my []bool set variant for Boom filters (see https://github.com/AndreasBriese/bloom ) but having a 8times smaller memory footprint:
-
-
-	Bloom filter (filter size 524288, 7 hashlocs)
-	github.com/AndreasBriese/bbloom 'Add' 65536 items (10 repetitions): 6595800 ns (100 ns/op)
-    github.com/AndreasBriese/bbloom 'Has' 65536 items (10 repetitions): 5986600 ns (91 ns/op)
-	github.com/AndreasBriese/bloom 'Add' 65536 items (10 repetitions): 6304684 ns (96 ns/op)
-	github.com/AndreasBriese/bloom 'Has' 65536 items (10 repetitions): 6568663 ns (100 ns/op)
+It's about 3 times faster than William Fitzgeralds bitset bloom filter
+https://github.com/willf/bloom . And it is about so fast as my []bool set variant for Boom filters
+(see https://github.com/AndreasBriese/bloom ) but having a 8times smaller memory footprint:
 
-	github.com/willf/bloom 'Add' 65536 items (10 repetitions): 24367224 ns (371 ns/op)
-	github.com/willf/bloom 'Test' 65536 items (10 repetitions): 21881142 ns (333 ns/op)
-	github.com/dataence/bloom/standard 'Add' 65536 items (10 repetitions): 23041644 ns (351 ns/op)
-	github.com/dataence/bloom/standard 'Check' 65536 items (10 repetitions): 19153133 ns (292 ns/op)
-	github.com/cabello/bloom 'Add' 65536 items (10 repetitions): 131921507 ns (2012 ns/op)
-	github.com/cabello/bloom 'Contains' 65536 items (10 repetitions): 131108962 ns (2000 ns/op)
+```sh
+Bloom filter (filter size 524288, 7 hashlocs)
+github.com/AndreasBriese/bbloom 'Add' 65536 items (10 repetitions): 6595800 ns (100 ns/op)
+github.com/AndreasBriese/bbloom 'Has' 65536 items (10 repetitions): 5986600 ns (91 ns/op)
+github.com/AndreasBriese/bloom 'Add' 65536 items (10 repetitions): 6304684 ns (96 ns/op)
+github.com/AndreasBriese/bloom 'Has' 65536 items (10 repetitions): 6568663 ns (100 ns/op)
+
+github.com/willf/bloom 'Add' 65536 items (10 repetitions): 24367224 ns (371 ns/op)
+github.com/willf/bloom 'Test' 65536 items (10 repetitions): 21881142 ns (333 ns/op)
+github.com/dataence/bloom/standard 'Add' 65536 items (10 repetitions): 23041644 ns (351 ns/op)
+github.com/dataence/bloom/standard 'Check' 65536 items (10 repetitions): 19153133 ns (292 ns/op)
+github.com/cabello/bloom 'Add' 65536 items (10 repetitions): 131921507 ns (2012 ns/op)
+github.com/cabello/bloom 'Contains' 65536 items (10 repetitions): 131108962 ns (2000 ns/op)
+```
 
 (on MBPro15 OSX10.8.5 i7 4Core 2.4Ghz)
 
-
-With 32bit bloom filters (bloom32) using modified sdbm, bloom32 does hashing with only 2 bit shifts, one xor and one substraction per byte. smdb is about as fast as fnv64a but gives less collisions with the dataset (see mask above). bloom.New(float64(10 * 1<<16),float64(7)) populated with 1<<16 random items from the dataset (see above) and tested against the rest results in less than 0.05% collisions.
+With 32bit bloom filters (bloom32) using modified sdbm, bloom32 does hashing with only 2 bit shifts,
+one xor and one substraction per byte. smdb is about as fast as fnv64a but gives less collisions
+with the dataset (see mask above). bloom.New(float64(10 \* 1<<16),float64(7)) populated with 1<<16
+random items from the dataset (see above) and tested against the rest results in less than 0.05%
+collisions.

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/allocator.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/btree.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 8 - 20
vendor/github.com/dgraph-io/ristretto/v2/z/buffer.go

@@ -1,30 +1,18 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z
 
 import (
 	"encoding/binary"
+	"errors"
 	"fmt"
 	"log"
 	"os"
 	"sort"
 	"sync/atomic"
-
-	"github.com/pkg/errors"
 )
 
 const (
@@ -223,8 +211,8 @@ func (b *Buffer) Grow(n int) {
 	case UseMmap:
 		// Truncate and remap the underlying file.
 		if err := b.mmapFile.Truncate(int64(b.curSz)); err != nil {
-			err = errors.Wrapf(err,
-				"while trying to truncate file: %s to size: %d", b.mmapFile.Fd.Name(), b.curSz)
+			err = errors.Join(err,
+				fmt.Errorf("while trying to truncate file: %s to size: %d", b.mmapFile.Fd.Name(), b.curSz))
 			panic(err)
 		}
 		b.buf = b.mmapFile.Data
@@ -348,7 +336,7 @@ func (s *sortHelper) sortSmall(start, end int) {
 
 func assert(b bool) {
 	if !b {
-		log.Fatalf("%+v", errors.Errorf("Assertion failure"))
+		log.Fatalf("%+v", errors.New("Assertion failure"))
 	}
 }
 func check(err error) {
@@ -534,11 +522,11 @@ func (b *Buffer) Release() error {
 		}
 		path := b.mmapFile.Fd.Name()
 		if err := b.mmapFile.Close(-1); err != nil {
-			return errors.Wrapf(err, "while closing file: %s", path)
+			return errors.Join(err, fmt.Errorf("while closing file: %s", path))
 		}
 		if !b.persistent {
 			if err := os.Remove(path); err != nil {
-				return errors.Wrapf(err, "while deleting file %s", path)
+				return errors.Join(err, fmt.Errorf("while deleting file %s", path))
 			}
 		}
 	}

+ 5 - 0
vendor/github.com/dgraph-io/ristretto/v2/z/calloc.go

@@ -1,3 +1,8 @@
+/*
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
 package z
 
 import "sync/atomic"

+ 2 - 1
vendor/github.com/dgraph-io/ristretto/v2/z/calloc_32bit.go

@@ -2,7 +2,8 @@
 // of this source code is governed by a BSD-style license that can be found in
 // the LICENSE file.
 
-// +build 386 amd64p32 arm armbe  mips mipsle mips64p32 mips64p32le ppc sparc
+//go:build 386 || amd64p32 || arm || armbe || mips || mipsle || mips64p32 || mips64p32le || ppc || sparc
+// +build 386 amd64p32 arm armbe mips mipsle mips64p32 mips64p32le ppc sparc
 
 package z
 

+ 2 - 1
vendor/github.com/dgraph-io/ristretto/v2/z/calloc_jemalloc.go

@@ -2,6 +2,7 @@
 // of this source code is governed by a BSD-style license that can be found in
 // the LICENSE file.
 
+//go:build jemalloc
 // +build jemalloc
 
 package z
@@ -161,7 +162,7 @@ func fetchStat(s string) uint64 {
 		unsafe.Pointer(&out),             // Variable to store the output.
 		(*C.size_t)(unsafe.Pointer(&sz)), // Size of the output variable.
 		nil,                              // Input variable used to set a value.
-		0) // Size of the input variable.
+		0)                                // Size of the input variable.
 	return out
 }
 

+ 10 - 22
vendor/github.com/dgraph-io/ristretto/v2/z/file.go

@@ -1,29 +1,17 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z
 
 import (
 	"encoding/binary"
+	"errors"
 	"fmt"
 	"io"
 	"os"
 	"path/filepath"
-
-	"github.com/pkg/errors"
 )
 
 // MmapFile represents an mmapd file and includes both the buffer to the data
@@ -39,7 +27,7 @@ func OpenMmapFileUsing(fd *os.File, sz int, writable bool) (*MmapFile, error) {
 	filename := fd.Name()
 	fi, err := fd.Stat()
 	if err != nil {
-		return nil, errors.Wrapf(err, "cannot stat file: %s", filename)
+		return nil, errors.Join(err, fmt.Errorf("cannot stat file: %s", filename))
 	}
 
 	var rerr error
@@ -47,7 +35,7 @@ func OpenMmapFileUsing(fd *os.File, sz int, writable bool) (*MmapFile, error) {
 	if sz > 0 && fileSize == 0 {
 		// If file is empty, truncate it to sz.
 		if err := fd.Truncate(int64(sz)); err != nil {
-			return nil, errors.Wrapf(err, "error while truncation")
+			return nil, errors.Join(err, errors.New("error while truncation"))
 		}
 		fileSize = int64(sz)
 		rerr = NewFile
@@ -56,7 +44,7 @@ func OpenMmapFileUsing(fd *os.File, sz int, writable bool) (*MmapFile, error) {
 	// fmt.Printf("Mmaping file: %s with writable: %v filesize: %d\n", fd.Name(), writable, fileSize)
 	buf, err := Mmap(fd, writable, fileSize) // Mmap up to file size.
 	if err != nil {
-		return nil, errors.Wrapf(err, "while mmapping %s with size: %d", fd.Name(), fileSize)
+		return nil, errors.Join(err, fmt.Errorf("while mmapping %s with size: %d", fd.Name(), fileSize))
 	}
 
 	if fileSize == 0 {
@@ -79,7 +67,7 @@ func OpenMmapFile(filename string, flag int, maxSz int) (*MmapFile, error) {
 	// fmt.Printf("opening file %s with flag: %v\n", filename, flag)
 	fd, err := os.OpenFile(filename, flag, 0666)
 	if err != nil {
-		return nil, errors.Wrapf(err, "unable to open: %s", filename)
+		return nil, errors.Join(err, fmt.Errorf("unable to open: %s", filename))
 	}
 	writable := true
 	if flag == os.O_RDONLY {
@@ -207,13 +195,13 @@ func (m *MmapFile) Close(maxSz int64) error {
 func SyncDir(dir string) error {
 	df, err := os.Open(dir)
 	if err != nil {
-		return errors.Wrapf(err, "while opening %s", dir)
+		return errors.Join(err, fmt.Errorf("while opening %s", dir))
 	}
 	if err := df.Sync(); err != nil {
-		return errors.Wrapf(err, "while syncing %s", dir)
+		return errors.Join(err, fmt.Errorf("while syncing %s", dir))
 	}
 	if err := df.Close(); err != nil {
-		return errors.Wrapf(err, "while closing %s", dir)
+		return errors.Join(err, fmt.Errorf("while closing %s", dir))
 	}
 	return nil
 }

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/file_default.go

@@ -2,19 +2,8 @@
 // +build !linux
 
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/file_linux.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 18 - 19
vendor/github.com/dgraph-io/ristretto/v2/z/flags.go

@@ -1,6 +1,12 @@
+/*
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
 package z
 
 import (
+	"errors"
 	"fmt"
 	"log"
 	"os"
@@ -10,8 +16,6 @@ import (
 	"strconv"
 	"strings"
 	"time"
-
-	"github.com/pkg/errors"
 )
 
 // SuperFlagHelp makes it really easy to generate command line `--help` output for a SuperFlag. For
@@ -204,9 +208,8 @@ func (sf *SuperFlag) GetBool(opt string) bool {
 	}
 	b, err := strconv.ParseBool(val)
 	if err != nil {
-		err = errors.Wrapf(err,
-			"Unable to parse %s as bool for key: %s. Options: %s\n",
-			val, opt, sf)
+		err = errors.Join(err,
+			fmt.Errorf("Unable to parse %s as bool for key: %s. Options: %s\n", val, opt, sf))
 		log.Fatalf("%+v", err)
 	}
 	return b
@@ -219,9 +222,8 @@ func (sf *SuperFlag) GetFloat64(opt string) float64 {
 	}
 	f, err := strconv.ParseFloat(val, 64)
 	if err != nil {
-		err = errors.Wrapf(err,
-			"Unable to parse %s as float64 for key: %s. Options: %s\n",
-			val, opt, sf)
+		err = errors.Join(err,
+			fmt.Errorf("Unable to parse %s as float64 for key: %s. Options: %s\n", val, opt, sf))
 		log.Fatalf("%+v", err)
 	}
 	return f
@@ -234,9 +236,8 @@ func (sf *SuperFlag) GetInt64(opt string) int64 {
 	}
 	i, err := strconv.ParseInt(val, 0, 64)
 	if err != nil {
-		err = errors.Wrapf(err,
-			"Unable to parse %s as int64 for key: %s. Options: %s\n",
-			val, opt, sf)
+		err = errors.Join(err,
+			fmt.Errorf("Unable to parse %s as int64 for key: %s. Options: %s\n", val, opt, sf))
 		log.Fatalf("%+v", err)
 	}
 	return i
@@ -249,9 +250,8 @@ func (sf *SuperFlag) GetUint64(opt string) uint64 {
 	}
 	u, err := strconv.ParseUint(val, 0, 64)
 	if err != nil {
-		err = errors.Wrapf(err,
-			"Unable to parse %s as uint64 for key: %s. Options: %s\n",
-			val, opt, sf)
+		err = errors.Join(err,
+			fmt.Errorf("Unable to parse %s as uint64 for key: %s. Options: %s\n", val, opt, sf))
 		log.Fatalf("%+v", err)
 	}
 	return u
@@ -264,9 +264,8 @@ func (sf *SuperFlag) GetUint32(opt string) uint32 {
 	}
 	u, err := strconv.ParseUint(val, 0, 32)
 	if err != nil {
-		err = errors.Wrapf(err,
-			"Unable to parse %s as uint32 for key: %s. Options: %s\n",
-			val, opt, sf)
+		err = errors.Join(err,
+			fmt.Errorf("Unable to parse %s as uint32 for key: %s. Options: %s\n", val, opt, sf))
 		log.Fatalf("%+v", err)
 	}
 	return uint32(u)
@@ -297,7 +296,7 @@ func expandPath(path string) (string, error) {
 	if path[0] == '~' && (len(path) == 1 || os.IsPathSeparator(path[1])) {
 		usr, err := user.Current()
 		if err != nil {
-			return "", errors.Wrap(err, "Failed to get the home directory of the user")
+			return "", errors.Join(err, errors.New("Failed to get the home directory of the user"))
 		}
 		path = filepath.Join(usr.HomeDir, path[1:])
 	}
@@ -305,7 +304,7 @@ func expandPath(path string) (string, error) {
 	var err error
 	path, err = filepath.Abs(path)
 	if err != nil {
-		return "", errors.Wrap(err, "Failed to generate absolute path")
+		return "", errors.Join(err, errors.New("Failed to generate absolute path"))
 	}
 	return path, nil
 }

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/histogram.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_darwin.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_js.go

@@ -1,19 +1,8 @@
 //go:build js
 
 /*
- * Copyright 2023 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_linux.go

@@ -2,19 +2,8 @@
 // +build !js
 
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_plan9.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_unix.go

@@ -2,19 +2,8 @@
 // +build !windows,!darwin,!plan9,!linux,!wasip1,!js
 
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_wasip1.go

@@ -1,19 +1,8 @@
 //go:build wasip1
 
 /*
- * Copyright 2023 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 3 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mmap_windows.go

@@ -1,19 +1,9 @@
+//go:build windows
 // +build windows
 
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mremap_nosize.go

@@ -4,19 +4,8 @@
 // +build !js
 
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/mremap_size.go

@@ -2,19 +2,8 @@
 // +build linux,!arm64,!arm,!js
 
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 5 - 0
vendor/github.com/dgraph-io/ristretto/v2/z/simd/baseline.go

@@ -1,3 +1,8 @@
+/*
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
 package simd
 
 import (

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/simd/search.go

@@ -2,19 +2,8 @@
 // +build !amd64
 
 /*
- * Copyright 2020 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package simd

+ 2 - 13
vendor/github.com/dgraph-io/ristretto/v2/z/z.go

@@ -1,17 +1,6 @@
 /*
- * Copyright 2019 Dgraph Labs, Inc. and Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
+ * SPDX-License-Identifier: Apache-2.0
  */
 
 package z

+ 9 - 7
vendor/github.com/go-logr/logr/.golangci.yaml

@@ -1,26 +1,28 @@
+version: "2"
+
 run:
   timeout: 1m
   tests: true
 
 linters:
-  disable-all: true
-  enable:
+  default: none
+  enable: # please keep this alphabetized
+    - asasalint
     - asciicheck
+    - copyloopvar
+    - dupl
     - errcheck
     - forcetypeassert
+    - goconst
     - gocritic
-    - gofmt
-    - goimports
-    - gosimple
     - govet
     - ineffassign
     - misspell
+    - musttag
     - revive
     - staticcheck
-    - typecheck
     - unused
 
 issues:
-  exclude-use-default: false
   max-issues-per-linter: 0
   max-same-issues: 10

+ 4 - 4
vendor/github.com/go-logr/logr/funcr/funcr.go

@@ -77,7 +77,7 @@ func newSink(fn func(prefix, args string), formatter Formatter) logr.LogSink {
 		write:     fn,
 	}
 	// For skipping fnlogger.Info and fnlogger.Error.
-	l.Formatter.AddCallDepth(1)
+	l.AddCallDepth(1) // via Formatter
 	return l
 }
 
@@ -164,17 +164,17 @@ type fnlogger struct {
 }
 
 func (l fnlogger) WithName(name string) logr.LogSink {
-	l.Formatter.AddName(name)
+	l.AddName(name) // via Formatter
 	return &l
 }
 
 func (l fnlogger) WithValues(kvList ...any) logr.LogSink {
-	l.Formatter.AddValues(kvList)
+	l.AddValues(kvList) // via Formatter
 	return &l
 }
 
 func (l fnlogger) WithCallDepth(depth int) logr.LogSink {
-	l.Formatter.AddCallDepth(depth)
+	l.AddCallDepth(depth) // via Formatter
 	return &l
 }
 

+ 7 - 0
vendor/github.com/gofiber/fiber/v2/.golangci.yml

@@ -15,6 +15,11 @@ linters-settings:
      check-type-assertions: true
      check-blank: true
      disable-default-exclusions: true
+     exclude-functions:
+       - '(*bytes.Buffer).Write' # always returns nil error
+       - '(*github.com/valyala/bytebufferpool.ByteBuffer).Write' # always returns nil error
+       - '(*github.com/valyala/bytebufferpool.ByteBuffer).WriteByte' # always returns nil error
+       - '(*github.com/valyala/bytebufferpool.ByteBuffer).WriteString' # always returns nil error
 
   errchkjson:
     report-no-exported: true
@@ -39,6 +44,8 @@ linters-settings:
     extra-rules: true
 
   gosec:
+    excludes:
+      - G104 # TODO: Enable this again. Mostly provided by errcheck
     config:
       global:
         audit: true

+ 44 - 0
vendor/github.com/gofiber/fiber/v2/AGENTS.md

@@ -0,0 +1,44 @@
+# AGENTS.md
+
+## Agent Instructions
+
+> **Note for the AI agent:** Before running the startup script, verify that all dependencies and CLI tools are already available. If a `vendor/` directory exists **or** `go list -m -mod=readonly all` succeeds (indicating modules are cached), you may skip the entire startup script—including all `go mod` commands and `go install` steps. Otherwise run the script as listed below.
+
+---
+
+## Startup script (reference only – do not run)
+
+- Fetch dependencies:
+
+  ```bash
+  go mod tidy && go mod download && go mod vendor
+  ```
+
+- Install CLI tools referenced in Makefile:
+
+  ```bash
+  go install gotest.tools/gotestsum@latest                 # test runner
+  go install golang.org/x/vuln/cmd/govulncheck@latest      # vulnerability scanner
+  go install mvdan.cc/gofumpt@latest                       # code formatter
+  go install github.com/tinylib/msgp@latest                # msgp codegen
+  go install github.com/vburenin/ifacemaker@975a95966976eeb2d4365a7fb236e274c54da64c  # interface impls
+  go install github.com/dkorunic/betteralign/cmd/betteralign@latest  # struct alignment
+  go mod tidy                                              # clean up go.mod & go.sum
+  ```
+
+## Makefile commands
+
+Use `make help` to list all available commands. Common targets include:
+
+- **audit**: run `go mod verify`, `go vet`, and `govulncheck` for quality checks.
+- **benchmark**: run benchmarks with `go test`.
+- **coverage**: generate a coverage report.
+- **format**: apply formatting using `gofumpt`.
+- **lint**: execute `golangci-lint`.
+- **test**: run the test suite with `gotestsum`.
+- **longtest**: run the test suite 15 times with shuffling enabled.
+- **tidy**: clean and tidy dependencies.
+- **betteralign**: optimize struct field alignment.
+- **generate**: run `go generate` after installing msgp and ifacemaker.
+
+These targets can be invoked via `make <target>` as needed during development and testing.

+ 1 - 3
vendor/github.com/gofiber/fiber/v2/app.go

@@ -30,7 +30,7 @@ import (
 )
 
 // Version of current fiber package
-const Version = "2.52.6"
+const Version = "2.52.9"
 
 // Handler defines a function to serve HTTP requests.
 type Handler = func(*Ctx) error
@@ -93,8 +93,6 @@ type App struct {
 	treeStack []map[string][]*Route
 	// contains the information if the route stack has been changed to build the optimized tree
 	routesRefreshed bool
-	// Amount of registered routes
-	routesCount uint32
 	// Amount of registered handlers
 	handlersCount uint32
 	// Ctx pool

+ 70 - 41
vendor/github.com/gofiber/fiber/v2/ctx.go

@@ -394,7 +394,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
 	if strings.HasSuffix(ctype, "json") {
 		return c.app.config.JSONDecoder(c.Body(), out)
 	}
-	if strings.HasPrefix(ctype, MIMEApplicationForm) {
+	if ctype == MIMEApplicationForm {
 		data := make(map[string][]string)
 		var err error
 
@@ -415,7 +415,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
 
 		return c.parseToStruct(bodyTag, out, data)
 	}
-	if strings.HasPrefix(ctype, MIMEMultipartForm) {
+	if ctype == MIMEMultipartForm {
 		multipartForm, err := c.fasthttp.MultipartForm()
 		if err != nil {
 			return err
@@ -431,7 +431,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
 
 		return c.parseToStruct(bodyTag, out, data)
 	}
-	if strings.HasPrefix(ctype, MIMETextXML) || strings.HasPrefix(ctype, MIMEApplicationXML) {
+	if ctype == MIMETextXML || ctype == MIMEApplicationXML {
 		if err := xml.Unmarshal(c.Body(), out); err != nil {
 			return fmt.Errorf("failed to unmarshal: %w", err)
 		}
@@ -877,10 +877,12 @@ func (c *Ctx) Is(extension string) bool {
 		return false
 	}
 
-	return strings.HasPrefix(
-		utils.TrimLeft(c.app.getString(c.fasthttp.Request.Header.ContentType()), ' '),
-		extensionHeader,
-	)
+	ct := c.app.getString(c.fasthttp.Request.Header.ContentType())
+	if i := strings.IndexByte(ct, ';'); i != -1 {
+		ct = ct[:i]
+	}
+	ct = utils.Trim(ct, ' ')
+	return utils.EqualFold(ct, extensionHeader)
 }
 
 // JSON converts any interface or string to JSON.
@@ -948,11 +950,11 @@ func (c *Ctx) Links(link ...string) {
 	bb := bytebufferpool.Get()
 	for i := range link {
 		if i%2 == 0 {
-			_ = bb.WriteByte('<')          //nolint:errcheck // This will never fail
-			_, _ = bb.WriteString(link[i]) //nolint:errcheck // This will never fail
-			_ = bb.WriteByte('>')          //nolint:errcheck // This will never fail
+			_ = bb.WriteByte('<')
+			_, _ = bb.WriteString(link[i])
+			_ = bb.WriteByte('>')
 		} else {
-			_, _ = bb.WriteString(`; rel="` + link[i] + `",`) //nolint:errcheck // This will never fail
+			_, _ = bb.WriteString(`; rel="` + link[i] + `",`)
 		}
 	}
 	c.setCanonical(HeaderLink, utils.TrimRight(c.app.getString(bb.Bytes()), ','))
@@ -1326,43 +1328,44 @@ func (*Ctx) parseToStruct(aliasTag string, out interface{}, data map[string][]st
 }
 
 func equalFieldType(out interface{}, kind reflect.Kind, key, tag string) bool {
-	// Get type of interface
 	outTyp := reflect.TypeOf(out).Elem()
-	key = utils.ToLower(key)
-	// Must be a struct to match a field
 	if outTyp.Kind() != reflect.Struct {
 		return false
 	}
-	// Copy interface to an value to be used
-	outVal := reflect.ValueOf(out).Elem()
-	// Loop over each field
+	key = utils.ToLower(key)
+	return checkEqualFieldType(outTyp, kind, key, tag)
+}
+
+func checkEqualFieldType(outTyp reflect.Type, kind reflect.Kind, key, tag string) bool {
 	for i := 0; i < outTyp.NumField(); i++ {
-		// Get field value data
-		structField := outVal.Field(i)
-		// Can this field be changed?
-		if !structField.CanSet() {
+		typeField := outTyp.Field(i)
+
+		if typeField.Anonymous && typeField.Type.Kind() == reflect.Struct {
+			if checkEqualFieldType(typeField.Type, kind, key, tag) {
+				return true
+			}
+		}
+
+		if typeField.PkgPath != "" { // unexported field
 			continue
 		}
-		// Get field key data
-		typeField := outTyp.Field(i)
-		// Get type of field key
-		structFieldKind := structField.Kind()
-		// Does the field type equals input?
-		if structFieldKind != kind {
+
+		if typeField.Type.Kind() != kind {
 			continue
 		}
-		// Get tag from field if exist
+
 		inputFieldName := typeField.Tag.Get(tag)
 		if inputFieldName == "" {
 			inputFieldName = typeField.Name
-		} else {
-			inputFieldName = strings.Split(inputFieldName, ",")[0]
+		} else if idx := strings.IndexByte(inputFieldName, ','); idx > -1 {
+			inputFieldName = inputFieldName[:idx]
 		}
-		// Compare field/tag with provided key
+
 		if utils.ToLower(inputFieldName) == key {
 			return true
 		}
 	}
+
 	return false
 }
 
@@ -1510,10 +1513,10 @@ func (c *Ctx) RedirectToRoute(routeName string, params Map, status ...int) error
 
 		i := 1
 		for k, v := range queries {
-			_, _ = queryText.WriteString(k + "=" + v) //nolint:errcheck // This will never fail
+			_, _ = queryText.WriteString(k + "=" + v)
 
 			if i != len(queries) {
-				_, _ = queryText.WriteString("&") //nolint:errcheck // This will never fail
+				_, _ = queryText.WriteString("&")
 			}
 			i++
 		}
@@ -1834,14 +1837,40 @@ func (c *Ctx) Status(status int) *Ctx {
 //
 // The returned value may be useful for logging.
 func (c *Ctx) String() string {
-	return fmt.Sprintf(
-		"#%016X - %s <-> %s - %s %s",
-		c.fasthttp.ID(),
-		c.fasthttp.LocalAddr(),
-		c.fasthttp.RemoteAddr(),
-		c.fasthttp.Request.Header.Method(),
-		c.fasthttp.URI().FullURI(),
-	)
+	// Get buffer from pool
+	buf := bytebufferpool.Get()
+
+	// Start with the ID, converting it to a hex string without fmt.Sprintf
+	buf.WriteByte('#')
+
+	// Convert ID to hexadecimal
+	id := strconv.FormatUint(c.fasthttp.ID(), 16)
+	// Pad with leading zeros to ensure 16 characters
+	for i := 0; i < (16 - len(id)); i++ {
+		buf.WriteByte('0')
+	}
+	buf.WriteString(id)
+	buf.WriteString(" - ")
+
+	// Add local and remote addresses directly
+	buf.WriteString(c.fasthttp.LocalAddr().String())
+	buf.WriteString(" <-> ")
+	buf.WriteString(c.fasthttp.RemoteAddr().String())
+	buf.WriteString(" - ")
+
+	// Add method and URI
+	buf.Write(c.fasthttp.Request.Header.Method())
+	buf.WriteByte(' ')
+	buf.Write(c.fasthttp.URI().FullURI())
+
+	// Allocate string
+	str := buf.String()
+
+	// Reset buffer
+	buf.Reset()
+	bytebufferpool.Put(buf)
+
+	return str
 }
 
 // Type sets the Content-Type HTTP header to the MIME type specified by the file extension.

+ 9 - 1
vendor/github.com/gofiber/fiber/v2/internal/schema/cache.go

@@ -12,7 +12,12 @@ import (
 	"sync"
 )
 
-var errInvalidPath = errors.New("schema: invalid path")
+const maxParserIndex = 1000
+
+var (
+	errInvalidPath   = errors.New("schema: invalid path")
+	errIndexTooLarge = errors.New("schema: index exceeds parser limit")
+)
 
 // newCache returns a new cache.
 func newCache() *cache {
@@ -77,6 +82,9 @@ func (c *cache) parsePath(p string, t reflect.Type) ([]pathPart, error) {
 			if index64, err = strconv.ParseInt(keys[i], 10, 0); err != nil {
 				return nil, errInvalidPath
 			}
+			if index64 > maxParserIndex {
+				return nil, errIndexTooLarge
+			}
 			parts = append(parts, pathPart{
 				path:  path,
 				field: field,

+ 20 - 3
vendor/github.com/gofiber/fiber/v2/internal/schema/decoder.go

@@ -67,11 +67,24 @@ func (d *Decoder) RegisterConverter(value interface{}, converterFunc Converter)
 // Keys are "paths" in dotted notation to the struct fields and nested structs.
 //
 // See the package documentation for a full explanation of the mechanics.
-func (d *Decoder) Decode(dst interface{}, src map[string][]string) error {
+func (d *Decoder) Decode(dst interface{}, src map[string][]string) (err error) {
 	v := reflect.ValueOf(dst)
 	if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct {
 		return errors.New("schema: interface must be a pointer to struct")
 	}
+
+	// Catch panics from the decoder and return them as an error.
+	// This is needed because the decoder calls reflect and reflect panics
+	defer func() {
+		if r := recover(); r != nil {
+			if e, ok := r.(error); ok {
+				err = e
+			} else {
+				err = fmt.Errorf("schema: panic while decoding: %v", r)
+			}
+		}
+	}()
+
 	v = v.Elem()
 	t := v.Type()
 	multiError := MultiError{}
@@ -80,8 +93,12 @@ func (d *Decoder) Decode(dst interface{}, src map[string][]string) error {
 			if err = d.decode(v, path, parts, values); err != nil {
 				multiError[path] = err
 			}
-		} else if !d.ignoreUnknownKeys {
-			multiError[path] = UnknownKeyError{Key: path}
+		} else {
+			if errors.Is(err, errIndexTooLarge) {
+				multiError[path] = err
+			} else if !d.ignoreUnknownKeys {
+				multiError[path] = UnknownKeyError{Key: path}
+			}
 		}
 	}
 	multiError.merge(d.checkRequired(t, src))

+ 5 - 5
vendor/github.com/gofiber/fiber/v2/log/default.go

@@ -27,8 +27,8 @@ func (l *defaultLogger) privateLog(lv Level, fmtArgs []interface{}) {
 	}
 	level := lv.toString()
 	buf := bytebufferpool.Get()
-	_, _ = buf.WriteString(level)                  //nolint:errcheck // It is fine to ignore the error
-	_, _ = buf.WriteString(fmt.Sprint(fmtArgs...)) //nolint:errcheck // It is fine to ignore the error
+	_, _ = buf.WriteString(level)
+	_, _ = buf.WriteString(fmt.Sprint(fmtArgs...))
 
 	_ = l.stdlog.Output(l.depth, buf.String()) //nolint:errcheck // It is fine to ignore the error
 	buf.Reset()
@@ -46,7 +46,7 @@ func (l *defaultLogger) privateLogf(lv Level, format string, fmtArgs []interface
 	}
 	level := lv.toString()
 	buf := bytebufferpool.Get()
-	_, _ = buf.WriteString(level) //nolint:errcheck // It is fine to ignore the error
+	_, _ = buf.WriteString(level)
 
 	if len(fmtArgs) > 0 {
 		_, _ = fmt.Fprintf(buf, format, fmtArgs...)
@@ -69,11 +69,11 @@ func (l *defaultLogger) privateLogw(lv Level, format string, keysAndValues []int
 	}
 	level := lv.toString()
 	buf := bytebufferpool.Get()
-	_, _ = buf.WriteString(level) //nolint:errcheck // It is fine to ignore the error
+	_, _ = buf.WriteString(level)
 
 	// Write format privateLog buffer
 	if format != "" {
-		_, _ = buf.WriteString(format) //nolint:errcheck // It is fine to ignore the error
+		_, _ = buf.WriteString(format)
 	}
 	var once sync.Once
 	isFirst := true

+ 0 - 8
vendor/github.com/gofiber/fiber/v2/mount.go

@@ -174,7 +174,6 @@ func (app *App) processSubAppsRoutes() {
 		}
 	}
 	var handlersCount uint32
-	var routePos uint32
 	// Iterate over the stack of the parent app
 	for m := range app.stack {
 		// Iterate over each route in the stack
@@ -183,9 +182,6 @@ func (app *App) processSubAppsRoutes() {
 			route := app.stack[m][i]
 			// Check if the route has a mounted app
 			if !route.mount {
-				routePos++
-				// If not, update the route's position and continue
-				route.pos = routePos
 				if !route.use || (route.use && m == 0) {
 					handlersCount += uint32(len(route.Handlers))
 				}
@@ -214,11 +210,7 @@ func (app *App) processSubAppsRoutes() {
 			copy(newStack[i+len(subRoutes):], app.stack[m][i+1:])
 			app.stack[m] = newStack
 
-			// Decrease the parent app's route count to account for the mounted app's original route
-			atomic.AddUint32(&app.routesCount, ^uint32(0))
 			i--
-			// Increase the parent app's route count to account for the sub-app's routes
-			atomic.AddUint32(&app.routesCount, uint32(len(subRoutes)))
 
 			// Mark the parent app's routes as refreshed
 			app.routesRefreshed = true

+ 58 - 42
vendor/github.com/gofiber/fiber/v2/router.go

@@ -7,7 +7,6 @@ package fiber
 import (
 	"fmt"
 	"html"
-	"sort"
 	"strconv"
 	"strings"
 	"sync/atomic"
@@ -47,9 +46,8 @@ type Router interface {
 
 // Route is a struct that holds all metadata for each registered handler.
 type Route struct {
-	// ### important: always keep in sync with the copy method "app.copyRoute" ###
+	// ### important: always keep in sync with the copy method "app.copyRoute" and all creations of Route struct ###
 	// Data for routing
-	pos         uint32      // Position in stack -> important for the sort of the matched routes
 	use         bool        // USE matches path prefixes
 	mount       bool        // Indicated a mounted app on a specific route
 	star        bool        // Path equals '*'
@@ -215,9 +213,6 @@ func (*App) copyRoute(route *Route) *Route {
 		path:        route.path,
 		routeParser: route.routeParser,
 
-		// misc
-		pos: route.pos,
-
 		// Public data
 		Path:     route.Path,
 		Params:   route.Params,
@@ -298,11 +293,11 @@ func (app *App) register(method, pathRaw string, group *Group, handlers ...Handl
 		for _, m := range app.config.RequestMethods {
 			// Create a route copy to avoid duplicates during compression
 			r := route
-			app.addRoute(m, &r, isMount)
+			app.addRoute(m, &r)
 		}
 	} else {
 		// Add route to stack
-		app.addRoute(method, &route, isMount)
+		app.addRoute(method, &route)
 	}
 }
 
@@ -428,12 +423,20 @@ func (app *App) registerStatic(prefix, root string, config ...Static) {
 	// Create route metadata without pointer
 	route := Route{
 		// Router booleans
-		use:  true,
-		root: isRoot,
+		use:   true,
+		mount: false,
+		star:  isStar,
+		root:  isRoot,
+
+		// Path data
 		path: prefix,
+
+		// Group data
+		group: nil,
+
 		// Public data
-		Method:   MethodGet,
 		Path:     prefix,
+		Method:   MethodGet,
 		Handlers: []Handler{handler},
 	}
 	// Increment global handler count
@@ -444,13 +447,7 @@ func (app *App) registerStatic(prefix, root string, config ...Static) {
 	app.addRoute(MethodHead, &route)
 }
 
-func (app *App) addRoute(method string, route *Route, isMounted ...bool) {
-	// Check mounted routes
-	var mounted bool
-	if len(isMounted) > 0 {
-		mounted = isMounted[0]
-	}
-
+func (app *App) addRoute(method string, route *Route) {
 	// Get unique HTTP method identifier
 	m := app.methodInt(method)
 
@@ -460,8 +457,6 @@ func (app *App) addRoute(method string, route *Route, isMounted ...bool) {
 		preRoute := app.stack[m][l-1]
 		preRoute.Handlers = append(preRoute.Handlers, route.Handlers...)
 	} else {
-		// Increment global route position
-		route.pos = atomic.AddUint32(&app.routesCount, 1)
 		route.Method = method
 		// Add route to the stack
 		app.stack[m] = append(app.stack[m], route)
@@ -469,7 +464,7 @@ func (app *App) addRoute(method string, route *Route, isMounted ...bool) {
 	}
 
 	// Execute onRoute hooks & change latestRoute if not adding mounted route
-	if !mounted {
+	if !route.mount {
 		app.mutex.Lock()
 		app.latestRoute = route
 		if err := app.hooks.executeOnRouteHooks(*route); err != nil {
@@ -481,38 +476,59 @@ func (app *App) addRoute(method string, route *Route, isMounted ...bool) {
 
 // buildTree build the prefix tree from the previously registered routes
 func (app *App) buildTree() *App {
+	// If routes haven't been refreshed, nothing to do
 	if !app.routesRefreshed {
 		return app
 	}
 
-	// loop all the methods and stacks and create the prefix tree
-	for m := range app.config.RequestMethods {
-		tsMap := make(map[string][]*Route)
-		for _, route := range app.stack[m] {
-			treePath := ""
+	// 1) First loop: determine all possible 3-char prefixes ("treePaths") for each method
+	for method := range app.config.RequestMethods {
+		prefixSet := map[string]struct{}{
+			"": {},
+		}
+		for _, route := range app.stack[method] {
 			if len(route.routeParser.segs) > 0 && len(route.routeParser.segs[0].Const) >= 3 {
-				treePath = route.routeParser.segs[0].Const[:3]
+				prefix := route.routeParser.segs[0].Const[:3]
+				prefixSet[prefix] = struct{}{}
 			}
-			// create tree stack
-			tsMap[treePath] = append(tsMap[treePath], route)
 		}
-		app.treeStack[m] = tsMap
-	}
+		tsMap := make(map[string][]*Route, len(prefixSet))
+		for prefix := range prefixSet {
+			tsMap[prefix] = nil
+		}
+		app.treeStack[method] = tsMap
+	}
+
+	// 2) Second loop: for each method and each discovered treePath, assign matching routes
+	for method := range app.config.RequestMethods {
+		// get the map of buckets for this method
+		tsMap := app.treeStack[method]
+
+		// for every treePath key (including the empty one)
+		for treePath := range tsMap {
+			// iterate all routes of this method
+			for _, route := range app.stack[method] {
+				// compute this route's own prefix ("" or first 3 chars)
+				routePath := ""
+				if len(route.routeParser.segs) > 0 && len(route.routeParser.segs[0].Const) >= 3 {
+					routePath = route.routeParser.segs[0].Const[:3]
+				}
 
-	// loop the methods and tree stacks and add global stack and sort everything
-	for m := range app.config.RequestMethods {
-		tsMap := app.treeStack[m]
-		for treePart := range tsMap {
-			if treePart != "" {
-				// merge global tree routes in current tree stack
-				tsMap[treePart] = uniqueRouteStack(append(tsMap[treePart], tsMap[""]...))
+				// if it's a global route, assign to every bucket
+				if routePath == "" {
+					tsMap[treePath] = append(tsMap[treePath], route)
+					// otherwise only assign if this route's prefix matches the current bucket's key
+				} else if routePath == treePath {
+					tsMap[treePath] = append(tsMap[treePath], route)
+				}
 			}
-			// sort tree slices with the positions
-			slc := tsMap[treePart]
-			sort.Slice(slc, func(i, j int) bool { return slc[i].pos < slc[j].pos })
+
+			// after collecting, dedupe the bucket if it's not the global one
+			tsMap[treePath] = uniqueRouteStack(tsMap[treePath])
 		}
 	}
-	app.routesRefreshed = false
 
+	// reset the flag and return
+	app.routesRefreshed = false
 	return app
 }

+ 0 - 24
vendor/github.com/pkg/errors/.gitignore

@@ -1,24 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
-*.prof

+ 0 - 10
vendor/github.com/pkg/errors/.travis.yml

@@ -1,10 +0,0 @@
-language: go
-go_import_path: github.com/pkg/errors
-go:
-  - 1.11.x
-  - 1.12.x
-  - 1.13.x
-  - tip
-
-script:
-  - make check

+ 0 - 23
vendor/github.com/pkg/errors/LICENSE

@@ -1,23 +0,0 @@
-Copyright (c) 2015, Dave Cheney <dave@cheney.net>
-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 HOLDER 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.

+ 0 - 44
vendor/github.com/pkg/errors/Makefile

@@ -1,44 +0,0 @@
-PKGS := github.com/pkg/errors
-SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS))
-GO := go
-
-check: test vet gofmt misspell unconvert staticcheck ineffassign unparam
-
-test: 
-	$(GO) test $(PKGS)
-
-vet: | test
-	$(GO) vet $(PKGS)
-
-staticcheck:
-	$(GO) get honnef.co/go/tools/cmd/staticcheck
-	staticcheck -checks all $(PKGS)
-
-misspell:
-	$(GO) get github.com/client9/misspell/cmd/misspell
-	misspell \
-		-locale GB \
-		-error \
-		*.md *.go
-
-unconvert:
-	$(GO) get github.com/mdempsky/unconvert
-	unconvert -v $(PKGS)
-
-ineffassign:
-	$(GO) get github.com/gordonklaus/ineffassign
-	find $(SRCDIRS) -name '*.go' | xargs ineffassign
-
-pedantic: check errcheck
-
-unparam:
-	$(GO) get mvdan.cc/unparam
-	unparam ./...
-
-errcheck:
-	$(GO) get github.com/kisielk/errcheck
-	errcheck $(PKGS)
-
-gofmt:  
-	@echo Checking code is gofmted
-	@test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)"

+ 0 - 59
vendor/github.com/pkg/errors/README.md

@@ -1,59 +0,0 @@
-# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/errors/-/badge.svg)](https://sourcegraph.com/github.com/pkg/errors?badge)
-
-Package errors provides simple error handling primitives.
-
-`go get github.com/pkg/errors`
-
-The traditional error handling idiom in Go is roughly akin to
-```go
-if err != nil {
-        return err
-}
-```
-which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error.
-
-## Adding context to an error
-
-The errors.Wrap function returns a new error that adds context to the original error. For example
-```go
-_, err := ioutil.ReadAll(r)
-if err != nil {
-        return errors.Wrap(err, "read failed")
-}
-```
-## Retrieving the cause of an error
-
-Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`.
-```go
-type causer interface {
-        Cause() error
-}
-```
-`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example:
-```go
-switch err := errors.Cause(err).(type) {
-case *MyError:
-        // handle specifically
-default:
-        // unknown error
-}
-```
-
-[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors).
-
-## Roadmap
-
-With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows:
-
-- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible)
-- 1.0. Final release.
-
-## Contributing
-
-Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports. 
-
-Before sending a PR, please discuss your change by raising an issue.
-
-## License
-
-BSD-2-Clause

+ 0 - 32
vendor/github.com/pkg/errors/appveyor.yml

@@ -1,32 +0,0 @@
-version: build-{build}.{branch}
-
-clone_folder: C:\gopath\src\github.com\pkg\errors
-shallow_clone: true # for startup speed
-
-environment:
-  GOPATH: C:\gopath
-
-platform:
-  - x64
-
-# http://www.appveyor.com/docs/installed-software
-install:
-  # some helpful output for debugging builds
-  - go version
-  - go env
-  # pre-installed MinGW at C:\MinGW is 32bit only
-  # but MSYS2 at C:\msys64 has mingw64
-  - set PATH=C:\msys64\mingw64\bin;%PATH%
-  - gcc --version
-  - g++ --version
-
-build_script:
-  - go install -v ./...
-
-test_script:
-  - set PATH=C:\gopath\bin;%PATH%
-  - go test -v ./...
-
-#artifacts:
-#  - path: '%GOPATH%\bin\*.exe'
-deploy: off

+ 0 - 288
vendor/github.com/pkg/errors/errors.go

@@ -1,288 +0,0 @@
-// Package errors provides simple error handling primitives.
-//
-// The traditional error handling idiom in Go is roughly akin to
-//
-//     if err != nil {
-//             return err
-//     }
-//
-// which when applied recursively up the call stack results in error reports
-// without context or debugging information. The errors package allows
-// programmers to add context to the failure path in their code in a way
-// that does not destroy the original value of the error.
-//
-// Adding context to an error
-//
-// The errors.Wrap function returns a new error that adds context to the
-// original error by recording a stack trace at the point Wrap is called,
-// together with the supplied message. For example
-//
-//     _, err := ioutil.ReadAll(r)
-//     if err != nil {
-//             return errors.Wrap(err, "read failed")
-//     }
-//
-// If additional control is required, the errors.WithStack and
-// errors.WithMessage functions destructure errors.Wrap into its component
-// operations: annotating an error with a stack trace and with a message,
-// respectively.
-//
-// Retrieving the cause of an error
-//
-// Using errors.Wrap constructs a stack of errors, adding context to the
-// preceding error. Depending on the nature of the error it may be necessary
-// to reverse the operation of errors.Wrap to retrieve the original error
-// for inspection. Any error value which implements this interface
-//
-//     type causer interface {
-//             Cause() error
-//     }
-//
-// can be inspected by errors.Cause. errors.Cause will recursively retrieve
-// the topmost error that does not implement causer, which is assumed to be
-// the original cause. For example:
-//
-//     switch err := errors.Cause(err).(type) {
-//     case *MyError:
-//             // handle specifically
-//     default:
-//             // unknown error
-//     }
-//
-// Although the causer interface is not exported by this package, it is
-// considered a part of its stable public interface.
-//
-// Formatted printing of errors
-//
-// All error values returned from this package implement fmt.Formatter and can
-// be formatted by the fmt package. The following verbs are supported:
-//
-//     %s    print the error. If the error has a Cause it will be
-//           printed recursively.
-//     %v    see %s
-//     %+v   extended format. Each Frame of the error's StackTrace will
-//           be printed in detail.
-//
-// Retrieving the stack trace of an error or wrapper
-//
-// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
-// invoked. This information can be retrieved with the following interface:
-//
-//     type stackTracer interface {
-//             StackTrace() errors.StackTrace
-//     }
-//
-// The returned errors.StackTrace type is defined as
-//
-//     type StackTrace []Frame
-//
-// The Frame type represents a call site in the stack trace. Frame supports
-// the fmt.Formatter interface that can be used for printing information about
-// the stack trace of this error. For example:
-//
-//     if err, ok := err.(stackTracer); ok {
-//             for _, f := range err.StackTrace() {
-//                     fmt.Printf("%+s:%d\n", f, f)
-//             }
-//     }
-//
-// Although the stackTracer interface is not exported by this package, it is
-// considered a part of its stable public interface.
-//
-// See the documentation for Frame.Format for more details.
-package errors
-
-import (
-	"fmt"
-	"io"
-)
-
-// New returns an error with the supplied message.
-// New also records the stack trace at the point it was called.
-func New(message string) error {
-	return &fundamental{
-		msg:   message,
-		stack: callers(),
-	}
-}
-
-// Errorf formats according to a format specifier and returns the string
-// as a value that satisfies error.
-// Errorf also records the stack trace at the point it was called.
-func Errorf(format string, args ...interface{}) error {
-	return &fundamental{
-		msg:   fmt.Sprintf(format, args...),
-		stack: callers(),
-	}
-}
-
-// fundamental is an error that has a message and a stack, but no caller.
-type fundamental struct {
-	msg string
-	*stack
-}
-
-func (f *fundamental) Error() string { return f.msg }
-
-func (f *fundamental) Format(s fmt.State, verb rune) {
-	switch verb {
-	case 'v':
-		if s.Flag('+') {
-			io.WriteString(s, f.msg)
-			f.stack.Format(s, verb)
-			return
-		}
-		fallthrough
-	case 's':
-		io.WriteString(s, f.msg)
-	case 'q':
-		fmt.Fprintf(s, "%q", f.msg)
-	}
-}
-
-// WithStack annotates err with a stack trace at the point WithStack was called.
-// If err is nil, WithStack returns nil.
-func WithStack(err error) error {
-	if err == nil {
-		return nil
-	}
-	return &withStack{
-		err,
-		callers(),
-	}
-}
-
-type withStack struct {
-	error
-	*stack
-}
-
-func (w *withStack) Cause() error { return w.error }
-
-// Unwrap provides compatibility for Go 1.13 error chains.
-func (w *withStack) Unwrap() error { return w.error }
-
-func (w *withStack) Format(s fmt.State, verb rune) {
-	switch verb {
-	case 'v':
-		if s.Flag('+') {
-			fmt.Fprintf(s, "%+v", w.Cause())
-			w.stack.Format(s, verb)
-			return
-		}
-		fallthrough
-	case 's':
-		io.WriteString(s, w.Error())
-	case 'q':
-		fmt.Fprintf(s, "%q", w.Error())
-	}
-}
-
-// Wrap returns an error annotating err with a stack trace
-// at the point Wrap is called, and the supplied message.
-// If err is nil, Wrap returns nil.
-func Wrap(err error, message string) error {
-	if err == nil {
-		return nil
-	}
-	err = &withMessage{
-		cause: err,
-		msg:   message,
-	}
-	return &withStack{
-		err,
-		callers(),
-	}
-}
-
-// Wrapf returns an error annotating err with a stack trace
-// at the point Wrapf is called, and the format specifier.
-// If err is nil, Wrapf returns nil.
-func Wrapf(err error, format string, args ...interface{}) error {
-	if err == nil {
-		return nil
-	}
-	err = &withMessage{
-		cause: err,
-		msg:   fmt.Sprintf(format, args...),
-	}
-	return &withStack{
-		err,
-		callers(),
-	}
-}
-
-// WithMessage annotates err with a new message.
-// If err is nil, WithMessage returns nil.
-func WithMessage(err error, message string) error {
-	if err == nil {
-		return nil
-	}
-	return &withMessage{
-		cause: err,
-		msg:   message,
-	}
-}
-
-// WithMessagef annotates err with the format specifier.
-// If err is nil, WithMessagef returns nil.
-func WithMessagef(err error, format string, args ...interface{}) error {
-	if err == nil {
-		return nil
-	}
-	return &withMessage{
-		cause: err,
-		msg:   fmt.Sprintf(format, args...),
-	}
-}
-
-type withMessage struct {
-	cause error
-	msg   string
-}
-
-func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
-func (w *withMessage) Cause() error  { return w.cause }
-
-// Unwrap provides compatibility for Go 1.13 error chains.
-func (w *withMessage) Unwrap() error { return w.cause }
-
-func (w *withMessage) Format(s fmt.State, verb rune) {
-	switch verb {
-	case 'v':
-		if s.Flag('+') {
-			fmt.Fprintf(s, "%+v\n", w.Cause())
-			io.WriteString(s, w.msg)
-			return
-		}
-		fallthrough
-	case 's', 'q':
-		io.WriteString(s, w.Error())
-	}
-}
-
-// Cause returns the underlying cause of the error, if possible.
-// An error value has a cause if it implements the following
-// interface:
-//
-//     type causer interface {
-//            Cause() error
-//     }
-//
-// If the error does not implement Cause, the original error will
-// be returned. If the error is nil, nil will be returned without further
-// investigation.
-func Cause(err error) error {
-	type causer interface {
-		Cause() error
-	}
-
-	for err != nil {
-		cause, ok := err.(causer)
-		if !ok {
-			break
-		}
-		err = cause.Cause()
-	}
-	return err
-}

+ 0 - 38
vendor/github.com/pkg/errors/go113.go

@@ -1,38 +0,0 @@
-// +build go1.13
-
-package errors
-
-import (
-	stderrors "errors"
-)
-
-// Is reports whether any error in err's chain matches target.
-//
-// The chain consists of err itself followed by the sequence of errors obtained by
-// repeatedly calling Unwrap.
-//
-// An error is considered to match a target if it is equal to that target or if
-// it implements a method Is(error) bool such that Is(target) returns true.
-func Is(err, target error) bool { return stderrors.Is(err, target) }
-
-// As finds the first error in err's chain that matches target, and if so, sets
-// target to that error value and returns true.
-//
-// The chain consists of err itself followed by the sequence of errors obtained by
-// repeatedly calling Unwrap.
-//
-// An error matches target if the error's concrete value is assignable to the value
-// pointed to by target, or if the error has a method As(interface{}) bool such that
-// As(target) returns true. In the latter case, the As method is responsible for
-// setting target.
-//
-// As will panic if target is not a non-nil pointer to either a type that implements
-// error, or to any interface type. As returns false if err is nil.
-func As(err error, target interface{}) bool { return stderrors.As(err, target) }
-
-// Unwrap returns the result of calling the Unwrap method on err, if err's
-// type contains an Unwrap method returning error.
-// Otherwise, Unwrap returns nil.
-func Unwrap(err error) error {
-	return stderrors.Unwrap(err)
-}

+ 0 - 177
vendor/github.com/pkg/errors/stack.go

@@ -1,177 +0,0 @@
-package errors
-
-import (
-	"fmt"
-	"io"
-	"path"
-	"runtime"
-	"strconv"
-	"strings"
-)
-
-// Frame represents a program counter inside a stack frame.
-// For historical reasons if Frame is interpreted as a uintptr
-// its value represents the program counter + 1.
-type Frame uintptr
-
-// pc returns the program counter for this frame;
-// multiple frames may have the same PC value.
-func (f Frame) pc() uintptr { return uintptr(f) - 1 }
-
-// file returns the full path to the file that contains the
-// function for this Frame's pc.
-func (f Frame) file() string {
-	fn := runtime.FuncForPC(f.pc())
-	if fn == nil {
-		return "unknown"
-	}
-	file, _ := fn.FileLine(f.pc())
-	return file
-}
-
-// line returns the line number of source code of the
-// function for this Frame's pc.
-func (f Frame) line() int {
-	fn := runtime.FuncForPC(f.pc())
-	if fn == nil {
-		return 0
-	}
-	_, line := fn.FileLine(f.pc())
-	return line
-}
-
-// name returns the name of this function, if known.
-func (f Frame) name() string {
-	fn := runtime.FuncForPC(f.pc())
-	if fn == nil {
-		return "unknown"
-	}
-	return fn.Name()
-}
-
-// Format formats the frame according to the fmt.Formatter interface.
-//
-//    %s    source file
-//    %d    source line
-//    %n    function name
-//    %v    equivalent to %s:%d
-//
-// Format accepts flags that alter the printing of some verbs, as follows:
-//
-//    %+s   function name and path of source file relative to the compile time
-//          GOPATH separated by \n\t (<funcname>\n\t<path>)
-//    %+v   equivalent to %+s:%d
-func (f Frame) Format(s fmt.State, verb rune) {
-	switch verb {
-	case 's':
-		switch {
-		case s.Flag('+'):
-			io.WriteString(s, f.name())
-			io.WriteString(s, "\n\t")
-			io.WriteString(s, f.file())
-		default:
-			io.WriteString(s, path.Base(f.file()))
-		}
-	case 'd':
-		io.WriteString(s, strconv.Itoa(f.line()))
-	case 'n':
-		io.WriteString(s, funcname(f.name()))
-	case 'v':
-		f.Format(s, 's')
-		io.WriteString(s, ":")
-		f.Format(s, 'd')
-	}
-}
-
-// MarshalText formats a stacktrace Frame as a text string. The output is the
-// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
-func (f Frame) MarshalText() ([]byte, error) {
-	name := f.name()
-	if name == "unknown" {
-		return []byte(name), nil
-	}
-	return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil
-}
-
-// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
-type StackTrace []Frame
-
-// Format formats the stack of Frames according to the fmt.Formatter interface.
-//
-//    %s	lists source files for each Frame in the stack
-//    %v	lists the source file and line number for each Frame in the stack
-//
-// Format accepts flags that alter the printing of some verbs, as follows:
-//
-//    %+v   Prints filename, function, and line number for each Frame in the stack.
-func (st StackTrace) Format(s fmt.State, verb rune) {
-	switch verb {
-	case 'v':
-		switch {
-		case s.Flag('+'):
-			for _, f := range st {
-				io.WriteString(s, "\n")
-				f.Format(s, verb)
-			}
-		case s.Flag('#'):
-			fmt.Fprintf(s, "%#v", []Frame(st))
-		default:
-			st.formatSlice(s, verb)
-		}
-	case 's':
-		st.formatSlice(s, verb)
-	}
-}
-
-// formatSlice will format this StackTrace into the given buffer as a slice of
-// Frame, only valid when called with '%s' or '%v'.
-func (st StackTrace) formatSlice(s fmt.State, verb rune) {
-	io.WriteString(s, "[")
-	for i, f := range st {
-		if i > 0 {
-			io.WriteString(s, " ")
-		}
-		f.Format(s, verb)
-	}
-	io.WriteString(s, "]")
-}
-
-// stack represents a stack of program counters.
-type stack []uintptr
-
-func (s *stack) Format(st fmt.State, verb rune) {
-	switch verb {
-	case 'v':
-		switch {
-		case st.Flag('+'):
-			for _, pc := range *s {
-				f := Frame(pc)
-				fmt.Fprintf(st, "\n%+v", f)
-			}
-		}
-	}
-}
-
-func (s *stack) StackTrace() StackTrace {
-	f := make([]Frame, len(*s))
-	for i := 0; i < len(f); i++ {
-		f[i] = Frame((*s)[i])
-	}
-	return f
-}
-
-func callers() *stack {
-	const depth = 32
-	var pcs [depth]uintptr
-	n := runtime.Callers(3, pcs[:])
-	var st stack = pcs[0:n]
-	return &st
-}
-
-// funcname removes the path prefix component of a function's name reported by func.Name().
-func funcname(name string) string {
-	i := strings.LastIndex(name, "/")
-	name = name[i+1:]
-	i = strings.Index(name, ".")
-	return name[i+1:]
-}

+ 1 - 0
vendor/github.com/valyala/fasthttp/.golangci.yml

@@ -13,6 +13,7 @@ linters:
     - exhaustruct
     - forbidigo
     - forcetypeassert
+    - funcorder
     - funlen
     - gochecknoglobals
     - gocognit

+ 232 - 185
vendor/github.com/valyala/fasthttp/README.md

@@ -47,9 +47,10 @@ connections per physical server.
 In short, fasthttp server is up to 10 times faster than net/http.
 Below are benchmark results.
 
-*GOMAXPROCS=1*
+_GOMAXPROCS=1_
 
 net/http server:
+
 ```
 $ GOMAXPROCS=1 go test -bench=NetHTTPServerGet -benchmem -benchtime=10s
 BenchmarkNetHTTPServerGet1ReqPerConn                	 1000000	     12052 ns/op	    2297 B/op	      29 allocs/op
@@ -63,6 +64,7 @@ BenchmarkNetHTTPServerGet100ReqPerConn10KClients    	 1000000	     13484 ns/op
 ```
 
 fasthttp server:
+
 ```
 $ GOMAXPROCS=1 go test -bench=kServerGet -benchmem -benchtime=10s
 BenchmarkServerGet1ReqPerConn                       	10000000	      1559 ns/op	       0 B/op	       0 allocs/op
@@ -75,9 +77,10 @@ BenchmarkServerGet10ReqPerConn10KClients            	20000000	       789 ns/op
 BenchmarkServerGet100ReqPerConn10KClients           	20000000	       604 ns/op	       0 B/op	       0 allocs/op
 ```
 
-*GOMAXPROCS=4*
+_GOMAXPROCS=4_
 
 net/http server:
+
 ```
 $ GOMAXPROCS=4 go test -bench=NetHTTPServerGet -benchmem -benchtime=10s
 BenchmarkNetHTTPServerGet1ReqPerConn-4                  	 3000000	      4529 ns/op	    2389 B/op	      29 allocs/op
@@ -91,6 +94,7 @@ BenchmarkNetHTTPServerGet100ReqPerConn10KClients-4      	 5000000	      3435 ns/
 ```
 
 fasthttp server:
+
 ```
 $ GOMAXPROCS=4 go test -bench=kServerGet -benchmem -benchtime=10s
 BenchmarkServerGet1ReqPerConn-4                         	10000000	      1141 ns/op	       0 B/op	       0 allocs/op
@@ -108,9 +112,10 @@ BenchmarkServerGet100ReqPerConn10KClients-4             	50000000	       282 ns/
 In short, fasthttp client is up to 10 times faster than net/http.
 Below are benchmark results.
 
-*GOMAXPROCS=1*
+_GOMAXPROCS=1_
 
 net/http client:
+
 ```
 $ GOMAXPROCS=1 go test -bench='HTTPClient(Do|GetEndToEnd)' -benchmem -benchtime=10s
 BenchmarkNetHTTPClientDoFastServer                  	 1000000	     12567 ns/op	    2616 B/op	      35 allocs/op
@@ -124,6 +129,7 @@ BenchmarkNetHTTPClientGetEndToEnd1000Inmemory       	  500000	     39511 ns/op
 ```
 
 fasthttp client:
+
 ```
 $ GOMAXPROCS=1 go test -bench='kClient(Do|GetEndToEnd)' -benchmem -benchtime=10s
 BenchmarkClientDoFastServer                         	20000000	       865 ns/op	       0 B/op	       0 allocs/op
@@ -136,9 +142,10 @@ BenchmarkClientGetEndToEnd100Inmemory               	 5000000	      3396 ns/op
 BenchmarkClientGetEndToEnd1000Inmemory              	 5000000	      3306 ns/op	       2 B/op	       0 allocs/op
 ```
 
-*GOMAXPROCS=4*
+_GOMAXPROCS=4_
 
 net/http client:
+
 ```
 $ GOMAXPROCS=4 go test -bench='HTTPClient(Do|GetEndToEnd)' -benchmem -benchtime=10s
 BenchmarkNetHTTPClientDoFastServer-4                    	 2000000	      8774 ns/op	    2619 B/op	      35 allocs/op
@@ -152,6 +159,7 @@ BenchmarkNetHTTPClientGetEndToEnd1000Inmemory-4         	 1000000	     11132 ns/
 ```
 
 fasthttp client:
+
 ```
 $ GOMAXPROCS=4 go test -bench='kClient(Do|GetEndToEnd)' -benchmem -benchtime=10s
 BenchmarkClientDoFastServer-4                           	50000000	       397 ns/op	       0 B/op	       0 allocs/op
@@ -164,14 +172,12 @@ BenchmarkClientGetEndToEnd100Inmemory-4                 	10000000	      1329 ns/
 BenchmarkClientGetEndToEnd1000Inmemory-4                	10000000	      1316 ns/op	       5 B/op	       0 allocs/op
 ```
 
-
 ## Install
 
 ```
 go get -u github.com/valyala/fasthttp
 ```
 
-
 ## Switching from net/http to fasthttp
 
 Unfortunately, fasthttp doesn't provide API identical to net/http.
@@ -182,9 +188,9 @@ all of the fasthttp advantages (especially high performance :) ).
 
 Important points:
 
-* Fasthttp works with [RequestHandler functions](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler)
-instead of objects implementing [Handler interface](https://pkg.go.dev/net/http#Handler).
-Fortunately, it is easy to pass bound struct methods to fasthttp:
+- Fasthttp works with [RequestHandler functions](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler)
+  instead of objects implementing [Handler interface](https://pkg.go.dev/net/http#Handler).
+  Fortunately, it is easy to pass bound struct methods to fasthttp:
 
   ```go
   type MyHandler struct {
@@ -213,11 +219,11 @@ Fortunately, it is easy to pass bound struct methods to fasthttp:
   fasthttp.ListenAndServe(":8081", fastHTTPHandler)
   ```
 
-* The [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler)
-accepts only one argument - [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx).
-It contains all the functionality required for http request processing
-and response writing. Below is an example of a simple request handler conversion
-from net/http to fasthttp.
+- The [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler)
+  accepts only one argument - [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx).
+  It contains all the functionality required for http request processing
+  and response writing. Below is an example of a simple request handler conversion
+  from net/http to fasthttp.
 
   ```go
   // net/http request handler
@@ -247,9 +253,9 @@ from net/http to fasthttp.
   }
   ```
 
-* Fasthttp allows setting response headers and writing response body
-in an arbitrary order. There is no 'headers first, then body' restriction
-like in net/http. The following code is valid for fasthttp:
+- Fasthttp allows setting response headers and writing response body
+  in an arbitrary order. There is no 'headers first, then body' restriction
+  like in net/http. The following code is valid for fasthttp:
 
   ```go
   requestHandler := func(ctx *fasthttp.RequestCtx) {
@@ -280,16 +286,16 @@ like in net/http. The following code is valid for fasthttp:
   }
   ```
 
-* Fasthttp doesn't provide [ServeMux](https://pkg.go.dev/net/http#ServeMux),
-but there are more powerful third-party routers and web frameworks
-with fasthttp support:
+- Fasthttp doesn't provide [ServeMux](https://pkg.go.dev/net/http#ServeMux),
+  but there are more powerful third-party routers and web frameworks
+  with fasthttp support:
 
-  * [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing)
-  * [router](https://github.com/fasthttp/router)
-  * [lu](https://github.com/vincentLiuxiang/lu)
-  * [atreugo](https://github.com/savsgio/atreugo)
-  * [Fiber](https://github.com/gofiber/fiber)
-  * [Gearbox](https://github.com/gogearbox/gearbox)
+  - [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing)
+  - [router](https://github.com/fasthttp/router)
+  - [lu](https://github.com/vincentLiuxiang/lu)
+  - [atreugo](https://github.com/savsgio/atreugo)
+  - [Fiber](https://github.com/gofiber/fiber)
+  - [Gearbox](https://github.com/gogearbox/gearbox)
 
   Net/http code with simple ServeMux is trivially converted to fasthttp code:
 
@@ -322,83 +328,85 @@ with fasthttp support:
   fasthttp.ListenAndServe(":80", m)
   ```
 
-* Because creating a new channel for every request is just too expensive, so the channel returned by RequestCtx.Done() is only closed when the server is shutting down.
+- Because creating a new channel for every request is just too expensive, so the channel returned by RequestCtx.Done() is only closed when the server is shutting down.
 
   ```go
   func main() {
-	fasthttp.ListenAndServe(":8080", fasthttp.TimeoutHandler(func(ctx *fasthttp.RequestCtx) {
-		select {
-		case <-ctx.Done():
-			// ctx.Done() is only closed when the server is shutting down.
-			log.Println("context cancelled")
-			return
-		case <-time.After(10 * time.Second):
-			log.Println("process finished ok")
-		}
-	}, time.Second*2, "timeout"))
+  fasthttp.ListenAndServe(":8080", fasthttp.TimeoutHandler(func(ctx *fasthttp.RequestCtx) {
+  	select {
+  	case <-ctx.Done():
+  		// ctx.Done() is only closed when the server is shutting down.
+  		log.Println("context cancelled")
+  		return
+  	case <-time.After(10 * time.Second):
+  		log.Println("process finished ok")
+  	}
+  }, time.Second*2, "timeout"))
   }
   ```
 
-* net/http -> fasthttp conversion table:
+- net/http -> fasthttp conversion table:
+
+  - All the pseudocode below assumes w, r and ctx have these types:
 
-  * All the pseudocode below assumes w, r and ctx have these types:
   ```go
-	var (
-		w http.ResponseWriter
-		r *http.Request
-		ctx *fasthttp.RequestCtx
-	)
+  var (
+  	w http.ResponseWriter
+  	r *http.Request
+  	ctx *fasthttp.RequestCtx
+  )
   ```
-  * r.Body -> [ctx.PostBody()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostBody)
-  * r.URL.Path -> [ctx.Path()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Path)
-  * r.URL -> [ctx.URI()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.URI)
-  * r.Method -> [ctx.Method()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Method)
-  * r.Header -> [ctx.Request.Header](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHeader)
-  * r.Header.Get() -> [ctx.Request.Header.Peek()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHeader.Peek)
-  * r.Host -> [ctx.Host()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Host)
-  * r.Form -> [ctx.QueryArgs()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.QueryArgs) +
-  [ctx.PostArgs()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostArgs)
-  * r.PostForm -> [ctx.PostArgs()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostArgs)
-  * r.FormValue() -> [ctx.FormValue()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.FormValue)
-  * r.FormFile() -> [ctx.FormFile()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.FormFile)
-  * r.MultipartForm -> [ctx.MultipartForm()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.MultipartForm)
-  * r.RemoteAddr -> [ctx.RemoteAddr()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.RemoteAddr)
-  * r.RequestURI -> [ctx.RequestURI()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.RequestURI)
-  * r.TLS -> [ctx.IsTLS()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.IsTLS)
-  * r.Cookie() -> [ctx.Request.Header.Cookie()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHeader.Cookie)
-  * r.Referer() -> [ctx.Referer()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Referer)
-  * r.UserAgent() -> [ctx.UserAgent()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.UserAgent)
-  * w.Header() -> [ctx.Response.Header](https://pkg.go.dev/github.com/valyala/fasthttp#ResponseHeader)
-  * w.Header().Set() -> [ctx.Response.Header.Set()](https://pkg.go.dev/github.com/valyala/fasthttp#ResponseHeader.Set)
-  * w.Header().Set("Content-Type") -> [ctx.SetContentType()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetContentType)
-  * w.Header().Set("Set-Cookie") -> [ctx.Response.Header.SetCookie()](https://pkg.go.dev/github.com/valyala/fasthttp#ResponseHeader.SetCookie)
-  * w.Write() -> [ctx.Write()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Write),
-  [ctx.SetBody()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetBody),
-  [ctx.SetBodyStream()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetBodyStream),
-  [ctx.SetBodyStreamWriter()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetBodyStreamWriter)
-  * w.WriteHeader() -> [ctx.SetStatusCode()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetStatusCode)
-  * w.(http.Hijacker).Hijack() -> [ctx.Hijack()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Hijack)
-  * http.Error() -> [ctx.Error()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Error)
-  * http.FileServer() -> [fasthttp.FSHandler()](https://pkg.go.dev/github.com/valyala/fasthttp#FSHandler),
-  [fasthttp.FS](https://pkg.go.dev/github.com/valyala/fasthttp#FS)
-  * http.ServeFile() -> [fasthttp.ServeFile()](https://pkg.go.dev/github.com/valyala/fasthttp#ServeFile)
-  * http.Redirect() -> [ctx.Redirect()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Redirect)
-  * http.NotFound() -> [ctx.NotFound()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.NotFound)
-  * http.StripPrefix() -> [fasthttp.PathRewriteFunc](https://pkg.go.dev/github.com/valyala/fasthttp#PathRewriteFunc)
-
-* *VERY IMPORTANT!* Fasthttp disallows holding references
-to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx) or to its'
-members after returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
-Otherwise [data races](http://go.dev/blog/race-detector) are inevitable.
-Carefully inspect all the net/http request handlers converted to fasthttp whether
-they retain references to RequestCtx or to its' members after returning.
-RequestCtx provides the following _band aids_ for this case:
-
-  * Wrap RequestHandler into [TimeoutHandler](https://pkg.go.dev/github.com/valyala/fasthttp#TimeoutHandler).
-  * Call [TimeoutError](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.TimeoutError)
-  before returning from RequestHandler if there are references to RequestCtx or to its' members.
-  See [the example](https://pkg.go.dev/github.com/valyala/fasthttp#example-RequestCtx-TimeoutError)
-  for more details.
+
+  - r.Body -> [ctx.PostBody()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostBody)
+  - r.URL.Path -> [ctx.Path()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Path)
+  - r.URL -> [ctx.URI()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.URI)
+  - r.Method -> [ctx.Method()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Method)
+  - r.Header -> [ctx.Request.Header](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHeader)
+  - r.Header.Get() -> [ctx.Request.Header.Peek()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHeader.Peek)
+  - r.Host -> [ctx.Host()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Host)
+  - r.Form -> [ctx.QueryArgs()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.QueryArgs) +
+    [ctx.PostArgs()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostArgs)
+  - r.PostForm -> [ctx.PostArgs()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostArgs)
+  - r.FormValue() -> [ctx.FormValue()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.FormValue)
+  - r.FormFile() -> [ctx.FormFile()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.FormFile)
+  - r.MultipartForm -> [ctx.MultipartForm()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.MultipartForm)
+  - r.RemoteAddr -> [ctx.RemoteAddr()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.RemoteAddr)
+  - r.RequestURI -> [ctx.RequestURI()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.RequestURI)
+  - r.TLS -> [ctx.IsTLS()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.IsTLS)
+  - r.Cookie() -> [ctx.Request.Header.Cookie()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHeader.Cookie)
+  - r.Referer() -> [ctx.Referer()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Referer)
+  - r.UserAgent() -> [ctx.UserAgent()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.UserAgent)
+  - w.Header() -> [ctx.Response.Header](https://pkg.go.dev/github.com/valyala/fasthttp#ResponseHeader)
+  - w.Header().Set() -> [ctx.Response.Header.Set()](https://pkg.go.dev/github.com/valyala/fasthttp#ResponseHeader.Set)
+  - w.Header().Set("Content-Type") -> [ctx.SetContentType()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetContentType)
+  - w.Header().Set("Set-Cookie") -> [ctx.Response.Header.SetCookie()](https://pkg.go.dev/github.com/valyala/fasthttp#ResponseHeader.SetCookie)
+  - w.Write() -> [ctx.Write()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Write),
+    [ctx.SetBody()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetBody),
+    [ctx.SetBodyStream()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetBodyStream),
+    [ctx.SetBodyStreamWriter()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetBodyStreamWriter)
+  - w.WriteHeader() -> [ctx.SetStatusCode()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.SetStatusCode)
+  - w.(http.Hijacker).Hijack() -> [ctx.Hijack()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Hijack)
+  - http.Error() -> [ctx.Error()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Error)
+  - http.FileServer() -> [fasthttp.FSHandler()](https://pkg.go.dev/github.com/valyala/fasthttp#FSHandler),
+    [fasthttp.FS](https://pkg.go.dev/github.com/valyala/fasthttp#FS)
+  - http.ServeFile() -> [fasthttp.ServeFile()](https://pkg.go.dev/github.com/valyala/fasthttp#ServeFile)
+  - http.Redirect() -> [ctx.Redirect()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Redirect)
+  - http.NotFound() -> [ctx.NotFound()](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.NotFound)
+  - http.StripPrefix() -> [fasthttp.PathRewriteFunc](https://pkg.go.dev/github.com/valyala/fasthttp#PathRewriteFunc)
+
+- _VERY IMPORTANT!_ Fasthttp disallows holding references
+  to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx) or to its'
+  members after returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
+  Otherwise [data races](http://go.dev/blog/race-detector) are inevitable.
+  Carefully inspect all the net/http request handlers converted to fasthttp whether
+  they retain references to RequestCtx or to its' members after returning.
+  RequestCtx provides the following _band aids_ for this case:
+
+  - Wrap RequestHandler into [TimeoutHandler](https://pkg.go.dev/github.com/valyala/fasthttp#TimeoutHandler).
+  - Call [TimeoutError](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.TimeoutError)
+    before returning from RequestHandler if there are references to RequestCtx or to its' members.
+    See [the example](https://pkg.go.dev/github.com/valyala/fasthttp#example-RequestCtx-TimeoutError)
+    for more details.
 
 Use this brilliant tool - [race detector](http://go.dev/blog/race-detector) -
 for detecting and eliminating data races in your program. If you detected
@@ -406,54 +414,86 @@ data race related to fasthttp in your program, then there is high probability
 you forgot calling [TimeoutError](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.TimeoutError)
 before returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
 
-* Blind switching from net/http to fasthttp won't give you performance boost.
-While fasthttp is optimized for speed, its' performance may be easily saturated
-by slow [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
-So [profile](http://go.dev/blog/pprof) and optimize your
-code after switching to fasthttp. For instance, use [quicktemplate](https://github.com/valyala/quicktemplate)
-instead of [html/template](https://pkg.go.dev/html/template).
-
-* See also [fasthttputil](https://pkg.go.dev/github.com/valyala/fasthttp/fasthttputil),
-[fasthttpadaptor](https://pkg.go.dev/github.com/valyala/fasthttp/fasthttpadaptor) and
-[expvarhandler](https://pkg.go.dev/github.com/valyala/fasthttp/expvarhandler).
+- Blind switching from net/http to fasthttp won't give you performance boost.
+  While fasthttp is optimized for speed, its' performance may be easily saturated
+  by slow [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
+  So [profile](http://go.dev/blog/pprof) and optimize your
+  code after switching to fasthttp. For instance, use [quicktemplate](https://github.com/valyala/quicktemplate)
+  instead of [html/template](https://pkg.go.dev/html/template).
 
+- See also [fasthttputil](https://pkg.go.dev/github.com/valyala/fasthttp/fasthttputil),
+  [fasthttpadaptor](https://pkg.go.dev/github.com/valyala/fasthttp/fasthttpadaptor) and
+  [expvarhandler](https://pkg.go.dev/github.com/valyala/fasthttp/expvarhandler).
 
 ## Performance optimization tips for multi-core systems
 
-* Use [reuseport](https://pkg.go.dev/github.com/valyala/fasthttp/reuseport) listener.
-* Run a separate server instance per CPU core with GOMAXPROCS=1.
-* Pin each server instance to a separate CPU core using [taskset](http://linux.die.net/man/1/taskset).
-* Ensure the interrupts of multiqueue network card are evenly distributed between CPU cores.
+- Use [reuseport](https://pkg.go.dev/github.com/valyala/fasthttp/reuseport) listener.
+- Run a separate server instance per CPU core with GOMAXPROCS=1.
+- Pin each server instance to a separate CPU core using [taskset](http://linux.die.net/man/1/taskset).
+- Ensure the interrupts of multiqueue network card are evenly distributed between CPU cores.
   See [this article](https://blog.cloudflare.com/how-to-achieve-low-latency/) for details.
-* Use the latest version of Go as each version contains performance improvements.
-
+- Use the latest version of Go as each version contains performance improvements.
 
 ## Fasthttp best practices
 
-* Do not allocate objects and `[]byte` buffers - just reuse them as much
+- Do not allocate objects and `[]byte` buffers - just reuse them as much
   as possible. Fasthttp API design encourages this.
-* [sync.Pool](https://pkg.go.dev/sync#Pool) is your best friend.
-* [Profile your program](http://go.dev/blog/pprof)
+- [sync.Pool](https://pkg.go.dev/sync#Pool) is your best friend.
+- [Profile your program](http://go.dev/blog/pprof)
   in production.
   `go tool pprof --alloc_objects your-program mem.pprof` usually gives better
   insights for optimization opportunities than `go tool pprof your-program cpu.pprof`.
-* Write [tests and benchmarks](https://pkg.go.dev/testing) for hot paths.
-* Avoid conversion between `[]byte` and `string`, since this may result in memory
-  allocation+copy. Fasthttp API provides functions for both `[]byte` and `string` -
-  use these functions instead of converting manually between `[]byte` and `string`.
-  There are some exceptions - see [this wiki page](https://github.com/golang/go/wiki/CompilerOptimizations#string-and-byte)
+- Write [tests and benchmarks](https://pkg.go.dev/testing) for hot paths.
+- Avoid conversion between `[]byte` and `string`, since this may result in memory
+  allocation+copy - see [this wiki page](https://github.com/golang/go/wiki/CompilerOptimizations#string-and-byte)
   for more details.
-* Verify your tests and production code under
+- Verify your tests and production code under
   [race detector](https://go.dev/doc/articles/race_detector.html) on a regular basis.
-* Prefer [quicktemplate](https://github.com/valyala/quicktemplate) instead of
+- Prefer [quicktemplate](https://github.com/valyala/quicktemplate) instead of
   [html/template](https://pkg.go.dev/html/template) in your webserver.
 
+## Unsafe Zero-Allocation Conversions
+
+In performance-critical code, converting between `[]byte` and `string` using standard Go allocations can be inefficient. To address this, `fasthttp` uses **unsafe**, zero-allocation helpers:
+
+> ⚠️ **Warning:** These conversions break Go's type safety. Use only when you're certain the converted value will not be mutated, as violating immutability can cause undefined behavior.
+
+### `UnsafeString(b []byte) string`
+
+Converts a `[]byte` to a `string` **without memory allocation**.
+
+```go
+// UnsafeString returns a string pointer without allocation
+func UnsafeString(b []byte) string {
+    // #nosec G103
+    return *(*string)(unsafe.Pointer(&b))
+}
+```
+
+### `UnsafeBytes(s string) []byte`
+
+Converts a `string` to a `[]byte` **without memory allocation**.
+
+```go
+// UnsafeBytes returns a byte pointer without allocation.
+func UnsafeBytes(s string) []byte {
+    // #nosec G103
+    return unsafe.Slice(unsafe.StringData(s), len(s))
+}
+```
+
+### Use Cases & Caveats
+
+- These functions are ideal for performance-sensitive scenarios where allocations must be avoided (e.g., request/response processing loops).
+- **Do not** mutate the `[]byte` returned from `UnsafeBytes(s string)` if the original string is still in use, as strings are immutable in Go and may be shared across the runtime.
+- Use samples guarded with `#nosec G103` comments to suppress static analysis warnings about unsafe operations.
 
 ## Tricks with `[]byte` buffers
 
 The following tricks are used by fasthttp. Use them in your code too.
 
-* Standard Go functions accept nil buffers
+- Standard Go functions accept nil buffers
+
 ```go
 var (
 	// both buffers are uninitialized
@@ -473,6 +513,7 @@ for i, ch := range src {
 ```
 
 So throw away nil checks for `[]byte` buffers from you code. For example,
+
 ```go
 srcLen := 0
 if src != nil {
@@ -486,25 +527,29 @@ becomes
 srcLen := len(src)
 ```
 
-* String may be appended to `[]byte` buffer with `append`
+- String may be appended to `[]byte` buffer with `append`
+
 ```go
 dst = append(dst, "foobar"...)
 ```
 
-* `[]byte` buffer may be extended to its' capacity.
+- `[]byte` buffer may be extended to its' capacity.
+
 ```go
 buf := make([]byte, 100)
 a := buf[:10]  // len(a) == 10, cap(a) == 100.
 b := a[:100]  // is valid, since cap(a) == 100.
 ```
 
-* All fasthttp functions accept nil `[]byte` buffer
+- All fasthttp functions accept nil `[]byte` buffer
+
 ```go
 statusCode, body, err := fasthttp.Get(nil, "http://google.com/")
 uintBuf := fasthttp.AppendUint(nil, 1234)
 ```
 
-* String and `[]byte` buffers may converted without memory allocations
+- String and `[]byte` buffers may converted without memory allocations
+
 ```go
 func b2s(b []byte) string {
     return *(*string)(unsafe.Pointer(&b))
@@ -521,123 +566,125 @@ func s2b(s string) (b []byte) {
 ```
 
 ### Warning:
+
 This is an **unsafe** way, the result string and `[]byte` buffer share the same bytes.
 
 **Please make sure not to modify the bytes in the `[]byte` buffer if the string still survives!**
 
 ## Related projects
 
-  * [fasthttp](https://github.com/fasthttp) - various useful
-    helpers for projects based on fasthttp.
-  * [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing) - fast and
-    powerful routing package for fasthttp servers.
-  * [http2](https://github.com/dgrr/http2) - HTTP/2 implementation for fasthttp.
-  * [router](https://github.com/fasthttp/router) - a high
-    performance fasthttp request router that scales well.
-  * [fastws](https://github.com/fasthttp/fastws) - Bloatless WebSocket package made for fasthttp
-    to handle Read/Write operations concurrently.
-  * [gramework](https://github.com/gramework/gramework) - a web framework made by one of fasthttp maintainers.
-  * [lu](https://github.com/vincentLiuxiang/lu) - a high performance
-    go middleware web framework which is based on fasthttp.
-  * [websocket](https://github.com/fasthttp/websocket) - Gorilla-based
-    websocket implementation for fasthttp.
-  * [websocket](https://github.com/dgrr/websocket) - Event-based high-performance WebSocket library for zero-allocation
-    websocket servers and clients.
-  * [fasthttpsession](https://github.com/phachon/fasthttpsession) - a fast and powerful session package for fasthttp servers.
-  * [atreugo](https://github.com/savsgio/atreugo) - High performance and extensible micro web framework with zero memory allocations in hot paths.
-  * [kratgo](https://github.com/savsgio/kratgo) - Simple, lightweight and ultra-fast HTTP Cache to speed up your websites.
-  * [kit-plugins](https://github.com/wencan/kit-plugins/tree/master/transport/fasthttp) - go-kit transport implementation for fasthttp.
-  * [Fiber](https://github.com/gofiber/fiber) - An Expressjs inspired web framework running on Fasthttp.
-  * [Gearbox](https://github.com/gogearbox/gearbox) - :gear: gearbox is a web framework written in Go with a focus on high performance and memory optimization.
-  * [http2curl](https://github.com/li-jin-gou/http2curl) - A tool to convert fasthttp requests to curl command line.
-  * [OpenTelemetry Golang Compile Time Instrumentation](https://github.com/alibaba/opentelemetry-go-auto-instrumentation) - A tool to monitor fasthttp application without changing any code with OpenTelemetry APIs.
+- [fasthttp](https://github.com/fasthttp) - various useful
+  helpers for projects based on fasthttp.
+- [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing) - fast and
+  powerful routing package for fasthttp servers.
+- [http2](https://github.com/dgrr/http2) - HTTP/2 implementation for fasthttp.
+- [router](https://github.com/fasthttp/router) - a high
+  performance fasthttp request router that scales well.
+- [fastws](https://github.com/fasthttp/fastws) - Bloatless WebSocket package made for fasthttp
+  to handle Read/Write operations concurrently.
+- [gramework](https://github.com/gramework/gramework) - a web framework made by one of fasthttp maintainers.
+- [lu](https://github.com/vincentLiuxiang/lu) - a high performance
+  go middleware web framework which is based on fasthttp.
+- [websocket](https://github.com/fasthttp/websocket) - Gorilla-based
+  websocket implementation for fasthttp.
+- [websocket](https://github.com/dgrr/websocket) - Event-based high-performance WebSocket library for zero-allocation
+  websocket servers and clients.
+- [fasthttpsession](https://github.com/phachon/fasthttpsession) - a fast and powerful session package for fasthttp servers.
+- [atreugo](https://github.com/savsgio/atreugo) - High performance and extensible micro web framework with zero memory allocations in hot paths.
+- [kratgo](https://github.com/savsgio/kratgo) - Simple, lightweight and ultra-fast HTTP Cache to speed up your websites.
+- [kit-plugins](https://github.com/wencan/kit-plugins/tree/master/transport/fasthttp) - go-kit transport implementation for fasthttp.
+- [Fiber](https://github.com/gofiber/fiber) - An Expressjs inspired web framework running on Fasthttp.
+- [Gearbox](https://github.com/gogearbox/gearbox) - :gear: gearbox is a web framework written in Go with a focus on high performance and memory optimization.
+- [http2curl](https://github.com/li-jin-gou/http2curl) - A tool to convert fasthttp requests to curl command line.
+- [OpenTelemetry Golang Compile Time Instrumentation](https://github.com/alibaba/opentelemetry-go-auto-instrumentation) - A tool to monitor fasthttp application without changing any code with OpenTelemetry APIs.
 
 ## FAQ
 
-* *Why creating yet another http package instead of optimizing net/http?*
+- _Why creating yet another http package instead of optimizing net/http?_
 
   Because net/http API limits many optimization opportunities.
   For example:
-  * net/http Request object lifetime isn't limited by request handler execution
+
+  - net/http Request object lifetime isn't limited by request handler execution
     time. So the server must create a new request object per each request instead
     of reusing existing objects like fasthttp does.
-  * net/http headers are stored in a `map[string][]string`. So the server
+  - net/http headers are stored in a `map[string][]string`. So the server
     must parse all the headers, convert them from `[]byte` to `string` and put
     them into the map before calling user-provided request handler.
     This all requires unnecessary memory allocations avoided by fasthttp.
-  * net/http client API requires creating a new response object per each request.
+  - net/http client API requires creating a new response object per each request.
 
-* *Why fasthttp API is incompatible with net/http?*
+- _Why fasthttp API is incompatible with net/http?_
 
   Because net/http API limits many optimization opportunities. See the answer
   above for more details. Also certain net/http API parts are suboptimal
   for use:
-  * Compare [net/http connection hijacking](https://pkg.go.dev/net/http#Hijacker)
+
+  - Compare [net/http connection hijacking](https://pkg.go.dev/net/http#Hijacker)
     to [fasthttp connection hijacking](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Hijack).
-  * Compare [net/http Request.Body reading](https://pkg.go.dev/net/http#Request)
+  - Compare [net/http Request.Body reading](https://pkg.go.dev/net/http#Request)
     to [fasthttp request body reading](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.PostBody).
 
-* *Why fasthttp doesn't support HTTP/2.0 and WebSockets?*
+- _Why fasthttp doesn't support HTTP/2.0 and WebSockets?_
 
   [HTTP/2.0 support](https://github.com/fasthttp/http2) is in progress. [WebSockets](https://github.com/fasthttp/websockets) has been done already.
   Third parties also may use [RequestCtx.Hijack](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.Hijack)
   for implementing these goodies.
 
-* *Are there known net/http advantages comparing to fasthttp?*
+- _Are there known net/http advantages comparing to fasthttp?_
 
   Yes:
-  * net/http supports [HTTP/2.0 starting from go1.6](https://pkg.go.dev/golang.org/x/net/http2).
-  * net/http API is stable, while fasthttp API constantly evolves.
-  * net/http handles more HTTP corner cases.
-  * net/http can stream both request and response bodies
-  * net/http can handle bigger bodies as it doesn't read the whole body into memory
-  * net/http should contain less bugs, since it is used and tested by much
+
+  - net/http supports [HTTP/2.0 starting from go1.6](https://pkg.go.dev/golang.org/x/net/http2).
+  - net/http API is stable, while fasthttp API constantly evolves.
+  - net/http handles more HTTP corner cases.
+  - net/http can stream both request and response bodies
+  - net/http can handle bigger bodies as it doesn't read the whole body into memory
+  - net/http should contain less bugs, since it is used and tested by much
     wider audience.
 
-* *Why fasthttp API prefers returning `[]byte` instead of `string`?*
+- _Why fasthttp API prefers returning `[]byte` instead of `string`?_
 
   Because `[]byte` to `string` conversion isn't free - it requires memory
   allocation and copy. Feel free wrapping returned `[]byte` result into
   `string()` if you prefer working with strings instead of byte slices.
   But be aware that this has non-zero overhead.
 
-* *Which GO versions are supported by fasthttp?*
+- _Which GO versions are supported by fasthttp?_
 
   We support the same versions the Go team supports.
   Currently that is Go 1.23.x and newer.
   Older versions might work, but won't officially be supported.
 
-* *Please provide real benchmark data and server information*
+- _Please provide real benchmark data and server information_
 
   See [this issue](https://github.com/valyala/fasthttp/issues/4).
 
-* *Are there plans to add request routing to fasthttp?*
+- _Are there plans to add request routing to fasthttp?_
 
   There are no plans to add request routing into fasthttp.
   Use third-party routers and web frameworks with fasthttp support:
 
-    * [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing)
-    * [router](https://github.com/fasthttp/router)
-    * [gramework](https://github.com/gramework/gramework)
-    * [lu](https://github.com/vincentLiuxiang/lu)
-    * [atreugo](https://github.com/savsgio/atreugo)
-    * [Fiber](https://github.com/gofiber/fiber)
-    * [Gearbox](https://github.com/gogearbox/gearbox)
-
-  See also [this issue](https://github.com/valyala/fasthttp/issues/9) for more info.
+  - [fasthttp-routing](https://github.com/qiangxue/fasthttp-routing)
+  - [router](https://github.com/fasthttp/router)
+  - [gramework](https://github.com/gramework/gramework)
+  - [lu](https://github.com/vincentLiuxiang/lu)
+  - [atreugo](https://github.com/savsgio/atreugo)
+  - [Fiber](https://github.com/gofiber/fiber)
+  - [Gearbox](https://github.com/gogearbox/gearbox)
 
-* *I detected data race in fasthttp!*
+- _I detected data race in fasthttp!_
 
   Cool! [File a bug](https://github.com/valyala/fasthttp/issues/new). But before
   doing this check the following in your code:
 
-  * Make sure there are no references to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx)
-  or to its' members after returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
-  * Make sure you call [TimeoutError](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.TimeoutError)
-  before returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler)
-  if there are references to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx)
-  or to its' members, which may be accessed by other goroutines.
+  - Make sure there are no references to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx)
+    or to its' members after returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler).
+  - Make sure you call [TimeoutError](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx.TimeoutError)
+    before returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler)
+    if there are references to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx)
+    or to its' members, which may be accessed by other goroutines.
 
-* *I didn't find an answer for my question here*
+- _I didn't find an answer for my question here_
 
   Try exploring [these questions](https://github.com/valyala/fasthttp/issues?q=label%3Aquestion).

+ 23 - 10
vendor/github.com/valyala/fasthttp/args.go

@@ -4,6 +4,7 @@ import (
 	"bytes"
 	"errors"
 	"io"
+	"iter"
 	"sort"
 	"sync"
 )
@@ -64,12 +65,31 @@ func (a *Args) CopyTo(dst *Args) {
 	dst.args = copyArgs(dst.args, a.args)
 }
 
+// All returns an iterator over key-value pairs from args.
+//
+// The key and value may invalid outside the iteration loop.
+// Make copies if you need to use them after the loop ends.
+func (a *Args) All() iter.Seq2[[]byte, []byte] {
+	return func(yield func([]byte, []byte) bool) {
+		for i := range a.args {
+			if !yield(a.args[i].key, a.args[i].value) {
+				break
+			}
+		}
+	}
+}
+
 // VisitAll calls f for each existing arg.
 //
 // f must not retain references to key and value after returning.
 // Make key and/or value copies if you need storing them after returning.
+//
+// Deprecated: Use All instead.
 func (a *Args) VisitAll(f func(key, value []byte)) {
-	visitArgs(a.args, f)
+	a.All()(func(key, value []byte) bool {
+		f(key, value)
+		return true
+	})
 }
 
 // Len returns the number of query args.
@@ -256,11 +276,11 @@ func (a *Args) PeekBytes(key []byte) []byte {
 // PeekMulti returns all the arg values for the given key.
 func (a *Args) PeekMulti(key string) [][]byte {
 	var values [][]byte
-	a.VisitAll(func(k, v []byte) {
+	for k, v := range a.All() {
 		if string(k) == key {
 			values = append(values, v)
 		}
-	})
+	}
 	return values
 }
 
@@ -349,13 +369,6 @@ func (a *Args) GetBool(key string) bool {
 	}
 }
 
-func visitArgs(args []argsKV, f func(k, v []byte)) {
-	for i, n := 0, len(args); i < n; i++ {
-		kv := &args[i]
-		f(kv.key, kv.value)
-	}
-}
-
 func copyArgs(dst, src []argsKV) []argsKV {
 	if cap(dst) < len(src) {
 		tmp := make([]argsKV, len(src))

+ 0 - 2
vendor/github.com/valyala/fasthttp/b2s_new.go → vendor/github.com/valyala/fasthttp/b2s.go

@@ -1,5 +1,3 @@
-//go:build go1.20
-
 package fasthttp
 
 import "unsafe"

+ 0 - 14
vendor/github.com/valyala/fasthttp/b2s_old.go

@@ -1,14 +0,0 @@
-//go:build !go1.20
-
-package fasthttp
-
-import "unsafe"
-
-// b2s converts byte slice to a string without memory allocation.
-// See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
-//
-// Note it may break if string and/or slice header will change
-// in the future go versions.
-func b2s(b []byte) string {
-	return *(*string)(unsafe.Pointer(&b))
-}

+ 5 - 0
vendor/github.com/valyala/fasthttp/compress.go

@@ -351,6 +351,11 @@ func (w *byteSliceWriter) Write(p []byte) (int, error) {
 	return len(p), nil
 }
 
+func (w *byteSliceWriter) WriteString(s string) (int, error) {
+	w.b = append(w.b, s...)
+	return len(s), nil
+}
+
 type byteSliceReader struct {
 	b []byte
 }

+ 0 - 2
vendor/github.com/valyala/fasthttp/fasthttpadaptor/b2s_new.go → vendor/github.com/valyala/fasthttp/fasthttpadaptor/b2s.go

@@ -1,5 +1,3 @@
-//go:build go1.20
-
 package fasthttpadaptor
 
 import "unsafe"

+ 0 - 14
vendor/github.com/valyala/fasthttp/fasthttpadaptor/b2s_old.go

@@ -1,14 +0,0 @@
-//go:build !go1.20
-
-package fasthttpadaptor
-
-import "unsafe"
-
-// b2s converts byte slice to a string without memory allocation.
-// See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
-//
-// Note it may break if string and/or slice header will change
-// in the future go versions.
-func b2s(b []byte) string {
-	return *(*string)(unsafe.Pointer(&b))
-}

+ 2 - 2
vendor/github.com/valyala/fasthttp/fasthttpadaptor/request.go

@@ -51,7 +51,7 @@ func ConvertRequest(ctx *fasthttp.RequestCtx, r *http.Request, forServer bool) e
 		}
 	}
 
-	ctx.Request.Header.VisitAll(func(k, v []byte) {
+	for k, v := range ctx.Request.Header.All() {
 		sk := b2s(k)
 		sv := b2s(v)
 
@@ -64,7 +64,7 @@ func ConvertRequest(ctx *fasthttp.RequestCtx, r *http.Request, forServer bool) e
 			}
 			r.Header.Set(sk, sv)
 		}
-	})
+	}
 
 	return nil
 }

+ 4 - 0
vendor/github.com/valyala/fasthttp/fasthttputil/pipeconns.go

@@ -142,6 +142,10 @@ func (c *pipeConn) Write(p []byte) (int, error) {
 	return len(p), nil
 }
 
+func (c *pipeConn) WriteString(s string) (int, error) {
+	return c.Write(s2b(s))
+}
+
 func (c *pipeConn) Read(p []byte) (int, error) {
 	mayBlock := true
 	nn := 0

+ 8 - 0
vendor/github.com/valyala/fasthttp/fasthttputil/s2b.go

@@ -0,0 +1,8 @@
+package fasthttputil
+
+import "unsafe"
+
+// s2b converts string to a byte slice without memory allocation.
+func s2b(s string) []byte {
+	return unsafe.Slice(unsafe.StringData(s), len(s))
+}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 313 - 387
vendor/github.com/valyala/fasthttp/header.go


+ 109 - 5
vendor/github.com/valyala/fasthttp/http.go

@@ -45,7 +45,8 @@ type Request struct {
 	multipartForm         *multipart.Form
 	multipartFormBoundary string
 
-	postArgs Args
+	postArgs   Args
+	userValues userData
 
 	bodyRaw []byte
 
@@ -377,6 +378,11 @@ func (w *responseBodyWriter) Write(p []byte) (int, error) {
 	return len(p), nil
 }
 
+func (w *responseBodyWriter) WriteString(s string) (int, error) {
+	w.r.AppendBodyString(s)
+	return len(s), nil
+}
+
 type requestBodyWriter struct {
 	r *Request
 }
@@ -386,6 +392,11 @@ func (w *requestBodyWriter) Write(p []byte) (int, error) {
 	return len(p), nil
 }
 
+func (w *requestBodyWriter) WriteString(s string) (int, error) {
+	w.r.AppendBodyString(s)
+	return len(s), nil
+}
+
 func (resp *Response) ParseNetConn(conn net.Conn) {
 	resp.raddr = conn.RemoteAddr()
 	resp.laddr = conn.LocalAddr()
@@ -1119,6 +1130,7 @@ func readMultipartForm(r io.Reader, boundary string, size, maxInMemoryFileSize i
 
 // Reset clears request contents.
 func (req *Request) Reset() {
+	req.userValues.Reset() // it should be at the top, since some values might implement io.Closer interface
 	if requestBodyPoolSizeLimit >= 0 && req.body != nil {
 		req.ReleaseBody(requestBodyPoolSizeLimit)
 	}
@@ -1279,7 +1291,7 @@ func (req *Request) MayContinue() bool {
 // then ErrBodyTooLarge is returned.
 func (req *Request) ContinueReadBody(r *bufio.Reader, maxBodySize int, preParseMultipartForm ...bool) error {
 	var err error
-	contentLength := req.Header.realContentLength()
+	contentLength := req.Header.ContentLength()
 	if contentLength > 0 {
 		if maxBodySize > 0 && contentLength > maxBodySize {
 			return ErrBodyTooLarge
@@ -1362,7 +1374,7 @@ func (req *Request) ReadBody(r *bufio.Reader, contentLength, maxBodySize int) (e
 // then ErrBodyTooLarge is returned.
 func (req *Request) ContinueReadBodyStream(r *bufio.Reader, maxBodySize int, preParseMultipartForm ...bool) error {
 	var err error
-	contentLength := req.Header.realContentLength()
+	contentLength := req.Header.ContentLength()
 	if contentLength > 0 {
 		if len(preParseMultipartForm) == 0 || preParseMultipartForm[0] {
 			// Pre-read multipart form data of known length.
@@ -1486,8 +1498,12 @@ func (resp *Response) ReadBody(r *bufio.Reader, maxBodySize int) (err error) {
 			bodyBuf.B, err = readBodyChunked(r, maxBodySize, bodyBuf.B)
 		}
 	default:
-		bodyBuf.B, err = readBodyIdentity(r, maxBodySize, bodyBuf.B)
-		resp.Header.SetContentLength(len(bodyBuf.B))
+		if resp.StreamBody {
+			resp.bodyStream = acquireRequestStream(bodyBuf, r, &resp.Header)
+		} else {
+			bodyBuf.B, err = readBodyIdentity(r, maxBodySize, bodyBuf.B)
+			resp.Header.SetContentLength(len(bodyBuf.B))
+		}
 	}
 	if err == nil && resp.StreamBody && resp.bodyStream == nil {
 		resp.bodyStream = bytes.NewReader(bodyBuf.B)
@@ -1538,6 +1554,12 @@ func (w *statsWriter) Write(p []byte) (int, error) {
 	return n, err
 }
 
+func (w *statsWriter) WriteString(s string) (int, error) {
+	n, err := w.w.Write(s2b(s))
+	w.bytesWritten += int64(n)
+	return n, err
+}
+
 func acquireStatsWriter(w io.Writer) *statsWriter {
 	v := statsWriterPool.Get()
 	if v == nil {
@@ -1963,6 +1985,10 @@ func (w *flushWriter) Write(p []byte) (int, error) {
 	return n, nil
 }
 
+func (w *flushWriter) WriteString(s string) (int, error) {
+	return w.Write(s2b(s))
+}
+
 // Write writes response to w.
 //
 // Write doesn't flush response to w for performance reasons.
@@ -2136,6 +2162,84 @@ func (resp *Response) String() string {
 	return getHTTPString(resp)
 }
 
+// SetUserValue stores the given value (arbitrary object)
+// under the given key in Request.
+//
+// The value stored in Request may be obtained by UserValue*.
+//
+// This functionality may be useful for passing arbitrary values between
+// functions involved in request processing.
+//
+// All the values are removed from Request after returning from the top
+// RequestHandler. Additionally, Close method is called on each value
+// implementing io.Closer before removing the value from Request.
+func (req *Request) SetUserValue(key, value any) {
+	req.userValues.Set(key, value)
+}
+
+// SetUserValueBytes stores the given value (arbitrary object)
+// under the given key in Request.
+//
+// The value stored in Request may be obtained by UserValue*.
+//
+// This functionality may be useful for passing arbitrary values between
+// functions involved in request processing.
+//
+// All the values stored in Request are deleted after returning from RequestHandler.
+func (req *Request) SetUserValueBytes(key []byte, value any) {
+	req.userValues.SetBytes(key, value)
+}
+
+// UserValue returns the value stored via SetUserValue* under the given key.
+func (req *Request) UserValue(key any) any {
+	return req.userValues.Get(key)
+}
+
+// UserValueBytes returns the value stored via SetUserValue*
+// under the given key.
+func (req *Request) UserValueBytes(key []byte) any {
+	return req.userValues.GetBytes(key)
+}
+
+// VisitUserValues calls visitor for each existing userValue with a key that is a string or []byte.
+//
+// visitor must not retain references to key and value after returning.
+// Make key and/or value copies if you need storing them after returning.
+func (req *Request) VisitUserValues(visitor func([]byte, any)) {
+	for i, n := 0, len(req.userValues); i < n; i++ {
+		kv := &req.userValues[i]
+		if _, ok := kv.key.(string); ok {
+			visitor(s2b(kv.key.(string)), kv.value)
+		}
+	}
+}
+
+// VisitUserValuesAll calls visitor for each existing userValue.
+//
+// visitor must not retain references to key and value after returning.
+// Make key and/or value copies if you need storing them after returning.
+func (req *Request) VisitUserValuesAll(visitor func(any, any)) {
+	for i, n := 0, len(req.userValues); i < n; i++ {
+		kv := &req.userValues[i]
+		visitor(kv.key, kv.value)
+	}
+}
+
+// ResetUserValues allows to reset user values from Request Context.
+func (req *Request) ResetUserValues() {
+	req.userValues.Reset()
+}
+
+// RemoveUserValue removes the given key and the value under it in Request.
+func (req *Request) RemoveUserValue(key any) {
+	req.userValues.Remove(key)
+}
+
+// RemoveUserValueBytes removes the given key and the value under it in Request.
+func (req *Request) RemoveUserValueBytes(key []byte) {
+	req.userValues.RemoveBytes(key)
+}
+
 func getHTTPString(hw httpWriter) string {
 	w := bytebufferpool.Get()
 	defer bytebufferpool.Put(w)

+ 24 - 6
vendor/github.com/valyala/fasthttp/peripconn.go

@@ -43,7 +43,8 @@ type perIPConn struct {
 
 	perIPConnCounter *perIPConnCounter
 
-	ip uint32
+	ip   uint32
+	lock sync.Mutex
 }
 
 type perIPTLSConn struct {
@@ -51,7 +52,8 @@ type perIPTLSConn struct {
 
 	perIPConnCounter *perIPConnCounter
 
-	ip uint32
+	ip   uint32
+	lock sync.Mutex
 }
 
 func acquirePerIPConn(conn net.Conn, ip uint32, counter *perIPConnCounter) net.Conn {
@@ -85,17 +87,33 @@ func acquirePerIPConn(conn net.Conn, ip uint32, counter *perIPConnCounter) net.C
 }
 
 func (c *perIPConn) Close() error {
-	err := c.Conn.Close()
-	c.perIPConnCounter.Unregister(c.ip)
+	c.lock.Lock()
+	cc := c.Conn
 	c.Conn = nil
+	c.lock.Unlock()
+
+	if cc == nil {
+		return nil
+	}
+
+	err := cc.Close()
+	c.perIPConnCounter.Unregister(c.ip)
 	c.perIPConnCounter.perIPConnPool.Put(c)
 	return err
 }
 
 func (c *perIPTLSConn) Close() error {
-	err := c.Conn.Close()
-	c.perIPConnCounter.Unregister(c.ip)
+	c.lock.Lock()
+	cc := c.Conn
 	c.Conn = nil
+	c.lock.Unlock()
+
+	if cc == nil {
+		return nil
+	}
+
+	err := cc.Close()
+	c.perIPConnCounter.Unregister(c.ip)
 	c.perIPConnCounter.perIPTLSConnPool.Put(c)
 	return err
 }

BIN
vendor/github.com/valyala/fasthttp/request_body.zst


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно