diff --git a/go.mod b/go.mod index 87552e9146..708c791c28 100644 --- a/go.mod +++ b/go.mod @@ -6,18 +6,18 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8 github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66 - github.com/CortexFoundation/torrentfs v1.0.56-0.20231207113153-4ead5e1fb6d9 + github.com/CortexFoundation/torrentfs v1.0.56-0.20231209192839-e28c596da6b3 github.com/VictoriaMetrics/fastcache v1.12.2 github.com/arsham/figurine v1.3.0 - github.com/aws/aws-sdk-go-v2 v1.23.5 - github.com/aws/aws-sdk-go-v2/config v1.25.12 - github.com/aws/aws-sdk-go-v2/credentials v1.16.10 - github.com/aws/aws-sdk-go-v2/service/route53 v1.35.3 + github.com/aws/aws-sdk-go-v2 v1.24.0 + github.com/aws/aws-sdk-go-v2/config v1.26.1 + github.com/aws/aws-sdk-go-v2/credentials v1.16.12 + github.com/aws/aws-sdk-go-v2/service/route53 v1.35.5 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/cespare/cp v1.1.1 github.com/charmbracelet/bubbletea v0.24.2 github.com/cloudflare/cloudflare-go v0.57.1 - github.com/cockroachdb/pebble v0.0.0-20231206233349-b3f359e3a503 + github.com/cockroachdb/pebble v0.0.0-20231208175357-58bdc725addc github.com/consensys/gnark-crypto v0.12.1 github.com/crate-crypto/go-kzg-4844 v0.7.0 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc @@ -106,21 +106,21 @@ require ( github.com/antlabs/timer v0.0.11 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/arsham/rainbow v1.2.1 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.18.3 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.26.3 // indirect - github.com/aws/smithy-go v1.18.1 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 // indirect + github.com/aws/smithy-go v1.19.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/immutable v0.4.3 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.11.0 // indirect + github.com/bits-and-blooms/bitset v1.12.0 // indirect github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -178,7 +178,7 @@ require ( github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/naoina/go-stringutil v0.1.0 // indirect - github.com/nutsdb/nutsdb v1.0.2-0.20231206130847-727ec20a08fb // indirect + github.com/nutsdb/nutsdb v1.0.2-0.20231209035901-f7c4a82b75c2 // indirect github.com/nxadm/tail v1.4.11 // indirect github.com/oapi-codegen/runtime v1.1.0 // indirect github.com/otiai10/copy v1.14.0 // indirect @@ -189,7 +189,7 @@ require ( github.com/pion/logging v0.2.2 // indirect github.com/pion/mdns v0.0.9 // indirect github.com/pion/randutil v0.1.0 // indirect - github.com/pion/rtcp v1.2.12 // indirect + github.com/pion/rtcp v1.2.13 // indirect github.com/pion/rtp v1.8.3 // indirect github.com/pion/sctp v1.8.9 // indirect github.com/pion/sdp/v3 v3.0.6 // indirect @@ -221,7 +221,7 @@ require ( github.com/tklauser/numcpus v0.7.0 // indirect github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd // indirect github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb // indirect - github.com/ucwong/golang-kv v1.0.23-0.20231207100643-eae46a095003 // indirect + github.com/ucwong/golang-kv v1.0.23-0.20231209094038-056d175d4a78 // indirect github.com/ucwong/shard v1.0.1-0.20230924231639-2ac2d8ab288c // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect @@ -243,5 +243,5 @@ require ( modernc.org/memory v1.7.2 // indirect modernc.org/sqlite v1.27.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect - zombiezen.com/go/sqlite v0.13.1 // indirect + zombiezen.com/go/sqlite v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 7a630064a9..fa5315df94 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66/go.mod h1: github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8/go.mod h1:Ma+tGhPPvz4CEZHaqEJQMOEGOfHeQBiAoNd1zyc/w3Q= github.com/CortexFoundation/torrentfs v1.0.14-0.20200703071639-3fcabcabf274/go.mod h1:qnb3YlIJmuetVBtC6Lsejr0Xru+1DNmDCdTqnwy7lhk= github.com/CortexFoundation/torrentfs v1.0.20-0.20200810031954-d36d26f82fcc/go.mod h1:N5BsicP5ynjXIi/Npl/SRzlJ630n1PJV2sRj0Z0t2HA= -github.com/CortexFoundation/torrentfs v1.0.56-0.20231207113153-4ead5e1fb6d9 h1:JjDC+ozNn1YpbuhTwWi7XDPHzJgjhh7mpazNGof0ZN4= -github.com/CortexFoundation/torrentfs v1.0.56-0.20231207113153-4ead5e1fb6d9/go.mod h1:IquRIXOmJ1mOYMK0Y+33XiINwglYGhyDb33nQTzrcRU= +github.com/CortexFoundation/torrentfs v1.0.56-0.20231209192839-e28c596da6b3 h1:DZnM/6IKv2dAMmahHcIagNzBdNYhgRQgxMTM4+9L+aA= +github.com/CortexFoundation/torrentfs v1.0.56-0.20231209192839-e28c596da6b3/go.mod h1:duBTPeJdG+vf/T1XWtk9uAmik0hLPAoIFdQ0LO6lEcc= github.com/CortexFoundation/wormhole v0.0.2-0.20231018202213-693acd0cc941 h1:2lhbBGb0Q/v2Uk2P1qGWK//jmrZUGROZzME8psO9QNA= github.com/CortexFoundation/wormhole v0.0.2-0.20231018202213-693acd0cc941/go.mod h1:ipzmPabDgzYKUbXkGVe2gTkBEp+MsDx6pXGiuYzmP6s= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -253,34 +253,34 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.30.24/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.23.5 h1:xK6C4udTyDMd82RFvNkDQxtAd00xlzFUtX4fF2nMZyg= -github.com/aws/aws-sdk-go-v2 v1.23.5/go.mod h1:t3szzKfP0NeRU27uBFczDivYJjsmSnqI8kIvKyWb9ds= -github.com/aws/aws-sdk-go-v2/config v1.25.12 h1:mF4cMuNh/2G+d19nWnm1vJ/ak0qK6SbqF0KtSX9pxu0= -github.com/aws/aws-sdk-go-v2/config v1.25.12/go.mod h1:lOvvqtZP9p29GIjOTuA/76HiVk0c/s8qRcFRq2+E2uc= -github.com/aws/aws-sdk-go-v2/credentials v1.16.10 h1:VmRkuoKaGl2ZDNGkkRQgw80Hxj1Bb9a+bsT5shqlCwo= -github.com/aws/aws-sdk-go-v2/credentials v1.16.10/go.mod h1:WEn22lpd50buTs/TDqywytW5xQ2zPOMbYipIlqI6xXg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9 h1:FZVFahMyZle6WcogZCOxo6D/lkDA2lqKIn4/ueUmVXw= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9/go.mod h1:kjq7REMIkxdtcEC9/4BVXjOsNY5isz6jQbEgk6osRTU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8 h1:8GVZIR0y6JRIUNSYI1xAMF4HDfV8H/bOsZ/8AD/uY5Q= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8/go.mod h1:rwBfu0SoUkBUZndVgPZKAD9Y2JigaZtRP68unRiYToQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8 h1:ZE2ds/qeBkhk3yqYvS3CDCFNvd9ir5hMjlVStLZWrvM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8/go.mod h1:/lAPPymDYL023+TS6DJmjuL42nxix2AvEvfjqOBRODk= -github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 h1:uR9lXYjdPX0xY+NhvaJ4dD8rpSRz5VY81ccIIoNG+lw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3 h1:e3PCNeEaev/ZF01cQyNZgmYE9oYYePIMJs2mWSKG514= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3/go.mod h1:gIeeNyaL8tIEqZrzAnTeyhHcE0yysCtcaP+N9kxLZ+E= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8 h1:EamsKe+ZjkOQjDdHd86/JCEucjFKQ9T0atWKO4s2Lgs= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8/go.mod h1:Q0vV3/csTpbkfKLI5Sb56cJQTCTtJ0ixdb7P+Wedqiw= -github.com/aws/aws-sdk-go-v2/service/route53 v1.35.3 h1:C7lf4Y/SuqEZbTrHx4YCOEMR5rJsUy7RKSBDZ72wH84= -github.com/aws/aws-sdk-go-v2/service/route53 v1.35.3/go.mod h1:D58n83ihSAC0wtkcvU6PavqmO839sqYQ+HvpqbD7tKE= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.3 h1:wKspi1zc2ZVcgZEu3k2Mt4zGKQSoZTftsoUTLsYPcVo= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.3/go.mod h1:zxk6y1X2KXThESWMS5CrKRvISD8mbIMab6nZrCGxDG0= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.3 h1:CxAHBS0BWSUqI7qzXHc2ZpTeHaM9JNnWJ9BN6Kmo2CY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.3/go.mod h1:7Lt5mjQ8x5rVdKqg+sKKDeuwoszDJIIPmkd8BVsEdS0= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.3 h1:KfREzajmHCSYjCaMRtdLr9boUMA7KPpoPApitPlbNeo= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.3/go.mod h1:7Ld9eTqocTvJqqJ5K/orbSDwmGcpRdlDiLjz2DO+SL8= -github.com/aws/smithy-go v1.18.1 h1:pOdBTUfXNazOlxLrgeYalVnuTpKreACHtc62xLwIB3c= -github.com/aws/smithy-go v1.18.1/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/aws/aws-sdk-go-v2 v1.24.0 h1:890+mqQ+hTpNuw0gGP6/4akolQkSToDJgHfQE7AwGuk= +github.com/aws/aws-sdk-go-v2 v1.24.0/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= +github.com/aws/aws-sdk-go-v2/config v1.26.1 h1:z6DqMxclFGL3Zfo+4Q0rLnAZ6yVkzCRxhRMsiRQnD1o= +github.com/aws/aws-sdk-go-v2/config v1.26.1/go.mod h1:ZB+CuKHRbb5v5F0oJtGdhFTelmrxd4iWO1lf0rQwSAg= +github.com/aws/aws-sdk-go-v2/credentials v1.16.12 h1:v/WgB8NxprNvr5inKIiVVrXPuuTegM+K8nncFkr1usU= +github.com/aws/aws-sdk-go-v2/credentials v1.16.12/go.mod h1:X21k0FjEJe+/pauud82HYiQbEr9jRKY3kXEIQ4hXeTQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 h1:v+HbZaCGmOwnTTVS86Fleq0vPzOd7tnJGbFhP0stNLs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9/go.mod h1:Xjqy+Nyj7VDLBtCMkQYOw1QYfAEZCVLrfI0ezve8wd4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 h1:N94sVhRACtXyVcjXxrwK1SKFIJrA9pOJ5yu2eSHnmls= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9/go.mod h1:hqamLz7g1/4EJP+GH5NBhcUMLjW+gKLQabgyz6/7WAU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJR8CSImIVCONRi4g0Su3J+TSTbS7G0pUeMU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= +github.com/aws/aws-sdk-go-v2/service/route53 v1.35.5 h1:WVQIKVwv56JY+I0b2fFeRGCTSi/Xupa87z7y8HZ6l5g= +github.com/aws/aws-sdk-go-v2/service/route53 v1.35.5/go.mod h1:F9El48+5Tf+TkYJB/6M9H7oqXw9Mr9eVetwJ6SUql7g= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 h1:5UYvv8JUvllZsRnfrcMQ+hJ9jNICmcgKPAO1CER25Wg= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.5/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= +github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= +github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= @@ -295,8 +295,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.1-0.20200416141419-39a59b1b2866/go.mod h1:bXegrmTNBg3jTbSwV0BSBcSSfHHctupCgavZr/gX5fo= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bits-and-blooms/bitset v1.11.0 h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k= -github.com/bits-and-blooms/bitset v1.11.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA= +github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= @@ -355,8 +355,8 @@ github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZe github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231206233349-b3f359e3a503 h1:74XzstxD8al9E66380bukxBm9U1Rw3RP3DfTVlhndqo= -github.com/cockroachdb/pebble v0.0.0-20231206233349-b3f359e3a503/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v0.0.0-20231208175357-58bdc725addc h1:+u38Jdm52Efr8nHmctIkIoFPfUzRIqliJWGjHaR1K/0= +github.com/cockroachdb/pebble v0.0.0-20231208175357-58bdc725addc/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= @@ -895,8 +895,8 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/nutsdb/nutsdb v1.0.2-0.20231206130847-727ec20a08fb h1:IKmXeUtqQcLwwqL9aeRgGebXgY2zw/L4ts1ku/kTyKc= -github.com/nutsdb/nutsdb v1.0.2-0.20231206130847-727ec20a08fb/go.mod h1:6inOji9rFBporXeHDjJny4g50RpQbkjSK5jI1hht0j8= +github.com/nutsdb/nutsdb v1.0.2-0.20231209035901-f7c4a82b75c2 h1:dQkZuf4gSZYpseqBViypj5SnqqmWehx5TdQxqdNRO9Y= +github.com/nutsdb/nutsdb v1.0.2-0.20231209035901-f7c4a82b75c2/go.mod h1:jIbbpBXajzTMZ0o33Yn5zoYIo3v0Dz4WstkVce+sYuQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= @@ -988,8 +988,9 @@ github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= github.com/pion/rtcp v1.2.1/go.mod h1:a5dj2d6BKIKHl43EnAOIrCczcjESrtPuMgfmL6/K6QM= github.com/pion/rtcp v1.2.10/go.mod h1:ztfEwXZNLGyF1oQDttz/ZKIBaeeg/oWbRYqzBM9TL1I= -github.com/pion/rtcp v1.2.12 h1:bKWiX93XKgDZENEXCijvHRU/wRifm6JV5DGcH6twtSM= github.com/pion/rtcp v1.2.12/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= +github.com/pion/rtcp v1.2.13 h1:+EQijuisKwm/8VBs8nWllr0bIndR7Lf7cZG200mpbNo= +github.com/pion/rtcp v1.2.13/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= github.com/pion/rtp v1.3.2/go.mod h1:q9wPnA96pu2urCcW/sK/RiDn597bhGoAQQ+y2fDwHuY= github.com/pion/rtp v1.4.0/go.mod h1:/l4cvcKd0D3u9JLs2xSVI95YkfXW87a3br3nqmVtSlE= github.com/pion/rtp v1.8.2/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= @@ -1249,8 +1250,8 @@ github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd h1:gBtlvLAsgLk+ github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd/go.mod h1:ddwX+NCjMZPdpzcGh1fcEbNTUTCtKgt2hC2rqvmLKgA= github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb h1:dVZH3AH9f7zB3VBmsjn25B7lfcAyMP4QxdFYTrfj7tg= github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb/go.mod h1:3yswsBsVuwsOjDvFfC5Na9XSEf4HC7mj3W3g6jvSY/s= -github.com/ucwong/golang-kv v1.0.23-0.20231207100643-eae46a095003 h1:Z6u0UKPdAVT49mpnwzsgg90gh+omhrTUfzVpF8RHgAE= -github.com/ucwong/golang-kv v1.0.23-0.20231207100643-eae46a095003/go.mod h1:Tic4PkUrF25C6DPA8aSyzZE7WQtc+P8+tGpXGmDvQYI= +github.com/ucwong/golang-kv v1.0.23-0.20231209094038-056d175d4a78 h1:REUDgiVCtP/oWYjaKtYJAT+/0IG+JtWRvoEbrDf+tis= +github.com/ucwong/golang-kv v1.0.23-0.20231209094038-056d175d4a78/go.mod h1:vvoIDmHn9RX8EN1ODqtTJlhltmme3xs7Gssvl4yeM7E= github.com/ucwong/golang-set v1.8.1-0.20200419153428-d7b0b1ac2d43/go.mod h1:xu0FaiQFGbBcFZj2o7udZ5rbA8jRTsv47hkPoG5qQNM= github.com/ucwong/goleveldb v1.0.3-0.20200508074755-578cba616f37/go.mod h1:dgJUTtDxq/ne6/JzZhHzF24OL/uqILz9IWk8HmT4V2g= github.com/ucwong/goleveldb v1.0.3-0.20200618184106-f1c6bc3a428b/go.mod h1:7Sq6w7AfEZuB/a6mrlvHCSXCSkqojCMMrM3Ei12QAT0= @@ -1811,5 +1812,5 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= -zombiezen.com/go/sqlite v0.13.1 h1:qDzxyWWmMtSSEH5qxamqBFmqA2BLSSbtODi3ojaE02o= -zombiezen.com/go/sqlite v0.13.1/go.mod h1:Ht/5Rg3Ae2hoyh1I7gbWtWAl89CNocfqeb/aAMTkJr4= +zombiezen.com/go/sqlite v1.0.0 h1:D2EvOZqumJBy+6t+0uNTTXnepUpB/pKG45op/UziI1o= +zombiezen.com/go/sqlite v1.0.0/go.mod h1:Yx7FJ77tr7Ucwi5solhXAxpflyxk/BHNXArZ/JvDm60= diff --git a/vendor/github.com/CortexFoundation/torrentfs/params/chain.go b/vendor/github.com/CortexFoundation/torrentfs/params/chain.go index 445fcfa963..80eb6f1086 100644 --- a/vendor/github.com/CortexFoundation/torrentfs/params/chain.go +++ b/vendor/github.com/CortexFoundation/torrentfs/params/chain.go @@ -44,7 +44,7 @@ var ( TfsRoot: common.HexToHash("0xe78706dbcc1f853336a31a3e3f55dcb3d0d082fb8fd4b4b273fe859d657e5dcc"), Skips: []Skip{ - {From: 1039, To: 4468}, {From: 5515, To: 10888}, {From: 10888, To: 137784}, {From: 137790, To: 156609}, {From: 160264, To: 395088}, {From: 395964, To: 1261969}, {From: 1261969, To: 1988320}, {From: 1988320, To: 2107911}, {From: 2108043, To: 2270725}, {From: 2270777, To: 2754916}, {From: 2755628, To: 5320722}, {From: 5320722, To: 5605351}, {From: 5605351, To: 5707301}, {From: 5707301, To: 6967375}, {From: 6967493, To: 9633792}, + {From: 1039, To: 4468}, {From: 5515, To: 10888}, {From: 10888, To: 137784}, {From: 137790, To: 156609}, {From: 160264, To: 395088}, {From: 395964, To: 1261969}, {From: 1261969, To: 1988320}, {From: 1988320, To: 2107911}, {From: 2108043, To: 2270725}, {From: 2270777, To: 2754916}, {From: 2755628, To: 5320722}, {From: 5320722, To: 5605351}, {From: 5605351, To: 5707301}, {From: 5707301, To: 6967375}, {From: 6967493, To: 9764864}, }, } ) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go index b361c13867..1ee54cfe0f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go @@ -150,6 +150,18 @@ type Config struct { // BaseEndpoint is an intermediary transfer location to a service specific // BaseEndpoint on a service's Options. BaseEndpoint *string + + // DisableRequestCompression toggles if an operation request could be + // compressed or not. Will be set to false by default. This variable is sourced from + // environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute + // disable_request_compression + DisableRequestCompression bool + + // RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be + // compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively. + // This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or + // the shared config profile attribute request_min_compression_size_bytes + RequestMinCompressSizeBytes int64 } // NewConfig returns a new Config pointer that can be chained with builder diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index c760c48e3d..9a844f30e5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.23.5" +const goModuleVersion = "1.24.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index 4025af49cf..79eae3632e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,13 @@ +# v1.26.1 (2023-12-08) + +* **Bug Fix**: Correct loading of [services *] sections into shared config. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-12-07) + +* **Feature**: Support modeled request compression. The only algorithm supported at this time is `gzip`. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.25.12 (2023-12-06) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go index dfe6297322..50582d89d5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go @@ -70,10 +70,16 @@ var defaultAWSConfigResolvers = []awsConfigResolver{ // httpBearerAuth authentication scheme. resolveBearerAuthToken, - // Sets the sdk app ID if present in shared config profile + // Sets the sdk app ID if present in env var or shared config profile resolveAppID, resolveBaseEndpoint, + + // Sets the DisableRequestCompression if present in env var or shared config profile + resolveDisableRequestCompression, + + // Sets the RequestMinCompressSizeBytes if present in env var or shared config profile + resolveRequestMinCompressSizeBytes, } // A Config represents a generic configuration value or set of values. This type diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go index fb0615aeb4..88550198cc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" ) // CredentialsSourceName provides a name of the provider when config is @@ -75,6 +76,9 @@ const ( awsIgnoreConfiguredEndpoints = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS" awsEndpointURL = "AWS_ENDPOINT_URL" + awsDisableRequestCompression = "AWS_DISABLE_REQUEST_COMPRESSION" + awsRequestMinCompressionSizeBytes = "AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES" + awsS3DisableExpressSessionAuthEnv = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH" ) @@ -271,6 +275,15 @@ type EnvConfig struct { // corresponding endpoint resolution field. BaseEndpoint string + // determine if request compression is allowed, default to false + // retrieved from env var AWS_DISABLE_REQUEST_COMPRESSION + DisableRequestCompression *bool + + // inclusive threshold request body size to trigger compression, + // default to 10240 and must be within 0 and 10485760 bytes inclusive + // retrieved from env var AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES + RequestMinCompressSizeBytes *int64 + // Whether S3Express auth is disabled. // // This will NOT prevent requests from being made to S3Express buckets, it @@ -319,6 +332,13 @@ func NewEnvConfig() (EnvConfig, error) { cfg.AppID = os.Getenv(awsSdkAppID) + if err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompression}); err != nil { + return cfg, err + } + if err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytes}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil { + return cfg, err + } + if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvVar}); err != nil { return cfg, err } @@ -383,6 +403,20 @@ func (c EnvConfig) getAppID(context.Context) (string, bool, error) { return c.AppID, len(c.AppID) > 0, nil } +func (c EnvConfig) getDisableRequestCompression(context.Context) (bool, bool, error) { + if c.DisableRequestCompression == nil { + return false, false, nil + } + return *c.DisableRequestCompression, true, nil +} + +func (c EnvConfig) getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) { + if c.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *c.RequestMinCompressSizeBytes, true, nil +} + // GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified, // and not 0. func (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { @@ -639,6 +673,30 @@ func setBoolPtrFromEnvVal(dst **bool, keys []string) error { return nil } +func setInt64PtrFromEnvVal(dst **int64, keys []string, max int64) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return fmt.Errorf("invalid value for env var, %s=%s, need int64", k, value) + } else if v < 0 || v > max { + return fmt.Errorf("invalid range for env var min request compression size bytes %q, must be within 0 and 10485760 inclusively", v) + } + if *dst == nil { + *dst = new(int64) + } + + **dst = v + break + } + + return nil +} + func setEndpointDiscoveryTypeFromEnvVal(dst *aws.EndpointDiscoveryEnableState, keys []string) error { for _, k := range keys { value := os.Getenv(k) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 6ba8825bfe..b7c325d3ea 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.25.12" +const goModuleVersion = "1.26.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go index 25c05a5536..06596c1b7c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go @@ -207,6 +207,12 @@ type LoadOptions struct { // The sdk app ID retrieved from env var or shared config to be added to request user agent header AppID string + // Specifies whether an operation request could be compressed + DisableRequestCompression *bool + + // The inclusive min bytes of a request body that could be compressed + RequestMinCompressSizeBytes *int64 + // Whether S3 Express auth is disabled. S3DisableExpressAuth *bool } @@ -256,6 +262,22 @@ func (o LoadOptions) getAppID(ctx context.Context) (string, bool, error) { return o.AppID, len(o.AppID) > 0, nil } +// getDisableRequestCompression returns DisableRequestCompression from config's LoadOptions +func (o LoadOptions) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { + if o.DisableRequestCompression == nil { + return false, false, nil + } + return *o.DisableRequestCompression, true, nil +} + +// getRequestMinCompressSizeBytes returns RequestMinCompressSizeBytes from config's LoadOptions +func (o LoadOptions) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { + if o.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *o.RequestMinCompressSizeBytes, true, nil +} + // WithRegion is a helper function to construct functional options // that sets Region on config's LoadOptions. Setting the region to // an empty string, will result in the region value being ignored. @@ -277,6 +299,30 @@ func WithAppID(ID string) LoadOptionsFunc { } } +// WithDisableRequestCompression is a helper function to construct functional options +// that sets DisableRequestCompression on config's LoadOptions. +func WithDisableRequestCompression(DisableRequestCompression *bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + if DisableRequestCompression == nil { + return nil + } + o.DisableRequestCompression = DisableRequestCompression + return nil + } +} + +// WithRequestMinCompressSizeBytes is a helper function to construct functional options +// that sets RequestMinCompressSizeBytes on config's LoadOptions. +func WithRequestMinCompressSizeBytes(RequestMinCompressSizeBytes *int64) LoadOptionsFunc { + return func(o *LoadOptions) error { + if RequestMinCompressSizeBytes == nil { + return nil + } + o.RequestMinCompressSizeBytes = RequestMinCompressSizeBytes + return nil + } +} + // getDefaultRegion returns DefaultRegion from config's LoadOptions func (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) { if len(o.DefaultRegion) == 0 { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go index d523584601..13745fc98f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go @@ -191,6 +191,40 @@ func getAppID(ctx context.Context, configs configs) (value string, found bool, e return } +// disableRequestCompressionProvider provides access to the DisableRequestCompression +type disableRequestCompressionProvider interface { + getDisableRequestCompression(context.Context) (bool, bool, error) +} + +func getDisableRequestCompression(ctx context.Context, configs configs) (value bool, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(disableRequestCompressionProvider); ok { + value, found, err = p.getDisableRequestCompression(ctx) + if err != nil || found { + break + } + } + } + return +} + +// requestMinCompressSizeBytesProvider provides access to the MinCompressSizeBytes +type requestMinCompressSizeBytesProvider interface { + getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) +} + +func getRequestMinCompressSizeBytes(ctx context.Context, configs configs) (value int64, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(requestMinCompressSizeBytesProvider); ok { + value, found, err = p.getRequestMinCompressSizeBytes(ctx) + if err != nil || found { + break + } + } + } + return +} + // ec2IMDSRegionProvider provides access to the ec2 imds region // configuration value type ec2IMDSRegionProvider interface { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go index b3b2c93cdc..fde2e3980e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go @@ -139,6 +139,33 @@ func resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error { return nil } +// resolveDisableRequestCompression extracts the DisableRequestCompression from the configs slice's +// SharedConfig or EnvConfig +func resolveDisableRequestCompression(ctx context.Context, cfg *aws.Config, configs configs) error { + disable, _, err := getDisableRequestCompression(ctx, configs) + if err != nil { + return err + } + + cfg.DisableRequestCompression = disable + return nil +} + +// resolveRequestMinCompressSizeBytes extracts the RequestMinCompressSizeBytes from the configs slice's +// SharedConfig or EnvConfig +func resolveRequestMinCompressSizeBytes(ctx context.Context, cfg *aws.Config, configs configs) error { + minBytes, found, err := getRequestMinCompressSizeBytes(ctx, configs) + if err != nil { + return err + } + // must set a default min size 10240 if not configured + if !found { + minBytes = 10240 + } + cfg.RequestMinCompressSizeBytes = minBytes + return nil +} + // resolveDefaultRegion extracts the first instance of a default region and sets `aws.Config.Region` to the default // region if region had not been resolved from other sources. func resolveDefaultRegion(ctx context.Context, cfg *aws.Config, configs configs) error { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go index 823eafe12b..c546cb7d0f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go @@ -17,6 +17,7 @@ import ( "github.com/aws/aws-sdk-go-v2/internal/ini" "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" "github.com/aws/smithy-go/logging" + smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" ) const ( @@ -30,7 +31,7 @@ const ( // Prefix for services section. It is referenced in profile via the services // parameter to configure clients for service-specific parameters. - servicesPrefix = `services` + servicesPrefix = `services ` // string equivalent for boolean endpointDiscoveryDisabled = `false` @@ -108,6 +109,11 @@ const ( endpointURL = "endpoint_url" + servicesSectionKey = "services" + + disableRequestCompression = "disable_request_compression" + requestMinCompressionSizeBytes = "request_min_compression_size_bytes" + s3DisableExpressSessionAuthKey = "s3_disable_express_session_auth" ) @@ -316,8 +322,18 @@ type SharedConfig struct { // corresponding endpoint resolution field. BaseEndpoint string - // Value to contain services section content. - Services Services + // Services section config. + ServicesSectionName string + Services Services + + // determine if request compression is allowed, default to false + // retrieved from config file's profile field disable_request_compression + DisableRequestCompression *bool + + // inclusive threshold request body size to trigger compression, + // default to 10240 and must be within 0 and 10485760 bytes inclusive + // retrieved from config file's profile field request_min_compression_size_bytes + RequestMinCompressSizeBytes *int64 // Whether S3Express auth is disabled. // @@ -994,14 +1010,11 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile c.SSOSession = &ssoSession } - for _, sectionName := range sections.List() { - if strings.HasPrefix(sectionName, servicesPrefix) { - section, ok := sections.GetSection(sectionName) - if ok { - var svcs Services - svcs.setFromIniSection(section) - c.Services = svcs - } + if len(c.ServicesSectionName) > 0 { + if section, ok := sections.GetSection(servicesPrefix + c.ServicesSectionName); ok { + var svcs Services + svcs.setFromIniSection(section) + c.Services = svcs } } @@ -1104,6 +1117,13 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er updateString(&c.BaseEndpoint, section, endpointURL) + if err := updateDisableRequestCompression(&c.DisableRequestCompression, section, disableRequestCompression); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", disableRequestCompression, err) + } + if err := updateRequestMinCompressSizeBytes(&c.RequestMinCompressSizeBytes, section, requestMinCompressionSizeBytes); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", requestMinCompressionSizeBytes, err) + } + // Shared Credentials creds := aws.Credentials{ AccessKeyID: section.String(accessKeyIDKey), @@ -1116,9 +1136,61 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er c.Credentials = creds } + updateString(&c.ServicesSectionName, section, servicesSectionKey) + + return nil +} + +func updateRequestMinCompressSizeBytes(bytes **int64, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v, ok := sec.Int(key) + if !ok { + return fmt.Errorf("invalid value for min request compression size bytes %s, need int64", sec.String(key)) + } + if v < 0 || v > smithyrequestcompression.MaxRequestMinCompressSizeBytes { + return fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", v) + } + *bytes = new(int64) + **bytes = v return nil } +func updateDisableRequestCompression(disable **bool, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v := sec.String(key) + switch { + case v == "true": + *disable = new(bool) + **disable = true + case v == "false": + *disable = new(bool) + **disable = false + default: + return fmt.Errorf("invalid value for shared config profile field, %s=%s, need true or false", key, v) + } + return nil +} + +func (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { + if c.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *c.RequestMinCompressSizeBytes, true, nil +} + +func (c SharedConfig) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { + if c.DisableRequestCompression == nil { + return false, false, nil + } + return *c.DisableRequestCompression, true, nil +} + func updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error { if !section.Has(key) { return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index 14b5af4a3a..dd7af71d18 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.16.12 (2023-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.16.10 (2023-12-06) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 53e3180915..ec3eb5f6e8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.16.10" +const goModuleVersion = "1.16.12" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index 3381934716..eef77e9d5b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.14.10 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.14.9 (2023-12-01) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index 9979479a91..ce3e311186 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.9" +const goModuleVersion = "1.14.10" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index 8ad41847f8..5ceb3b82f4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.2.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.2.8 (2023-12-01) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index 44c5156ac2..da7d0d813e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.2.8" +const goModuleVersion = "1.2.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go index 7ea49d4ea4..849beffd7d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go @@ -11,7 +11,7 @@ func GetPartition(region string) *PartitionConfig { var partitions = []Partition{ { ID: "aws", - RegionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$", + RegionRegex: "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$", DefaultConfig: PartitionConfig{ Name: "aws", DnsSuffix: "amazonaws.com", @@ -90,6 +90,13 @@ var partitions = []Partition{ SupportsFIPS: nil, SupportsDualStack: nil, }, + "ap-southeast-4": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, "aws-global": { Name: nil, DnsSuffix: nil, @@ -160,6 +167,13 @@ var partitions = []Partition{ SupportsFIPS: nil, SupportsDualStack: nil, }, + "il-central-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, "me-central-1": { Name: nil, DnsSuffix: nil, @@ -340,4 +354,28 @@ var partitions = []Partition{ }, }, }, + { + ID: "aws-iso-e", + RegionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-e", + DnsSuffix: "cloud.adc-e.uk", + DualStackDnsSuffix: "cloud.adc-e.uk", + SupportsFIPS: true, + SupportsDualStack: false, + }, + Regions: map[string]RegionOverrides{}, + }, + { + ID: "aws-iso-f", + RegionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-f", + DnsSuffix: "csp.hci.ic.gov", + DualStackDnsSuffix: "csp.hci.ic.gov", + SupportsFIPS: true, + SupportsDualStack: false, + }, + Regions: map[string]RegionOverrides{}, + }, } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 172f622863..761cc992b8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.5.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v2.5.8 (2023-12-01) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index 3f2d708530..caabf668d4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.5.8" +const goModuleVersion = "2.5.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md index 149f7f716d..adbbf4adcf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.7.2 (2023-12-08) + +* **Bug Fix**: Correct loading of [services *] sections into shared config. + # v1.7.1 (2023-11-16) * **Bug Fix**: Fix recognition of trailing comments in shared config properties. # or ; separators that aren't preceded by whitespace at the end of a property value should be considered part of it. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go index 5080ebe68f..f0673f3a02 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -3,4 +3,4 @@ package ini // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.7.1" +const goModuleVersion = "1.7.2" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go index ade75bf34e..e3706b3c31 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go @@ -54,18 +54,7 @@ func (v Value) String() string { // MapValue returns a map value for sub properties func (v Value) MapValue() map[string]string { - newlineParts := strings.Split(string(v.str), "\n") - mp := make(map[string]string) - for _, part := range newlineParts { - operandParts := strings.Split(part, "=") - if len(operandParts) < 2 { - continue - } - key := strings.TrimSpace(operandParts[0]) - val := strings.TrimSpace(operandParts[1]) - mp[key] = val - } - return mp + return v.mp } // IntValue returns an integer value diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md index c2a206b03b..c3525fd229 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.10.4 (2023-12-07) + +* No change notes available for this release. + # v1.10.3 (2023-11-30) * No change notes available for this release. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go index 4a245da296..cc6384005a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -3,4 +3,4 @@ package acceptencoding // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.10.3" +const goModuleVersion = "1.10.4" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 5e433862c3..1191b30c69 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.10.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.10.8 (2023-12-01) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index 2741589866..aacb4dd248 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.10.8" +const goModuleVersion = "1.10.9" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/CHANGELOG.md index 8640325c28..c4c7cacc9b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.35.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.35.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.35.3 (2023-12-06) * **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/api_client.go index e0630a21cf..c12337dedf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/api_client.go @@ -44,6 +44,8 @@ func New(options Options, optFns ...func(*Options)) *Client { setResolvedDefaultsMode(&options) + resolveRetryer(&options) + resolveHTTPClient(&options) resolveHTTPSignerV4(&options) @@ -56,7 +58,7 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - resolveRetryer(&options) + finalizeRetryMaxAttempts(&options) ignoreAnonymousAuth(&options) @@ -89,7 +91,7 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf fn(&options) } - finalizeRetryMaxAttemptOptions(&options, *c) + finalizeOperationRetryMaxAttempts(&options, *c) finalizeClientEndpointResolverOptions(&options) @@ -337,7 +339,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttemptOptions(o *Options, client Client) { +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/go_module_metadata.go index 38b9885676..edce7370e4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/go_module_metadata.go @@ -3,4 +3,4 @@ package route53 // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.35.3" +const goModuleVersion = "1.35.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/options.go index 40915658e1..98b428f625 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/options.go @@ -70,11 +70,9 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. If specified in an operation call's functional - // options with a value that is different than the constructed client's Options, - // the Client's Retryer will be wrapped to use the operation's specific + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index d7a90da832..7a4c30c59c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.18.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.18.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.18.3 (2023-12-06) * **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index 93669a966d..e439699253 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -42,6 +42,8 @@ func New(options Options, optFns ...func(*Options)) *Client { setResolvedDefaultsMode(&options) + resolveRetryer(&options) + resolveHTTPClient(&options) resolveHTTPSignerV4(&options) @@ -54,7 +56,7 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - resolveRetryer(&options) + finalizeRetryMaxAttempts(&options) ignoreAnonymousAuth(&options) @@ -87,7 +89,7 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf fn(&options) } - finalizeRetryMaxAttemptOptions(&options, *c) + finalizeOperationRetryMaxAttempts(&options, *c) finalizeClientEndpointResolverOptions(&options) @@ -335,7 +337,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttemptOptions(o *Options, client Client) { +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index 288f495d34..52495f1fb6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.3" +const goModuleVersion = "1.18.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go index ddc5c0df36..5dee7e53f4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go @@ -70,11 +70,9 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. If specified in an operation call's functional - // options with a value that is different than the constructed client's Options, - // the Client's Retryer will be wrapped to use the operation's specific + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index 982e791b21..80df3bdde8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.21.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.21.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.21.3 (2023-12-06) * **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go index 90addc4fc2..fed0897390 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -42,6 +42,8 @@ func New(options Options, optFns ...func(*Options)) *Client { setResolvedDefaultsMode(&options) + resolveRetryer(&options) + resolveHTTPClient(&options) resolveHTTPSignerV4(&options) @@ -54,7 +56,7 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - resolveRetryer(&options) + finalizeRetryMaxAttempts(&options) ignoreAnonymousAuth(&options) @@ -87,7 +89,7 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf fn(&options) } - finalizeRetryMaxAttemptOptions(&options, *c) + finalizeOperationRetryMaxAttempts(&options, *c) finalizeClientEndpointResolverOptions(&options) @@ -335,7 +337,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttemptOptions(o *Options, client Client) { +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index e8f7a629af..98eaaa6d81 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.21.3" +const goModuleVersion = "1.21.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go index f338f7d685..b964e7e109 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go @@ -70,11 +70,9 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. If specified in an operation call's functional - // options with a value that is different than the constructed client's Options, - // the Client's Retryer will be wrapped to use the operation's specific + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index 027ff42c2d..17dd41f359 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.26.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.26.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.26.3 (2023-12-06) * **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 2fb478f6f0..59cc4c70a3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -46,6 +46,8 @@ func New(options Options, optFns ...func(*Options)) *Client { setResolvedDefaultsMode(&options) + resolveRetryer(&options) + resolveHTTPClient(&options) resolveHTTPSignerV4(&options) @@ -58,7 +60,7 @@ func New(options Options, optFns ...func(*Options)) *Client { fn(&options) } - resolveRetryer(&options) + finalizeRetryMaxAttempts(&options) ignoreAnonymousAuth(&options) @@ -91,7 +93,7 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf fn(&options) } - finalizeRetryMaxAttemptOptions(&options, *c) + finalizeOperationRetryMaxAttempts(&options, *c) finalizeClientEndpointResolverOptions(&options) @@ -339,7 +341,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttemptOptions(o *Options, client Client) { +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index e378151dee..61667eb2c2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.26.3" +const goModuleVersion = "1.26.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go index 2c7a03701c..5c1be79f8c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go @@ -70,11 +70,9 @@ type Options struct { // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. If specified in an operation call's functional - // options with a value that is different than the constructed client's Options, - // the Client's Retryer will be wrapped to use the operation's specific + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 8c83df00eb..46b115083d 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,9 @@ +# Release (2023-12-07) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.19.0 + * **Feature**: Support modeled request compression. + # Release (2023-11-30) * No change notes available for this release. diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index bb04fc9e8f..cd6f7fa45c 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.1" +const goModuleVersion = "1.19.0" diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go new file mode 100644 index 0000000000..004d78f213 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go @@ -0,0 +1,30 @@ +package requestcompression + +import ( + "bytes" + "compress/gzip" + "fmt" + "io" +) + +func gzipCompress(input io.Reader) ([]byte, error) { + var b bytes.Buffer + w, err := gzip.NewWriterLevel(&b, gzip.DefaultCompression) + if err != nil { + return nil, fmt.Errorf("failed to create gzip writer, %v", err) + } + + inBytes, err := io.ReadAll(input) + if err != nil { + return nil, fmt.Errorf("failed read payload to compress, %v", err) + } + + if _, err = w.Write(inBytes); err != nil { + return nil, fmt.Errorf("failed to write payload to be compressed, %v", err) + } + if err = w.Close(); err != nil { + return nil, fmt.Errorf("failed to flush payload being compressed, %v", err) + } + + return b.Bytes(), nil +} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go new file mode 100644 index 0000000000..06c16afc11 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go @@ -0,0 +1,52 @@ +package requestcompression + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "net/http" +) + +const captureUncompressedRequestID = "CaptureUncompressedRequest" + +// AddCaptureUncompressedRequestMiddleware captures http request before compress encoding for check +func AddCaptureUncompressedRequestMiddleware(stack *middleware.Stack, buf *bytes.Buffer) error { + return stack.Serialize.Insert(&captureUncompressedRequestMiddleware{ + buf: buf, + }, "RequestCompression", middleware.Before) +} + +type captureUncompressedRequestMiddleware struct { + req *http.Request + buf *bytes.Buffer + bytes []byte +} + +// ID returns id of the captureUncompressedRequestMiddleware +func (*captureUncompressedRequestMiddleware) ID() string { + return captureUncompressedRequestID +} + +// HandleSerialize captures request payload before it is compressed by request compression middleware +func (m *captureUncompressedRequestMiddleware) HandleSerialize(ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, +) ( + output middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := input.Request.(*smithyhttp.Request) + if !ok { + return output, metadata, fmt.Errorf("error when retrieving http request") + } + + _, err = io.Copy(m.buf, request.GetStream()) + if err != nil { + return output, metadata, fmt.Errorf("error when copying http request stream: %q", err) + } + if err = request.RewindStream(); err != nil { + return output, metadata, fmt.Errorf("error when rewinding request stream: %q", err) + } + + return next.HandleSerialize(ctx, input) +} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go new file mode 100644 index 0000000000..7c41476039 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go @@ -0,0 +1,103 @@ +// Package requestcompression implements runtime support for smithy-modeled +// request compression. +// +// This package is designated as private and is intended for use only by the +// smithy client runtime. The exported API therein is not considered stable and +// is subject to breaking changes without notice. +package requestcompression + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/transport/http" + "io" +) + +const MaxRequestMinCompressSizeBytes = 10485760 + +// Enumeration values for supported compress Algorithms. +const ( + GZIP = "gzip" +) + +type compressFunc func(io.Reader) ([]byte, error) + +var allowedAlgorithms = map[string]compressFunc{ + GZIP: gzipCompress, +} + +// AddRequestCompression add requestCompression middleware to op stack +func AddRequestCompression(stack *middleware.Stack, disabled bool, minBytes int64, algorithms []string) error { + return stack.Serialize.Add(&requestCompression{ + disableRequestCompression: disabled, + requestMinCompressSizeBytes: minBytes, + compressAlgorithms: algorithms, + }, middleware.After) +} + +type requestCompression struct { + disableRequestCompression bool + requestMinCompressSizeBytes int64 + compressAlgorithms []string +} + +// ID returns the ID of the middleware +func (m requestCompression) ID() string { + return "RequestCompression" +} + +// HandleSerialize gzip compress the request's stream/body if enabled by config fields +func (m requestCompression) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if m.disableRequestCompression { + return next.HandleSerialize(ctx, in) + } + // still need to check requestMinCompressSizeBytes in case it is out of range after service client config + if m.requestMinCompressSizeBytes < 0 || m.requestMinCompressSizeBytes > MaxRequestMinCompressSizeBytes { + return out, metadata, fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", m.requestMinCompressSizeBytes) + } + + req, ok := in.Request.(*http.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown request type %T", req) + } + + for _, algorithm := range m.compressAlgorithms { + compressFunc := allowedAlgorithms[algorithm] + if compressFunc != nil { + if stream := req.GetStream(); stream != nil { + size, found, err := req.StreamLength() + if err != nil { + return out, metadata, fmt.Errorf("error while finding request stream length, %v", err) + } else if !found || size < m.requestMinCompressSizeBytes { + return next.HandleSerialize(ctx, in) + } + + compressedBytes, err := compressFunc(stream) + if err != nil { + return out, metadata, fmt.Errorf("failed to compress request stream, %v", err) + } + + var newReq *http.Request + if newReq, err = req.SetStream(bytes.NewReader(compressedBytes)); err != nil { + return out, metadata, fmt.Errorf("failed to set request stream, %v", err) + } + *req = *newReq + + if val := req.Header.Get("Content-Encoding"); val != "" { + req.Header.Set("Content-Encoding", fmt.Sprintf("%s, %s", val, algorithm)) + } else { + req.Header.Set("Content-Encoding", algorithm) + } + } + break + } + } + + return next.HandleSerialize(ctx, in) +} diff --git a/vendor/github.com/bits-and-blooms/bitset/bitset.go b/vendor/github.com/bits-and-blooms/bitset/bitset.go index 642cba6f99..8fb9e9fa20 100644 --- a/vendor/github.com/bits-and-blooms/bitset/bitset.go +++ b/vendor/github.com/bits-and-blooms/bitset/bitset.go @@ -927,12 +927,16 @@ func (b *BitSet) Any() bool { // IsSuperSet returns true if this is a superset of the other set func (b *BitSet) IsSuperSet(other *BitSet) bool { - for i, e := other.NextSet(0); e; i, e = other.NextSet(i + 1) { - if !b.Test(i) { + l := other.wordCount() + if b.wordCount() < l { + l = b.wordCount() + } + for i, word := range other.set[:l] { + if b.set[i]&word != word { return false } } - return true + return popcntSlice(other.set[l:]) == 0 } // IsStrictSuperSet returns true if this is a strict superset of the other set diff --git a/vendor/github.com/cockroachdb/pebble/batch.go b/vendor/github.com/cockroachdb/pebble/batch.go index c695f8d2aa..ab7fdfd8c7 100644 --- a/vendor/github.com/cockroachdb/pebble/batch.go +++ b/vendor/github.com/cockroachdb/pebble/batch.go @@ -20,7 +20,6 @@ import ( "github.com/cockroachdb/pebble/internal/base" "github.com/cockroachdb/pebble/internal/batchskl" "github.com/cockroachdb/pebble/internal/humanize" - "github.com/cockroachdb/pebble/internal/invariants" "github.com/cockroachdb/pebble/internal/keyspan" "github.com/cockroachdb/pebble/internal/private" "github.com/cockroachdb/pebble/internal/rangedel" @@ -932,15 +931,6 @@ func (b *Batch) DeleteRangeDeferred(startLen, endLen int) *DeferredBatchOp { // // It is safe to modify the contents of the arguments after RangeKeySet returns. func (b *Batch) RangeKeySet(start, end, suffix, value []byte, _ *WriteOptions) error { - if invariants.Enabled && b.db != nil && b.db.opts.Comparer.Split != nil { - // RangeKeySet is only supported on prefix keys. - if b.db.opts.Comparer.Split(start) != len(start) { - panic("RangeKeySet called with suffixed start key") - } - if b.db.opts.Comparer.Split(end) != len(end) { - panic("RangeKeySet called with suffixed end key") - } - } suffixValues := [1]rangekey.SuffixValue{{Suffix: suffix, Value: value}} internalValueLen := rangekey.EncodedSetValueLen(end, suffixValues[:]) @@ -991,15 +981,6 @@ func (b *Batch) incrementRangeKeysCount() { // It is safe to modify the contents of the arguments after RangeKeyUnset // returns. func (b *Batch) RangeKeyUnset(start, end, suffix []byte, _ *WriteOptions) error { - if invariants.Enabled && b.db != nil && b.db.opts.Comparer.Split != nil { - // RangeKeyUnset is only supported on prefix keys. - if b.db.opts.Comparer.Split(start) != len(start) { - panic("RangeKeyUnset called with suffixed start key") - } - if b.db.opts.Comparer.Split(end) != len(end) { - panic("RangeKeyUnset called with suffixed end key") - } - } suffixes := [1][]byte{suffix} internalValueLen := rangekey.EncodedUnsetValueLen(end, suffixes[:]) @@ -1033,15 +1014,6 @@ func (b *Batch) rangeKeyUnsetDeferred(startLen, internalValueLen int) *DeferredB // It is safe to modify the contents of the arguments after RangeKeyDelete // returns. func (b *Batch) RangeKeyDelete(start, end []byte, _ *WriteOptions) error { - if invariants.Enabled && b.db != nil && b.db.opts.Comparer.Split != nil { - // RangeKeyDelete is only supported on prefix keys. - if b.db.opts.Comparer.Split(start) != len(start) { - panic("RangeKeyDelete called with suffixed start key") - } - if b.db.opts.Comparer.Split(end) != len(end) { - panic("RangeKeyDelete called with suffixed end key") - } - } deferredOp := b.RangeKeyDeleteDeferred(len(start), len(end)) copy(deferredOp.Key, start) copy(deferredOp.Value, end) diff --git a/vendor/github.com/cockroachdb/pebble/compaction_iter.go b/vendor/github.com/cockroachdb/pebble/compaction_iter.go index cc753a6ac4..0fb9e45f26 100644 --- a/vendor/github.com/cockroachdb/pebble/compaction_iter.go +++ b/vendor/github.com/cockroachdb/pebble/compaction_iter.go @@ -522,7 +522,7 @@ func (i *compactionIter) Next() (*InternalKey, []byte) { // into a SET. var includesBase bool switch i.key.Kind() { - case InternalKeyKindSet: + case InternalKeyKindSet, InternalKeyKindSetWithDelete: includesBase = true case InternalKeyKindMerge: default: @@ -832,7 +832,8 @@ func (i *compactionIter) mergeNext(valueMerger ValueMerger) stripeChangeType { // We've hit a deletion tombstone. Return everything up to this point and // then skip entries until the next snapshot stripe. We change the kind // of the result key to a Set so that it shadows keys in lower - // levels. That is, MERGE+DEL -> SET. + // levels. That is, MERGE+DEL -> SETWITHDEL. + // // We do the same for SingleDelete since SingleDelete is only // permitted (with deterministic behavior) for keys that have been // set once since the last SingleDelete/Delete, so everything @@ -845,7 +846,7 @@ func (i *compactionIter) mergeNext(valueMerger ValueMerger) stripeChangeType { // single Set, and then merge in any following Sets, but that is // complicated wrt code and unnecessary given the narrow permitted // use of SingleDelete. - i.key.SetKind(InternalKeyKindSet) + i.key.SetKind(InternalKeyKindSetWithDelete) i.skip = true return sameStripeSkippable diff --git a/vendor/github.com/cockroachdb/pebble/db.go b/vendor/github.com/cockroachdb/pebble/db.go index ad06b074d4..ea23aaaea9 100644 --- a/vendor/github.com/cockroachdb/pebble/db.go +++ b/vendor/github.com/cockroachdb/pebble/db.go @@ -839,6 +839,7 @@ func (d *DB) applyInternal(batch *Batch, opts *WriteOptions, noSyncWait bool) er if d.split == nil { return errNoSplit } + // TODO(jackson): Assert that all range key operands are suffixless. } batch.committing = true @@ -1000,12 +1001,9 @@ var iterAllocPool = sync.Pool{ // and the specified seqNum will be used as the snapshot seqNum. // - EFOS in file-only state: Only `seqNum` and `vers` are set. All the // relevant SSTs are referenced by the *version. -// - EFOS that has been excised but is in alwaysCreateIters mode (tests only). -// Only `seqNum` and `readState` are set. type snapshotIterOpts struct { - seqNum uint64 - vers *version - readState *readState + seqNum uint64 + vers *version } type batchIterOpts struct { @@ -1059,13 +1057,8 @@ func (d *DB) newIter( // files in the associated version from being deleted if there is a current // compaction. The readState is unref'd by Iterator.Close(). if internalOpts.snapshot.vers == nil { - if internalOpts.snapshot.readState != nil { - readState = internalOpts.snapshot.readState - readState.ref() - } else { - // NB: loadReadState() calls readState.ref(). - readState = d.loadReadState() - } + // NB: loadReadState() calls readState.ref(). + readState = d.loadReadState() } else { // vers != nil internalOpts.snapshot.vers.Ref() @@ -1296,12 +1289,7 @@ func (d *DB) newInternalIter( // compaction. The readState is unref'd by Iterator.Close(). var readState *readState if sOpts.vers == nil { - if sOpts.readState != nil { - readState = sOpts.readState - readState.ref() - } else { - readState = d.loadReadState() - } + readState = d.loadReadState() } if sOpts.vers != nil { sOpts.vers.Ref() diff --git a/vendor/github.com/cockroachdb/pebble/ingest.go b/vendor/github.com/cockroachdb/pebble/ingest.go index 2ef8f43296..e083d1ced5 100644 --- a/vendor/github.com/cockroachdb/pebble/ingest.go +++ b/vendor/github.com/cockroachdb/pebble/ingest.go @@ -1160,15 +1160,6 @@ func (d *DB) IngestAndExcise( if d.opts.ReadOnly { return IngestOperationStats{}, ErrReadOnly } - if invariants.Enabled && d.opts.Comparer.Split != nil { - // Excise is only supported on prefix keys. - if d.opts.Comparer.Split(exciseSpan.Start) != len(exciseSpan.Start) { - panic("IngestAndExcise called with suffixed start key") - } - if d.opts.Comparer.Split(exciseSpan.End) != len(exciseSpan.End) { - panic("IngestAndExcise called with suffixed end key") - } - } return d.ingest(paths, ingestTargetLevel, shared, exciseSpan, nil /* external */) } diff --git a/vendor/github.com/cockroachdb/pebble/options.go b/vendor/github.com/cockroachdb/pebble/options.go index 244b101249..8a2c609ef0 100644 --- a/vendor/github.com/cockroachdb/pebble/options.go +++ b/vendor/github.com/cockroachdb/pebble/options.go @@ -973,11 +973,6 @@ type Options struct { // against the FS are made after the DB is closed, the FS may leak a // goroutine indefinitely. fsCloser io.Closer - - // efosAlwaysCreatesIterators is set by some tests to force - // EventuallyFileOnlySnapshots to always create iterators, even after a - // conflicting excise. - efosAlwaysCreatesIterators bool } } @@ -1151,13 +1146,6 @@ func (o *Options) AddEventListener(l EventListener) { o.EventListener = &l } -// TestingAlwaysCreateEFOSIterators is used to toggle a private option for -// having EventuallyFileOnlySnapshots always create iterators. Meant to only -// be used in tests. -func (o *Options) TestingAlwaysCreateEFOSIterators(value bool) { - o.private.efosAlwaysCreatesIterators = value -} - func (o *Options) equal() Equal { if o.Comparer.Equal == nil { return bytes.Equal diff --git a/vendor/github.com/cockroachdb/pebble/snapshot.go b/vendor/github.com/cockroachdb/pebble/snapshot.go index cdbf028d19..5477b54717 100644 --- a/vendor/github.com/cockroachdb/pebble/snapshot.go +++ b/vendor/github.com/cockroachdb/pebble/snapshot.go @@ -250,10 +250,6 @@ type EventuallyFileOnlySnapshot struct { snap *Snapshot // The wrapped version reference, if a file-only snapshot. vers *version - - // The readState corresponding to when this EFOS was created. Only set - // if alwaysCreateIters is true. - rs *readState } // Key ranges to watch for an excise on. @@ -266,12 +262,6 @@ type EventuallyFileOnlySnapshot struct { db *DB seqNum uint64 - // If true, this EventuallyFileOnlySnapshot will always generate iterators that - // retain snapshot semantics, by holding onto the readState if a conflicting - // excise were to happen. Only used in some tests to enforce deterministic - // behaviour around excises. - alwaysCreateIters bool - closed chan struct{} } @@ -292,14 +282,10 @@ func (d *DB) makeEventuallyFileOnlySnapshot( } } es := &EventuallyFileOnlySnapshot{ - db: d, - seqNum: seqNum, - protectedRanges: keyRanges, - closed: make(chan struct{}), - alwaysCreateIters: d.opts.private.efosAlwaysCreatesIterators, - } - if es.alwaysCreateIters { - es.mu.rs = d.loadReadState() + db: d, + seqNum: seqNum, + protectedRanges: keyRanges, + closed: make(chan struct{}), } if isFileOnly { es.mu.vers = d.mu.versions.currentVersion() @@ -443,9 +429,6 @@ func (es *EventuallyFileOnlySnapshot) Close() error { if es.mu.vers != nil { es.mu.vers.UnrefLocked() } - if es.mu.rs != nil { - es.mu.rs.unrefLocked() - } return nil } @@ -481,31 +464,6 @@ func (es *EventuallyFileOnlySnapshot) NewIter(o *IterOptions) (*Iterator, error) return es.NewIterWithContext(context.Background(), o) } -func (es *EventuallyFileOnlySnapshot) newAlwaysCreateIterWithContext( - ctx context.Context, o *IterOptions, -) (*Iterator, error) { - // Grab the db mutex. This avoids races down below, where we could get - // excised between the es.excised.Load() call, and the newIter call. - es.db.mu.Lock() - defer es.db.mu.Unlock() - es.mu.Lock() - defer es.mu.Unlock() - if es.mu.vers != nil { - sOpts := snapshotIterOpts{seqNum: es.seqNum, vers: es.mu.vers} - return es.db.newIter(ctx, nil /* batch */, newIterOpts{snapshot: sOpts}, o), nil - } - - sOpts := snapshotIterOpts{seqNum: es.seqNum} - if es.excised.Load() { - if es.mu.rs == nil { - return nil, errors.AssertionFailedf("unexpected nil readState in EFOS' alwaysCreateIters mode") - } - sOpts.readState = es.mu.rs - } - iter := es.db.newIter(ctx, nil /* batch */, newIterOpts{snapshot: sOpts}, o) - return iter, nil -} - // NewIterWithContext is like NewIter, and additionally accepts a context for // tracing. func (es *EventuallyFileOnlySnapshot) NewIterWithContext( @@ -517,9 +475,6 @@ func (es *EventuallyFileOnlySnapshot) NewIterWithContext( default: } - if es.alwaysCreateIters { - return es.newAlwaysCreateIterWithContext(ctx, o) - } es.mu.Lock() defer es.mu.Unlock() if es.mu.vers != nil { @@ -527,14 +482,14 @@ func (es *EventuallyFileOnlySnapshot) NewIterWithContext( return es.db.newIter(ctx, nil /* batch */, newIterOpts{snapshot: sOpts}, o), nil } - sOpts := snapshotIterOpts{seqNum: es.seqNum} if es.excised.Load() { return nil, ErrSnapshotExcised } + sOpts := snapshotIterOpts{seqNum: es.seqNum} iter := es.db.newIter(ctx, nil /* batch */, newIterOpts{snapshot: sOpts}, o) // If excised is true, then keys relevant to the snapshot might not be - // present in the readState being used by the iterator. + // present in the readState being used by the iterator. Error out. if es.excised.Load() { iter.Close() return nil, ErrSnapshotExcised @@ -560,10 +515,22 @@ func (es *EventuallyFileOnlySnapshot) ScanInternal( if es.db == nil { panic(ErrClosed) } - if es.excised.Load() && !es.alwaysCreateIters { + if es.excised.Load() { return ErrSnapshotExcised } var sOpts snapshotIterOpts + es.mu.Lock() + if es.mu.vers != nil { + sOpts = snapshotIterOpts{ + seqNum: es.seqNum, + vers: es.mu.vers, + } + } else { + sOpts = snapshotIterOpts{ + seqNum: es.seqNum, + } + } + es.mu.Unlock() opts := &scanInternalOptions{ CategoryAndQoS: categoryAndQoS, IterOptions: IterOptions{ @@ -577,43 +544,15 @@ func (es *EventuallyFileOnlySnapshot) ScanInternal( visitSharedFile: visitSharedFile, skipSharedLevels: visitSharedFile != nil, } - if es.alwaysCreateIters { - // Grab the db mutex. This avoids races down below as it prevents excises - // from taking effect until the iterator is instantiated. - es.db.mu.Lock() - } - es.mu.Lock() - if es.mu.vers != nil { - sOpts = snapshotIterOpts{ - seqNum: es.seqNum, - vers: es.mu.vers, - } - } else { - if es.excised.Load() && es.alwaysCreateIters { - sOpts = snapshotIterOpts{ - readState: es.mu.rs, - seqNum: es.seqNum, - } - } else { - sOpts = snapshotIterOpts{ - seqNum: es.seqNum, - } - } - } - es.mu.Unlock() iter, err := es.db.newInternalIter(ctx, sOpts, opts) if err != nil { return err } defer iter.close() - if es.alwaysCreateIters { - // See the similar conditional above where we grab this mutex. - es.db.mu.Unlock() - } // If excised is true, then keys relevant to the snapshot might not be // present in the readState being used by the iterator. Error out. - if es.excised.Load() && !es.alwaysCreateIters { + if es.excised.Load() { return ErrSnapshotExcised } diff --git a/vendor/github.com/nutsdb/nutsdb/tx_btree.go b/vendor/github.com/nutsdb/nutsdb/tx_btree.go index 00900b373c..391e2d88a4 100644 --- a/vendor/github.com/nutsdb/nutsdb/tx_btree.go +++ b/vendor/github.com/nutsdb/nutsdb/tx_btree.go @@ -15,7 +15,14 @@ package nutsdb import ( + "errors" + "math" + "math/big" + "strconv" + "sync/atomic" "time" + + "github.com/xujiajun/utils/strconv2" ) func (tx *Tx) PutWithTimestamp(bucket string, key, value []byte, ttl uint32, timestamp uint64) error { @@ -269,3 +276,83 @@ func (tx *Tx) getHintIdxDataItemsWrapper(records []*Record, limitNum int, bucket return values, nil } + +func (tx *Tx) update(bucket string, key []byte, getNewValue func([]byte) ([]byte, error)) error { + if err := tx.checkTxIsClosed(); err != nil { + return err + } + + bucketId, err := tx.db.bm.GetBucketID(DataStructureBTree, bucket) + if err != nil { + return err + } + + if idx, ok := tx.db.Index.bTree.exist(bucketId); ok { + record, found := idx.Find(key) + if !found { + return ErrKeyNotFound + } + + if record.IsExpired() { + tx.putDeleteLog(bucketId, key, nil, Persistent, DataDeleteFlag, uint64(time.Now().Unix()), DataStructureBTree) + return ErrNotFoundKey + } + + value, err := tx.db.getValueByRecord(record) + if err != nil { + return err + } + newValue, err := getNewValue(value) + if err != nil { + return err + } + + return tx.put(bucket, key, newValue, record.TTL, DataSetFlag, uint64(time.Now().Unix()), DataStructureBTree) + } else { + return ErrKeyNotFound + } +} + +func bigIntIncr(a string, b string) string { + bigIntA, _ := new(big.Int).SetString(a, 10) + bigIntB, _ := new(big.Int).SetString(b, 10) + bigIntA.Add(bigIntA, bigIntB) + return bigIntA.String() +} + +func (tx *Tx) integerIncr(bucket string, key []byte, increment int64) error { + return tx.update(bucket, key, func(value []byte) ([]byte, error) { + intValue, err := strconv2.StrToInt64(string(value)) + + if err != nil && errors.Is(err, strconv.ErrRange) { + return []byte(bigIntIncr(string(value), strconv2.Int64ToStr(increment))), nil + } + + if err != nil { + return nil, ErrValueNotInteger + } + + if (increment > 0 && math.MaxInt64-increment < intValue) || (increment < 0 && math.MinInt64-increment > intValue) { + return []byte(bigIntIncr(string(value), strconv2.Int64ToStr(increment))), nil + } + + atomic.AddInt64(&intValue, increment) + return []byte(strconv2.Int64ToStr(intValue)), nil + }) +} + +func (tx *Tx) Incr(bucket string, key []byte) error { + return tx.integerIncr(bucket, key, 1) +} + +func (tx *Tx) Decr(bucket string, key []byte) error { + return tx.integerIncr(bucket, key, -1) +} + +func (tx *Tx) IncrBy(bucket string, key []byte, increment int64) error { + return tx.integerIncr(bucket, key, increment) +} + +func (tx *Tx) DecrBy(bucket string, key []byte, decrement int64) error { + return tx.integerIncr(bucket, key, -1*decrement) +} diff --git a/vendor/github.com/nutsdb/nutsdb/tx_error.go b/vendor/github.com/nutsdb/nutsdb/tx_error.go index cbc274a67f..cb2dc280d1 100644 --- a/vendor/github.com/nutsdb/nutsdb/tx_error.go +++ b/vendor/github.com/nutsdb/nutsdb/tx_error.go @@ -52,4 +52,6 @@ var ( ErrBucketAlreadyExist = errors.New("bucket is already exist") ErrorBucketNotExist = errors.New("bucket is not exist yet, please use NewBucket function to create this bucket first") + + ErrValueNotInteger = errors.New("value is not an integer") ) diff --git a/vendor/github.com/pion/rtcp/compound_packet.go b/vendor/github.com/pion/rtcp/compound_packet.go index 9407258fcf..a621c6117e 100644 --- a/vendor/github.com/pion/rtcp/compound_packet.go +++ b/vendor/github.com/pion/rtcp/compound_packet.go @@ -110,6 +110,15 @@ func (c CompoundPacket) Marshal() ([]byte, error) { return Marshal(p) } +// MarshalSize returns the size of the packet once marshaled +func (c CompoundPacket) MarshalSize() int { + l := 0 + for _, p := range c { + l += p.MarshalSize() + } + return l +} + // Unmarshal decodes a CompoundPacket from binary. func (c *CompoundPacket) Unmarshal(rawData []byte) error { out := make(CompoundPacket, 0) diff --git a/vendor/github.com/pion/rtcp/extended_report.go b/vendor/github.com/pion/rtcp/extended_report.go index 9e39c7b4d6..db7ca41dfb 100644 --- a/vendor/github.com/pion/rtcp/extended_report.go +++ b/vendor/github.com/pion/rtcp/extended_report.go @@ -545,6 +545,11 @@ func (b *UnknownReportBlock) setupBlockHeader() { func (b *UnknownReportBlock) unpackBlockHeader() { } +// MarshalSize returns the size of the packet once marshaled +func (x ExtendedReport) MarshalSize() int { + return wireSize(x) +} + // Marshal encodes the ExtendedReport in binary func (x ExtendedReport) Marshal() ([]byte, error) { for _, p := range x.Reports { diff --git a/vendor/github.com/pion/rtcp/full_intra_request.go b/vendor/github.com/pion/rtcp/full_intra_request.go index e778e6d4b9..7c67c50432 100644 --- a/vendor/github.com/pion/rtcp/full_intra_request.go +++ b/vendor/github.com/pion/rtcp/full_intra_request.go @@ -88,11 +88,12 @@ func (p *FullIntraRequest) Header() Header { return Header{ Count: FormatFIR, Type: TypePayloadSpecificFeedback, - Length: uint16((p.len() / 4) - 1), + Length: uint16((p.MarshalSize() / 4) - 1), } } -func (p *FullIntraRequest) len() int { +// MarshalSize returns the size of the packet once marshaled +func (p *FullIntraRequest) MarshalSize() int { return headerLength + firOffset + len(p.FIR)*8 } diff --git a/vendor/github.com/pion/rtcp/goodbye.go b/vendor/github.com/pion/rtcp/goodbye.go index 7879fb978a..bda1785b2a 100644 --- a/vendor/github.com/pion/rtcp/goodbye.go +++ b/vendor/github.com/pion/rtcp/goodbye.go @@ -32,7 +32,7 @@ func (g Goodbye) Marshal() ([]byte, error) { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ - rawPacket := make([]byte, g.len()) + rawPacket := make([]byte, g.MarshalSize()) packetBody := rawPacket[headerLength:] if len(g.Sources) > countMax { @@ -126,11 +126,12 @@ func (g *Goodbye) Header() Header { Padding: false, Count: uint8(len(g.Sources)), Type: TypeGoodbye, - Length: uint16((g.len() / 4) - 1), + Length: uint16((g.MarshalSize() / 4) - 1), } } -func (g *Goodbye) len() int { +// MarshalSize returns the size of the packet once marshaled +func (g *Goodbye) MarshalSize() int { srcsLength := len(g.Sources) * ssrcLength reasonLength := len(g.Reason) + 1 diff --git a/vendor/github.com/pion/rtcp/packet.go b/vendor/github.com/pion/rtcp/packet.go index fc937c12de..cdb83c0486 100644 --- a/vendor/github.com/pion/rtcp/packet.go +++ b/vendor/github.com/pion/rtcp/packet.go @@ -10,6 +10,7 @@ type Packet interface { Marshal() ([]byte, error) Unmarshal(rawPacket []byte) error + MarshalSize() int } // Unmarshal takes an entire udp datagram (which may consist of multiple RTCP packets) and diff --git a/vendor/github.com/pion/rtcp/picture_loss_indication.go b/vendor/github.com/pion/rtcp/picture_loss_indication.go index 40bd7bcf72..56a7de256a 100644 --- a/vendor/github.com/pion/rtcp/picture_loss_indication.go +++ b/vendor/github.com/pion/rtcp/picture_loss_indication.go @@ -29,7 +29,7 @@ func (p PictureLossIndication) Marshal() ([]byte, error) { * * The semantics of this FB message is independent of the payload type. */ - rawPacket := make([]byte, p.len()) + rawPacket := make([]byte, p.MarshalSize()) packetBody := rawPacket[headerLength:] binary.BigEndian.PutUint32(packetBody, p.SenderSSRC) @@ -78,7 +78,8 @@ func (p *PictureLossIndication) Header() Header { } } -func (p *PictureLossIndication) len() int { +// MarshalSize returns the size of the packet once marshaled +func (p *PictureLossIndication) MarshalSize() int { return headerLength + ssrcLength*2 } diff --git a/vendor/github.com/pion/rtcp/rapid_resynchronization_request.go b/vendor/github.com/pion/rtcp/rapid_resynchronization_request.go index 48bbd4a911..dc67d49286 100644 --- a/vendor/github.com/pion/rtcp/rapid_resynchronization_request.go +++ b/vendor/github.com/pion/rtcp/rapid_resynchronization_request.go @@ -35,7 +35,7 @@ func (p RapidResynchronizationRequest) Marshal() ([]byte, error) { * * The semantics of this FB message is independent of the payload type. */ - rawPacket := make([]byte, p.len()) + rawPacket := make([]byte, p.MarshalSize()) packetBody := rawPacket[headerLength:] binary.BigEndian.PutUint32(packetBody, p.SenderSSRC) @@ -70,7 +70,8 @@ func (p *RapidResynchronizationRequest) Unmarshal(rawPacket []byte) error { return nil } -func (p *RapidResynchronizationRequest) len() int { +// MarshalSize returns the size of the packet once marshaled +func (p *RapidResynchronizationRequest) MarshalSize() int { return headerLength + rrrHeaderLength } diff --git a/vendor/github.com/pion/rtcp/raw_packet.go b/vendor/github.com/pion/rtcp/raw_packet.go index 291ee3652d..eafb034fe6 100644 --- a/vendor/github.com/pion/rtcp/raw_packet.go +++ b/vendor/github.com/pion/rtcp/raw_packet.go @@ -43,3 +43,8 @@ func (r RawPacket) String() string { out := fmt.Sprintf("RawPacket: %v", ([]byte)(r)) return out } + +// MarshalSize returns the size of the packet once marshaled +func (r RawPacket) MarshalSize() int { + return len(r) +} diff --git a/vendor/github.com/pion/rtcp/receiver_estimated_maximum_bitrate.go b/vendor/github.com/pion/rtcp/receiver_estimated_maximum_bitrate.go index bd70973fba..7be57e6ab7 100644 --- a/vendor/github.com/pion/rtcp/receiver_estimated_maximum_bitrate.go +++ b/vendor/github.com/pion/rtcp/receiver_estimated_maximum_bitrate.go @@ -42,9 +42,8 @@ func (p ReceiverEstimatedMaximumBitrate) Marshal() (buf []byte, err error) { return buf, nil } -// MarshalSize returns the size of the packet when marshaled. -// This can be used in conjunction with `MarshalTo` to avoid allocations. -func (p ReceiverEstimatedMaximumBitrate) MarshalSize() (n int) { +// MarshalSize returns the size of the packet once marshaled +func (p ReceiverEstimatedMaximumBitrate) MarshalSize() int { return 20 + 4*len(p.SSRCs) } diff --git a/vendor/github.com/pion/rtcp/receiver_report.go b/vendor/github.com/pion/rtcp/receiver_report.go index 0e2bb1f398..e91770206c 100644 --- a/vendor/github.com/pion/rtcp/receiver_report.go +++ b/vendor/github.com/pion/rtcp/receiver_report.go @@ -58,7 +58,7 @@ func (r ReceiverReport) Marshal() ([]byte, error) { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ - rawPacket := make([]byte, r.len()) + rawPacket := make([]byte, r.MarshalSize()) packetBody := rawPacket[headerLength:] binary.BigEndian.PutUint32(packetBody, r.SSRC) @@ -157,7 +157,8 @@ func (r *ReceiverReport) Unmarshal(rawPacket []byte) error { return nil } -func (r *ReceiverReport) len() int { +// MarshalSize returns the size of the packet once marshaled +func (r *ReceiverReport) MarshalSize() int { repsLength := 0 for _, rep := range r.Reports { repsLength += rep.len() @@ -170,7 +171,7 @@ func (r *ReceiverReport) Header() Header { return Header{ Count: uint8(len(r.Reports)), Type: TypeReceiverReport, - Length: uint16((r.len()/4)-1) + uint16(getPadding(len(r.ProfileExtensions))), + Length: uint16((r.MarshalSize()/4)-1) + uint16(getPadding(len(r.ProfileExtensions))), } } diff --git a/vendor/github.com/pion/rtcp/rfc8888.go b/vendor/github.com/pion/rtcp/rfc8888.go index 9a3e337903..544c6e3808 100644 --- a/vendor/github.com/pion/rtcp/rfc8888.go +++ b/vendor/github.com/pion/rtcp/rfc8888.go @@ -94,6 +94,11 @@ func (b CCFeedbackReport) DestinationSSRC() []uint32 { // Len returns the length of the report in bytes func (b *CCFeedbackReport) Len() int { + return b.MarshalSize() +} + +// MarshalSize returns the size of the packet once marshaled +func (b *CCFeedbackReport) MarshalSize() int { n := 0 for _, block := range b.ReportBlocks { n += block.len() @@ -107,7 +112,7 @@ func (b *CCFeedbackReport) Header() Header { Padding: false, Count: FormatCCFB, Type: TypeTransportSpecificFeedback, - Length: uint16(b.Len()/4 - 1), + Length: uint16(b.MarshalSize()/4 - 1), } } diff --git a/vendor/github.com/pion/rtcp/sender_report.go b/vendor/github.com/pion/rtcp/sender_report.go index dc5138edec..aaee0ee9d6 100644 --- a/vendor/github.com/pion/rtcp/sender_report.go +++ b/vendor/github.com/pion/rtcp/sender_report.go @@ -96,7 +96,7 @@ func (r SenderReport) Marshal() ([]byte, error) { * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ - rawPacket := make([]byte, r.len()) + rawPacket := make([]byte, r.MarshalSize()) packetBody := rawPacket[headerLength:] binary.BigEndian.PutUint32(packetBody[srSSRCOffset:], r.SSRC) @@ -228,7 +228,8 @@ func (r *SenderReport) DestinationSSRC() []uint32 { return out } -func (r *SenderReport) len() int { +// MarshalSize returns the size of the packet once marshaled +func (r *SenderReport) MarshalSize() int { repsLength := 0 for _, rep := range r.Reports { repsLength += rep.len() @@ -241,7 +242,7 @@ func (r *SenderReport) Header() Header { return Header{ Count: uint8(len(r.Reports)), Type: TypeSenderReport, - Length: uint16((r.len() / 4) - 1), + Length: uint16((r.MarshalSize() / 4) - 1), } } diff --git a/vendor/github.com/pion/rtcp/slice_loss_indication.go b/vendor/github.com/pion/rtcp/slice_loss_indication.go index 73926dd3f2..014fcb7cd0 100644 --- a/vendor/github.com/pion/rtcp/slice_loss_indication.go +++ b/vendor/github.com/pion/rtcp/slice_loss_indication.go @@ -93,7 +93,8 @@ func (p *SliceLossIndication) Unmarshal(rawPacket []byte) error { return nil } -func (p *SliceLossIndication) len() int { +// MarshalSize returns the size of the packet once marshaled +func (p *SliceLossIndication) MarshalSize() int { return headerLength + sliOffset + (len(p.SLI) * 4) } @@ -102,7 +103,7 @@ func (p *SliceLossIndication) Header() Header { return Header{ Count: FormatSLI, Type: TypeTransportSpecificFeedback, - Length: uint16((p.len() / 4) - 1), + Length: uint16((p.MarshalSize() / 4) - 1), } } diff --git a/vendor/github.com/pion/rtcp/source_description.go b/vendor/github.com/pion/rtcp/source_description.go index 28fccdb35b..fc29d8e1a6 100644 --- a/vendor/github.com/pion/rtcp/source_description.go +++ b/vendor/github.com/pion/rtcp/source_description.go @@ -97,7 +97,7 @@ func (s SourceDescription) Marshal() ([]byte, error) { * +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ */ - rawPacket := make([]byte, s.len()) + rawPacket := make([]byte, s.MarshalSize()) packetBody := rawPacket[headerLength:] chunkOffset := 0 @@ -169,7 +169,8 @@ func (s *SourceDescription) Unmarshal(rawPacket []byte) error { return nil } -func (s *SourceDescription) len() int { +// MarshalSize returns the size of the packet once marshaled +func (s *SourceDescription) MarshalSize() int { chunksLength := 0 for _, c := range s.Chunks { chunksLength += c.len() @@ -182,7 +183,7 @@ func (s *SourceDescription) Header() Header { return Header{ Count: uint8(len(s.Chunks)), Type: TypeSourceDescription, - Length: uint16((s.len() / 4) - 1), + Length: uint16((s.MarshalSize() / 4) - 1), } } @@ -251,7 +252,7 @@ func (s *SourceDescriptionChunk) Unmarshal(rawPacket []byte) error { return err } s.Items = append(s.Items, it) - i += it.len() + i += it.Len() } return errPacketTooShort @@ -260,7 +261,7 @@ func (s *SourceDescriptionChunk) Unmarshal(rawPacket []byte) error { func (s SourceDescriptionChunk) len() int { chunkLen := sdesSourceLen for _, it := range s.Items { - chunkLen += it.len() + chunkLen += it.Len() } chunkLen += sdesTypeLen // for terminating null octet @@ -280,7 +281,8 @@ type SourceDescriptionItem struct { Text string } -func (s SourceDescriptionItem) len() int { +// Len returns the length of the SourceDescriptionItem when encoded as binary. +func (s SourceDescriptionItem) Len() int { /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 diff --git a/vendor/github.com/pion/rtcp/transport_layer_cc.go b/vendor/github.com/pion/rtcp/transport_layer_cc.go index ce2ecaa3ff..55b2162057 100644 --- a/vendor/github.com/pion/rtcp/transport_layer_cc.go +++ b/vendor/github.com/pion/rtcp/transport_layer_cc.go @@ -363,13 +363,18 @@ func (t *TransportLayerCC) packetLen() uint16 { // Len return total bytes with padding func (t *TransportLayerCC) Len() uint16 { + return uint16(t.MarshalSize()) +} + +// MarshalSize returns the size of the packet once marshaled +func (t *TransportLayerCC) MarshalSize() int { n := t.packetLen() // has padding if n%4 != 0 { n = (n/4 + 1) * 4 } - return n + return int(n) } func (t TransportLayerCC) String() string { @@ -399,7 +404,7 @@ func (t TransportLayerCC) Marshal() ([]byte, error) { return nil, err } - payload := make([]byte, t.Len()-headerLength) + payload := make([]byte, t.MarshalSize()-headerLength) binary.BigEndian.PutUint32(payload, t.SenderSSRC) binary.BigEndian.PutUint32(payload[4:], t.MediaSSRC) binary.BigEndian.PutUint16(payload[baseSequenceNumberOffset:], t.BaseSequenceNumber) @@ -430,7 +435,7 @@ func (t TransportLayerCC) Marshal() ([]byte, error) { } if t.Header.Padding { - payload[len(payload)-1] = uint8(t.Len() - t.packetLen()) + payload[len(payload)-1] = uint8(t.MarshalSize() - int(t.packetLen())) } return append(header, payload...), nil diff --git a/vendor/github.com/pion/rtcp/transport_layer_nack.go b/vendor/github.com/pion/rtcp/transport_layer_nack.go index 3d2280183b..802b915ec3 100644 --- a/vendor/github.com/pion/rtcp/transport_layer_nack.go +++ b/vendor/github.com/pion/rtcp/transport_layer_nack.go @@ -151,7 +151,8 @@ func (p *TransportLayerNack) Unmarshal(rawPacket []byte) error { return nil } -func (p *TransportLayerNack) len() int { +// MarshalSize returns the size of the packet once marshaled +func (p *TransportLayerNack) MarshalSize() int { return headerLength + nackOffset + (len(p.Nacks) * 4) } @@ -160,7 +161,7 @@ func (p *TransportLayerNack) Header() Header { return Header{ Count: FormatTLN, Type: TypeTransportSpecificFeedback, - Length: uint16((p.len() / 4) - 1), + Length: uint16((p.MarshalSize() / 4) - 1), } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 263154fc44..c5a7660af4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -47,7 +47,7 @@ github.com/CortexFoundation/robot/backend # github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66 ## explicit; go 1.16 github.com/CortexFoundation/statik -# github.com/CortexFoundation/torrentfs v1.0.56-0.20231207113153-4ead5e1fb6d9 +# github.com/CortexFoundation/torrentfs v1.0.56-0.20231209192839-e28c596da6b3 ## explicit; go 1.21 github.com/CortexFoundation/torrentfs github.com/CortexFoundation/torrentfs/backend @@ -197,7 +197,7 @@ github.com/arsham/figurine/figurine # github.com/arsham/rainbow v1.2.1 ## explicit; go 1.18 github.com/arsham/rainbow/rainbow -# github.com/aws/aws-sdk-go-v2 v1.23.5 +# github.com/aws/aws-sdk-go-v2 v1.24.0 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/defaults @@ -222,10 +222,10 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/config v1.25.12 +# github.com/aws/aws-sdk-go-v2/config v1.26.1 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.16.10 +# github.com/aws/aws-sdk-go-v2/credentials v1.16.12 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -234,47 +234,47 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client github.com/aws/aws-sdk-go-v2/credentials/processcreds github.com/aws/aws-sdk-go-v2/credentials/ssocreds github.com/aws/aws-sdk-go-v2/credentials/stscreds -# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 +# github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/ini -# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/route53 v1.35.3 +# github.com/aws/aws-sdk-go-v2/service/route53 v1.35.5 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/route53 github.com/aws/aws-sdk-go-v2/service/route53/internal/customizations github.com/aws/aws-sdk-go-v2/service/route53/internal/endpoints github.com/aws/aws-sdk-go-v2/service/route53/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.18.3 +# github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.3 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.26.3 +# github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.18.1 +# github.com/aws/smithy-go v1.19.0 ## explicit; go 1.19 github.com/aws/smithy-go github.com/aws/smithy-go/auth @@ -290,6 +290,7 @@ github.com/aws/smithy-go/internal/sync/singleflight github.com/aws/smithy-go/io github.com/aws/smithy-go/logging github.com/aws/smithy-go/middleware +github.com/aws/smithy-go/private/requestcompression github.com/aws/smithy-go/ptr github.com/aws/smithy-go/rand github.com/aws/smithy-go/time @@ -308,7 +309,7 @@ github.com/benbjohnson/immutable # github.com/beorn7/perks v1.0.1 ## explicit; go 1.11 github.com/beorn7/perks/quantile -# github.com/bits-and-blooms/bitset v1.11.0 +# github.com/bits-and-blooms/bitset v1.12.0 ## explicit; go 1.16 github.com/bits-and-blooms/bitset # github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 @@ -357,7 +358,7 @@ github.com/cockroachdb/errors/withstack # github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b ## explicit; go 1.16 github.com/cockroachdb/logtags -# github.com/cockroachdb/pebble v0.0.0-20231206233349-b3f359e3a503 +# github.com/cockroachdb/pebble v0.0.0-20231208175357-58bdc725addc ## explicit; go 1.21 github.com/cockroachdb/pebble github.com/cockroachdb/pebble/bloom @@ -765,7 +766,7 @@ github.com/naoina/go-stringutil ## explicit github.com/naoina/toml github.com/naoina/toml/ast -# github.com/nutsdb/nutsdb v1.0.2-0.20231206130847-727ec20a08fb +# github.com/nutsdb/nutsdb v1.0.2-0.20231209035901-f7c4a82b75c2 ## explicit; go 1.18 github.com/nutsdb/nutsdb # github.com/nxadm/tail v1.4.11 @@ -830,7 +831,7 @@ github.com/pion/mdns # github.com/pion/randutil v0.1.0 ## explicit; go 1.14 github.com/pion/randutil -# github.com/pion/rtcp v1.2.12 +# github.com/pion/rtcp v1.2.13 ## explicit; go 1.13 github.com/pion/rtcp # github.com/pion/rtp v1.8.3 @@ -989,7 +990,7 @@ github.com/ucwong/filecache # github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb ## explicit; go 1.19 github.com/ucwong/go-ttlmap -# github.com/ucwong/golang-kv v1.0.23-0.20231207100643-eae46a095003 +# github.com/ucwong/golang-kv v1.0.23-0.20231209094038-056d175d4a78 ## explicit; go 1.21 github.com/ucwong/golang-kv github.com/ucwong/golang-kv/badger @@ -1270,8 +1271,7 @@ modernc.org/sqlite/lib ## explicit; go 1.17 rsc.io/tmplfunc rsc.io/tmplfunc/internal/parse -# zombiezen.com/go/sqlite v0.13.1 -## explicit; go 1.19 +# zombiezen.com/go/sqlite v1.0.0 +## explicit; go 1.20 zombiezen.com/go/sqlite -zombiezen.com/go/sqlite/fs zombiezen.com/go/sqlite/sqlitex diff --git a/vendor/zombiezen.com/go/sqlite/.envrc b/vendor/zombiezen.com/go/sqlite/.envrc index 6301f82113..0f94eedeb5 100644 --- a/vendor/zombiezen.com/go/sqlite/.envrc +++ b/vendor/zombiezen.com/go/sqlite/.envrc @@ -1,7 +1,2 @@ # shellcheck shell=bash -if command -v lorri >& /dev/null; then - eval "$(lorri direnv)" -else - echo 'Could not find lorri during direnv evaluation' 1>&2 - use nix -fi +use flake diff --git a/vendor/zombiezen.com/go/sqlite/CHANGELOG.md b/vendor/zombiezen.com/go/sqlite/CHANGELOG.md index d1ae5a1798..8021c69255 100644 --- a/vendor/zombiezen.com/go/sqlite/CHANGELOG.md +++ b/vendor/zombiezen.com/go/sqlite/CHANGELOG.md @@ -5,7 +5,37 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -[Unreleased]: https://github.com/zombiezen/go-sqlite/compare/v0.13.1...main +[Unreleased]: https://github.com/zombiezen/go-sqlite/compare/v1.0.0...main + +## [1.0.0][] - 2023-12-07 + +Version 1.0 is the first officially stable release of `zombiezen.com/go/sqlite`. +It includes improved documentation and is cleaned up for current versions of Go. +There are no breaking changes to the API: +this release is more a recognition that the API has been stable +and a promise that it will continue to be stable. + +[1.0.0]: https://github.com/zombiezen/go-sqlite/releases/tag/v1.0.0 + +### Added + +- Added `*Stmt.ColumnIsNull` and `*Stmt.IsNull` methods + ([#55](https://github.com/zombiezen/go-sqlite/issues/55)). +- Added more documentation to `sqlitefile` and `sqlitex`. + +### Changed + +- Replaced `interface{}` with `any`. This should be a compatible change. +- The minimum supported Go version for this library is now Go 1.20. +- The minimum `modernc.org/sqlite` version updated to 1.27.0. + +### Removed + +- Removed the `io.*` interface fields on `sqlitefile.Buffer` and `sqlitefile.File`. + These were unused. +- Removed the `zombiezen.com/go/sqlite/fs` package. + It existed to help transition around Go 1.16, + but is no longer useful. ## [0.13.1][] - 2023-08-15 diff --git a/vendor/zombiezen.com/go/sqlite/flake.lock b/vendor/zombiezen.com/go/sqlite/flake.lock new file mode 100644 index 0000000000..eee5b9a903 --- /dev/null +++ b/vendor/zombiezen.com/go/sqlite/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1701626906, + "narHash": "sha256-ugr1QyzzwNk505ICE4VMQzonHQ9QS5W33xF2FXzFQ00=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0c6d8c783336a59f4c59d4a6daed6ab269c4b361", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/vendor/zombiezen.com/go/sqlite/flake.nix b/vendor/zombiezen.com/go/sqlite/flake.nix new file mode 100644 index 0000000000..5578528a28 --- /dev/null +++ b/vendor/zombiezen.com/go/sqlite/flake.nix @@ -0,0 +1,26 @@ +{ + description = "zombiezen.com/go/sqlite"; + + inputs = { + nixpkgs.url = "nixpkgs"; + flake-utils.url = "flake-utils"; + }; + + outputs = { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.go-tools # staticcheck + pkgs.go_1_20 + pkgs.gotools # godoc, etc. + ]; + + hardeningDisable = [ "fortify" ]; + }; + } + ); +} diff --git a/vendor/zombiezen.com/go/sqlite/fs/doc.go b/vendor/zombiezen.com/go/sqlite/fs/doc.go deleted file mode 100644 index 53bb9d42b7..0000000000 --- a/vendor/zombiezen.com/go/sqlite/fs/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2021 Ross Light -// SPDX-License-Identifier: ISC - -// Package fs provides a fallback for the io/fs package in Go 1.16. -package fs diff --git a/vendor/zombiezen.com/go/sqlite/fs/fs.go b/vendor/zombiezen.com/go/sqlite/fs/fs.go deleted file mode 100644 index 276d5caf74..0000000000 --- a/vendor/zombiezen.com/go/sqlite/fs/fs.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Ross Light -// SPDX-License-Identifier: ISC - -// +build !go1.16 - -package fs - -import ( - "os" -) - -// FS is a copy of Go 1.16's io/fs.FS interface. -type FS interface { - Open(name string) (File, error) -} - -// File is a copy of Go 1.16's io/fs.File interface. -type File interface { - Stat() (os.FileInfo, error) - Read([]byte) (int, error) - Close() error -} diff --git a/vendor/zombiezen.com/go/sqlite/fs/fs_go116.go b/vendor/zombiezen.com/go/sqlite/fs/fs_go116.go deleted file mode 100644 index 1b98f6bb58..0000000000 --- a/vendor/zombiezen.com/go/sqlite/fs/fs_go116.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2021 Ross Light -// SPDX-License-Identifier: ISC - -// +build go1.16 - -package fs - -import "io/fs" - -// FS is an alias for the io/fs.FS interface. -type FS = fs.FS - -// File is an alias for the io/fs.File interface. -type File = fs.File diff --git a/vendor/zombiezen.com/go/sqlite/func.go b/vendor/zombiezen.com/go/sqlite/func.go index fd7f822c32..42ee45234e 100644 --- a/vendor/zombiezen.com/go/sqlite/func.go +++ b/vendor/zombiezen.com/go/sqlite/func.go @@ -34,7 +34,7 @@ import ( var auxdata struct { mu sync.RWMutex - m map[uintptr]interface{} + m map[uintptr]any ids idGen } @@ -68,7 +68,7 @@ func (ctx Context) Conn() *Conn { // invocations of the same function. // // For more details, see https://www.sqlite.org/c3ref/get_auxdata.html -func (ctx Context) AuxData(arg int) interface{} { +func (ctx Context) AuxData(arg int) any { id := lib.Xsqlite3_get_auxdata(ctx.tls, ctx.ptr, int32(arg)) if id == 0 { return nil @@ -93,11 +93,11 @@ func (ctx Context) AuxData(arg int) interface{} { // invocations of the same function. // // For more details, see https://www.sqlite.org/c3ref/get_auxdata.html -func (ctx Context) SetAuxData(arg int, data interface{}) { +func (ctx Context) SetAuxData(arg int, data any) { auxdata.mu.Lock() id := auxdata.ids.next() if auxdata.m == nil { - auxdata.m = make(map[uintptr]interface{}) + auxdata.m = make(map[uintptr]any) } auxdata.m[id] = data auxdata.mu.Unlock() @@ -207,7 +207,7 @@ func BlobValue(b []byte) Value { } // Unchanged returns a NULL Value for which [Value.NoChange] reports true. -// This is only significant as the return value for [VTableCursor.Column]. +// This is only significant as the return value for the Column method of [VTableCursor]. func Unchanged() Value { return Value{n: 1} } @@ -365,10 +365,10 @@ func (v Value) Blob() []byte { } // NoChange reports whether a column -// corresponding to this value in a [VTable.Update] method +// corresponding to this value in a [VTable] Update method // is unchanged by the UPDATE operation -// that the VTable.Update method call was invoked to implement -// and if the prior [VTableCursor.Column] method call that was invoked +// that the Update method call was invoked to implement +// and if the prior [VTableCursor] Column method call that was invoked // to extract the value for that column returned [Unchanged]. func (v Value) NoChange() bool { if v.ptrOrType == 0 { diff --git a/vendor/zombiezen.com/go/sqlite/go.work.sum b/vendor/zombiezen.com/go/sqlite/go.work.sum index 643b8ea199..4eb48d5c74 100644 --- a/vendor/zombiezen.com/go/sqlite/go.work.sum +++ b/vendor/zombiezen.com/go/sqlite/go.work.sum @@ -1,7 +1,5 @@ github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -10,30 +8,23 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= -modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.15.1 h1:mOQwiEK4p7HruMZcwKTZPw/aqtGM4aY00uzWhlKKYws= -modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.7.0 h1:xkDw/KepgEjeizO2sNco+hqYkU12taxQFqPEmgm1GWE= modernc.org/z v1.7.0/go.mod h1:hVdgNMh8ggTuRG1rGU8x+xGRFfiQUIAw0ZqlPy8+HyQ= diff --git a/vendor/zombiezen.com/go/sqlite/index_constraint.go b/vendor/zombiezen.com/go/sqlite/index_constraint.go index ef19baf36e..0ea0bb9760 100644 --- a/vendor/zombiezen.com/go/sqlite/index_constraint.go +++ b/vendor/zombiezen.com/go/sqlite/index_constraint.go @@ -21,14 +21,14 @@ type IndexConstraint struct { Column int // Op is the constraint's operator. Op IndexConstraintOp - // Usable indicates whether [VTable.BestIndex] should consider the constraint. + // Usable indicates whether BestIndex should consider the constraint. // Usable may false depending on how tables are ordered in a join. Usable bool // Collation is the name of the collating sequence // that should be used when evaluating the constraint. Collation string // RValue is the right-hand operand, if known during statement preparation. - // It's only valid until the end of [VTable.BestIndex]. + // It's only valid until the end of BestIndex. RValue Value // RValueKnown indicates whether RValue is set. RValueKnown bool diff --git a/vendor/zombiezen.com/go/sqlite/session.go b/vendor/zombiezen.com/go/sqlite/session.go index 19ed68ae65..ebd363cbdb 100644 --- a/vendor/zombiezen.com/go/sqlite/session.go +++ b/vendor/zombiezen.com/go/sqlite/session.go @@ -20,7 +20,6 @@ package sqlite import ( "fmt" "io" - "io/ioutil" "runtime" "sync" "unsafe" @@ -294,7 +293,7 @@ func (c *Conn) ApplyInverseChangeset(r io.Reader, filterFn func(tableName string pw.CloseWithError(err) }() err := c.ApplyChangeset(pr, filterFn, conflictFn) - io.Copy(ioutil.Discard, pr) // wait for invert goroutine to finish + io.Copy(io.Discard, pr) // wait for invert goroutine to finish return err } diff --git a/vendor/zombiezen.com/go/sqlite/shell.nix b/vendor/zombiezen.com/go/sqlite/shell.nix deleted file mode 100644 index a6cc84efd0..0000000000 --- a/vendor/zombiezen.com/go/sqlite/shell.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/8c66bd1b68f4708c90dcc97c6f7052a5a7b33257.tar.gz") {} -}: - -pkgs.mkShell { - packages = [ - pkgs.go_1_20 - ]; -} diff --git a/vendor/zombiezen.com/go/sqlite/sqlite.go b/vendor/zombiezen.com/go/sqlite/sqlite.go index dc42e57b42..5433834bef 100644 --- a/vendor/zombiezen.com/go/sqlite/sqlite.go +++ b/vendor/zombiezen.com/go/sqlite/sqlite.go @@ -1153,6 +1153,12 @@ func (stmt *Stmt) ColumnType(col int) ColumnType { return ColumnType(lib.Xsqlite3_column_type(stmt.conn.tls, stmt.stmt, int32(col))) } +// ColumnIsNull reports whether the result column holds NULL. +// Column indices start at 0. +func (stmt *Stmt) ColumnIsNull(col int) bool { + return stmt.ColumnType(col) == TypeNull +} + // ColumnText returns a query result as a string. // // Column indices start at 0. @@ -1263,6 +1269,15 @@ func (stmt *Stmt) GetLen(colName string) int { return stmt.ColumnLen(col) } +// IsNull reports whether a query result value for colName is NULL. +func (stmt *Stmt) IsNull(colName string) bool { + col, found := stmt.colNames[colName] + if !found { + return true + } + return stmt.ColumnIsNull(col) +} + func malloc(tls *libc.TLS, n types.Size_t) (uintptr, error) { p := libc.Xmalloc(tls, n) if p == 0 { diff --git a/vendor/zombiezen.com/go/sqlite/sqlitex/doc.go b/vendor/zombiezen.com/go/sqlite/sqlitex/doc.go new file mode 100644 index 0000000000..22e423a5b9 --- /dev/null +++ b/vendor/zombiezen.com/go/sqlite/sqlitex/doc.go @@ -0,0 +1,31 @@ +// Copyright 2023 Ross Light +// SPDX-License-Identifier: ISC + +/* +Package sqlitex provides utilities for working with SQLite. + +# Statements + +To execute a statement from a string, +pass an [ExecOptions] struct to one of the following functions: + + - [Execute] + - [ExecuteScript] + - [ExecuteTransient] + +To execute a statement from a file (typically using [embed]), +pass an [ExecOptions] struct to one of the following functions: + + - [ExecuteFS] + - [ExecuteScriptFS] + - [ExecuteTransientFS] + - [PrepareTransientFS] + +# Transactions and Savepoints + + - [Save] + - [Transaction] + - [ExclusiveTransaction] + - [ImmediateTransaction] +*/ +package sqlitex diff --git a/vendor/zombiezen.com/go/sqlite/sqlitex/exec.go b/vendor/zombiezen.com/go/sqlite/sqlitex/exec.go index edaedee4e3..91da5387ff 100644 --- a/vendor/zombiezen.com/go/sqlite/sqlitex/exec.go +++ b/vendor/zombiezen.com/go/sqlite/sqlitex/exec.go @@ -15,17 +15,16 @@ // // SPDX-License-Identifier: ISC -// Package sqlitex provides utilities for working with SQLite. package sqlitex import ( "fmt" "io" + "io/fs" "reflect" "strings" "zombiezen.com/go/sqlite" - "zombiezen.com/go/sqlite/fs" ) // ExecOptions is the set of optional arguments executing a statement. @@ -43,7 +42,7 @@ type ExecOptions struct { // bool to BindBool // // All other kinds are printed using fmt.Sprint(v) and passed to BindText. - Args []interface{} + Args []any // Named is the set of named arguments to bind to the statement. Keys must // start with ':', '@', or '$'. See https://sqlite.org/lang_expr.html for more @@ -58,7 +57,7 @@ type ExecOptions struct { // bool to BindBool // // All other kinds are printed using fmt.Sprint(v) and passed to BindText. - Named map[string]interface{} + Named map[string]any // ResultFunc is called for each result row. // If ResultFunc returns an error then iteration ceases @@ -74,7 +73,7 @@ type ExecOptions struct { // the error value. // // Any args provided to Exec are bound to numbered parameters of the -// query using the Stmt Bind* methods. Basic reflection on args is used +// query using the [sqlite.Stmt] Bind* methods. Basic reflection on args is used // to map: // // integers to BindInt64 @@ -93,9 +92,9 @@ type ExecOptions struct { // As Exec is implemented using Conn.Prepare, subsequent calls to Exec // with the same statement will reuse the cached statement object. // -// Deprecated: Use Execute. +// Deprecated: Use [Execute]. // Exec skips some argument checks for compatibility with crawshaw.io/sqlite. -func Exec(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...interface{}) error { +func Exec(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...any) error { stmt, err := conn.Prepare(query) if err != nil { return annotateErr(err) @@ -113,7 +112,7 @@ func Exec(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) erro // Execute executes an SQLite query. // -// As Execute is implemented using Conn.Prepare, +// As Execute is implemented using [sqlite.Conn.Prepare], // subsequent calls to Execute with the same statement // will reuse the cached statement object. func Execute(conn *sqlite.Conn, query string, opts *ExecOptions) error { @@ -129,15 +128,15 @@ func Execute(conn *sqlite.Conn, query string, opts *ExecOptions) error { return err } -// ExecFS is an alias for ExecuteFS. +// ExecFS is an alias for [ExecuteFS]. // -// Deprecated: Call ExecuteFS directly. +// Deprecated: Call [ExecuteFS] directly. func ExecFS(conn *sqlite.Conn, fsys fs.FS, filename string, opts *ExecOptions) error { return ExecuteFS(conn, fsys, filename, opts) } // ExecuteFS executes the single statement in the given SQL file. -// ExecuteFS is implemented using Conn.Prepare, +// ExecuteFS is implemented using [sqlite.Conn.Prepare], // so subsequent calls to ExecuteFS with the same statement // will reuse the cached statement object. func ExecuteFS(conn *sqlite.Conn, fsys fs.FS, filename string, opts *ExecOptions) error { @@ -163,12 +162,12 @@ func ExecuteFS(conn *sqlite.Conn, fsys fs.FS, filename string, opts *ExecOptions } // ExecTransient executes an SQLite query without caching the underlying query. -// The interface is exactly the same as Exec. +// The interface is exactly the same as [Exec]. // It is the spiritual equivalent of sqlite3_exec. // -// Deprecated: Use ExecuteTransient. +// Deprecated: Use [ExecuteTransient]. // ExecTransient skips some argument checks for compatibility with crawshaw.io/sqlite. -func ExecTransient(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...interface{}) (err error) { +func ExecTransient(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...any) (err error) { var stmt *sqlite.Stmt var trailingBytes int stmt, trailingBytes, err = conn.PrepareTransient(query) @@ -212,9 +211,9 @@ func ExecuteTransient(conn *sqlite.Conn, query string, opts *ExecOptions) (err e return exec(stmt, forbidMissing|forbidExtra, opts) } -// ExecTransientFS is an alias for ExecuteTransientFS. +// ExecTransientFS is an alias for [ExecuteTransientFS]. // -// Deprecated: Call ExecuteTransientFS directly. +// Deprecated: Call [ExecuteTransientFS] directly. func ExecTransientFS(conn *sqlite.Conn, fsys fs.FS, filename string, opts *ExecOptions) error { return ExecuteTransientFS(conn, fsys, filename, opts) } @@ -244,10 +243,11 @@ func ExecuteTransientFS(conn *sqlite.Conn, fsys fs.FS, filename string, opts *Ex return nil } -// PrepareTransientFS prepares an SQL statement from a file that is not cached by -// the Conn. Subsequent calls with the same query will create new Stmts. -// The caller is responsible for calling Finalize on the returned Stmt when the -// Stmt is no longer needed. +// PrepareTransientFS prepares an SQL statement from a file +// that is not cached by the Conn. +// Subsequent calls with the same query will create new Stmts. +// The caller is responsible for calling [sqlite.Stmt.Finalize] on the returned Stmt +// when the Stmt is no longer needed. func PrepareTransientFS(conn *sqlite.Conn, fsys fs.FS, filename string) (*sqlite.Stmt, error) { query, err := readString(fsys, filename) if err != nil { @@ -329,7 +329,7 @@ func setArg(stmt *sqlite.Stmt, i int, v reflect.Value) { } } -func setNamed(stmt *sqlite.Stmt, provided bitset, flags uint8, args map[string]interface{}) error { +func setNamed(stmt *sqlite.Stmt, provided bitset, flags uint8, args map[string]any) error { if len(args) == 0 { return nil } @@ -377,7 +377,7 @@ func annotateErr(err error) error { } // ExecScript executes a script of SQL statements. -// It is the same as calling ExecuteScript without options. +// It is the same as calling [ExecuteScript] without options. func ExecScript(conn *sqlite.Conn, queries string) (err error) { return ExecuteScript(conn, queries, nil) } @@ -426,9 +426,9 @@ func ExecuteScript(conn *sqlite.Conn, queries string, opts *ExecOptions) (err er return nil } -// ExecScriptFS is an alias for ExecuteScriptFS. +// ExecScriptFS is an alias for [ExecuteScriptFS]. // -// Deprecated: Call ExecuteScriptFS directly. +// Deprecated: Call [ExecuteScriptFS] directly. func ExecScriptFS(conn *sqlite.Conn, fsys fs.FS, filename string, opts *ExecOptions) (err error) { return ExecuteScriptFS(conn, fsys, filename, opts) } diff --git a/vendor/zombiezen.com/go/sqlite/sqlitex/pool.go b/vendor/zombiezen.com/go/sqlite/sqlitex/pool.go index 23d4243a95..7237992551 100644 --- a/vendor/zombiezen.com/go/sqlite/sqlitex/pool.go +++ b/vendor/zombiezen.com/go/sqlite/sqlitex/pool.go @@ -105,8 +105,6 @@ func (p *Pool) Get(ctx context.Context) *sqlite.Conn { select { case conn := <-p.free: ctx, cancel := context.WithCancel(ctx) - // TODO(maybe) - // conn.SetTracer(&tracer{ctx: ctx}) conn.SetInterrupt(ctx.Done()) p.mu.Lock() @@ -186,60 +184,3 @@ type strerror struct { } func (err strerror) Error() string { return err.msg } - -// TODO(maybe) - -// type tracer struct { -// ctx context.Context -// ctxStack []context.Context -// taskStack []*trace.Task -// } - -// func (t *tracer) pctx() context.Context { -// if len(t.ctxStack) != 0 { -// return t.ctxStack[len(t.ctxStack)-1] -// } -// return t.ctx -// } - -// func (t *tracer) Push(name string) { -// ctx, task := trace.NewTask(t.pctx(), name) -// t.ctxStack = append(t.ctxStack, ctx) -// t.taskStack = append(t.taskStack, task) -// } - -// func (t *tracer) Pop() { -// t.taskStack[len(t.taskStack)-1].End() -// t.taskStack = t.taskStack[:len(t.taskStack)-1] -// t.ctxStack = t.ctxStack[:len(t.ctxStack)-1] -// } - -// func (t *tracer) NewTask(name string) sqlite.TracerTask { -// ctx, task := trace.NewTask(t.pctx(), name) -// return &tracerTask{ -// ctx: ctx, -// task: task, -// } -// } - -// type tracerTask struct { -// ctx context.Context -// task *trace.Task -// region *trace.Region -// } - -// func (t *tracerTask) StartRegion(regionType string) { -// if t.region != nil { -// panic("sqlitex.tracerTask.StartRegion: already in region") -// } -// t.region = trace.StartRegion(t.ctx, regionType) -// } - -// func (t *tracerTask) EndRegion() { -// t.region.End() -// t.region = nil -// } - -// func (t *tracerTask) End() { -// t.task.End() -// } diff --git a/vendor/zombiezen.com/go/sqlite/sqlitex/query.go b/vendor/zombiezen.com/go/sqlite/sqlitex/query.go index cc37e472e2..7c930e8f32 100644 --- a/vendor/zombiezen.com/go/sqlite/sqlitex/query.go +++ b/vendor/zombiezen.com/go/sqlite/sqlitex/query.go @@ -38,16 +38,28 @@ func resultTeardown(stmt *sqlite.Stmt) error { return stmt.Reset() } +// ResultBool reports whether the first column of the first and only row +// produced by running stmt +// is non-zero. +// It returns an error if there is not exactly one result row. func ResultBool(stmt *sqlite.Stmt) (bool, error) { res, err := ResultInt64(stmt) return res != 0, err } +// ResultInt returns the first column of the first and only row +// produced by running stmt +// as an integer. +// It returns an error if there is not exactly one result row. func ResultInt(stmt *sqlite.Stmt) (int, error) { res, err := ResultInt64(stmt) return int(res), err } +// ResultInt64 returns the first column of the first and only row +// produced by running stmt +// as an integer. +// It returns an error if there is not exactly one result row. func ResultInt64(stmt *sqlite.Stmt) (int64, error) { if err := resultSetup(stmt); err != nil { return 0, err @@ -59,6 +71,10 @@ func ResultInt64(stmt *sqlite.Stmt) (int64, error) { return res, nil } +// ResultText returns the first column of the first and only row +// produced by running stmt +// as text. +// It returns an error if there is not exactly one result row. func ResultText(stmt *sqlite.Stmt) (string, error) { if err := resultSetup(stmt); err != nil { return "", err @@ -70,6 +86,10 @@ func ResultText(stmt *sqlite.Stmt) (string, error) { return res, nil } +// ResultFloat returns the first column of the first and only row +// produced by running stmt +// as a real number. +// It returns an error if there is not exactly one result row. func ResultFloat(stmt *sqlite.Stmt) (float64, error) { if err := resultSetup(stmt); err != nil { return 0, err diff --git a/vendor/zombiezen.com/go/sqlite/sqlitex/savepoint.go b/vendor/zombiezen.com/go/sqlite/sqlitex/savepoint.go index a589b34f0b..443d5ee308 100644 --- a/vendor/zombiezen.com/go/sqlite/sqlitex/savepoint.go +++ b/vendor/zombiezen.com/go/sqlite/sqlitex/savepoint.go @@ -68,16 +68,7 @@ func savepoint(conn *sqlite.Conn, name string) (releaseFn func(*error), err erro if err := Execute(conn, fmt.Sprintf("SAVEPOINT %q;", name), nil); err != nil { return nil, err } - // TODO(maybe) - // tracer := conn.Tracer() - // if tracer != nil { - // tracer.Push("TX " + name) - // } releaseFn = func(errp *error) { - // TODO(maybe) - // if tracer != nil { - // tracer.Pop() - // } recoverP := recover() // If a query was interrupted or if a user exec'd COMMIT or diff --git a/vendor/zombiezen.com/go/sqlite/vtable.go b/vendor/zombiezen.com/go/sqlite/vtable.go index 1e71b8aa45..c1f00b7270 100644 --- a/vendor/zombiezen.com/go/sqlite/vtable.go +++ b/vendor/zombiezen.com/go/sqlite/vtable.go @@ -59,7 +59,7 @@ type VTableConnectOptions struct { } // VTableConfig specifies the configuration of a [VTable] returned by [VTableConnectFunc]. -// [VTableConfig.Declaration] is the only required field. +// Declaration is the only required field. type VTableConfig struct { // Declaration must be a [CREATE TABLE statement] // that defines the columns in the virtual table and their data type. @@ -70,9 +70,9 @@ type VTableConfig struct { Declaration string // If ConstraintSupport is true, then the virtual table implementation - // guarantees that if [WritableVTable.Update] or [WritableVTable.DeleteRow] - // returns a [ResultConstraint] error, - // it will do so before any modifications to internal or persistent data structures + // guarantees that if Update or DeleteRow on [WritableVTable] + // return a [ResultConstraint] error, + // they will do so before any modifications to internal or persistent data structures // have been made. ConstraintSupport bool @@ -107,7 +107,7 @@ type VTable interface { Destroy() error } -// VTableUpdateParams is the set of parameters to the [WritableVTable.Update] method. +// VTableUpdateParams is the set of parameters to the [WritableVTable] Update method. type VTableUpdateParams struct { OldRowID Value NewRowID Value @@ -169,7 +169,8 @@ type RenameVTable interface { Rename(new string) error } -// IndexInputs is the set of arguments that the SQLite core passes to [VTable.BestIndex]. +// IndexInputs is the set of arguments that the SQLite core passes to +// the [VTable] BestIndex function. type IndexInputs struct { // Constraints corresponds to the WHERE clause. Constraints []IndexConstraint @@ -214,16 +215,17 @@ type IndexOrderBy struct { Desc bool } -// IndexOutputs is the information that [VTable.BestIndex] returns to the SQLite core. +// IndexOutputs is the information that the [VTable] BestIndex function +// returns to the SQLite core. type IndexOutputs struct { - // ConstraintUsage is a mapping from [IndexInputs.Constraints] - // to [VTableCursor.Filter] arguments. - // The mapping is in the same order as [IndexInputs.Constraints] + // ConstraintUsage is a mapping from [IndexInputs] Constraints + // to [VTableCursor] Filter arguments. + // The mapping is in the same order as [IndexInputs] Constraints // and must not contain more than len(IndexInputs.Constraints) elements. // If len(ConstraintUsage) < len(IndexInputs.Constraints), // then ConstraintUsage is treated as if the missing elements have the zero value. ConstraintUsage []IndexConstraintUsage - // ID is used to identify the index in [VTableCursor.Filter]. + // ID is used to identify the index in [VTableCursor] Filter. ID IndexID // OrderByConsumed is true if the output is already ordered. OrderByConsumed bool @@ -288,16 +290,16 @@ func (outputs *IndexOutputs) copyToC(tls *libc.TLS, infoPtr uintptr) error { return nil } -// IndexConstraintUsage maps a single constraint from [IndexInputs.Constraints] -// to a [VTableCursor.Filter] argument in the [IndexOutputs.ConstraintUsage] list. +// IndexConstraintUsage maps a single constraint from [IndexInputs] Constraints +// to a [VTableCursor] Filter argument in the [IndexOutputs] ConstraintUsage list. type IndexConstraintUsage struct { - // ArgvIndex is the intended [VTableCursor.Filter] argument index plus one. + // ArgvIndex is the intended [VTableCursor] Filter argument index plus one. // If ArgvIndex is zero or negative, - // then the constraint is not passed to [VTableCursor.Filter]. - // Within the [IndexOutputs.ConstraintUsage] list, + // then the constraint is not passed to Filter. + // Within the [IndexOutputs] ConstraintUsage list, // there must be exactly one entry with an ArgvIndex of 1, // another of 2, another of 3, and so forth - // to as many or as few as the [VTable.BestIndex] method wants. + // to as many or as few as the [VTable] BestIndex method wants. ArgvIndex int // If Omit is true, then it is a hint to SQLite // that the virtual table will guarantee that the constraint will always be satisfied. @@ -326,14 +328,14 @@ const ( // VTableCursor is a cursor over a [VTable] used to loop through the table. type VTableCursor interface { // Filter begins a search of a virtual table. - // The ID is one that is returned by [VTable.BestIndex]. - // The arguments will be populated as specified by [IndexOutputs.ConstraintUsage]. + // The ID is one that is returned by [VTable] BestIndex. + // The arguments will be populated as specified by ConstraintUsage in [IndexOutputs]. Filter(id IndexID, argv []Value) error // Next advances the cursor to the next row of a result set - // initiated by [VTableCursor.Filter]. + // initiated by a call to [VTableCursor] Filter. // If the cursor is already pointing at the last row when this routine is called, // then the cursor no longer points to valid data - // and a subsequent call to the [VTableCursor.EOF] method must return true. + // and a subsequent call to the [VTableCursor] EOF method must return true. Next() error // Column returns the value for the i-th column of the current row. // Column indices start at 0. @@ -341,7 +343,7 @@ type VTableCursor interface { // If noChange is true, then the column access is part of an UPDATE operation // during which the column value will not change. // This can be used as a hint to return [Unchanged] instead of fetching the value: - // [WritableVTable.Update] implementations can check [Value.NoChange] to test for this condition. + // [WritableVTable] Update implementations can check [Value.NoChange] to test for this condition. Column(i int, noChange bool) (Value, error) // RowID returns the row ID of the row that the cursor is currently pointing at. RowID() (int64, error)