diff --git a/go.mod b/go.mod index f8c40a1f62..2dfcd1357a 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,30 @@ module github.com/CortexFoundation/CortexTheseus -go 1.23 +go 1.23.0 + +toolchain go1.23.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.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.69-0.20240910113603-b146bae422f6 + github.com/CortexFoundation/torrentfs v1.0.69-0.20240919133537-42182e03b31a github.com/VictoriaMetrics/fastcache v1.12.2 github.com/arsham/figurine v1.3.0 github.com/aws/aws-sdk-go-v2 v1.30.5 - github.com/aws/aws-sdk-go-v2/config v1.27.33 - github.com/aws/aws-sdk-go-v2/credentials v1.17.32 - github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 + github.com/aws/aws-sdk-go-v2/config v1.27.35 + github.com/aws/aws-sdk-go-v2/credentials v1.17.33 + github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/cespare/cp v1.1.1 - github.com/charmbracelet/bubbletea v1.1.0 - github.com/cloudflare/cloudflare-go v0.103.0 + github.com/charmbracelet/bubbletea v1.1.1 + github.com/cloudflare/cloudflare-go v0.104.0 github.com/cockroachdb/pebble v1.1.2 github.com/consensys/gnark-crypto v0.14.0 github.com/crate-crypto/go-kzg-4844 v1.1.0 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/deckarep/golang-set/v2 v2.6.0 - github.com/dop251/goja v0.0.0-20240828124009-016eb7256539 + github.com/dop251/goja v0.0.0-20240919115326-6c7d1df7ff05 github.com/ethereum/c-kzg-4844 v1.0.3 github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e @@ -85,20 +87,19 @@ require ( github.com/RoaringBitmap/roaring v1.9.4 // indirect github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect github.com/alecthomas/atomic v0.1.0-alpha2 // indirect - github.com/anacrolix/chansync v0.5.1 // indirect - github.com/anacrolix/dht/v2 v2.21.1 // indirect + github.com/anacrolix/chansync v0.6.0 // indirect + github.com/anacrolix/dht/v2 v2.21.2 // indirect github.com/anacrolix/envpprof v1.3.0 // indirect github.com/anacrolix/generics v0.0.2 // indirect github.com/anacrolix/go-libutp v1.3.1 // indirect github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 // indirect github.com/anacrolix/missinggo v1.3.0 // indirect - github.com/anacrolix/missinggo/perf v1.0.0 // indirect - github.com/anacrolix/missinggo/v2 v2.7.3 // indirect - github.com/anacrolix/mmsg v1.0.0 // indirect + github.com/anacrolix/missinggo/v2 v2.7.4 // indirect + github.com/anacrolix/mmsg v1.1.1 // indirect github.com/anacrolix/multiless v0.3.1-0.20221221005021-2d12701f83f7 // indirect github.com/anacrolix/stm v0.5.0 // indirect - github.com/anacrolix/sync v0.5.1 // indirect - github.com/anacrolix/torrent v1.56.2-0.20240909105636-b80f6b65f205 // indirect + github.com/anacrolix/sync v0.5.2 // indirect + github.com/anacrolix/torrent v1.57.1-0.20240918090318-144b57016ca9 // indirect github.com/anacrolix/upnp v0.1.4 // indirect github.com/anacrolix/utp v0.2.0 // indirect github.com/antlabs/stl v0.0.2 // indirect @@ -111,21 +112,21 @@ require ( github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 // indirect - github.com/aws/smithy-go v1.20.4 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 // indirect + github.com/aws/smithy-go v1.21.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.14.2 // indirect + github.com/bits-and-blooms/bitset v1.14.3 // indirect github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charmbracelet/lipgloss v0.13.0 // indirect - github.com/charmbracelet/x/ansi v0.2.3 // indirect + github.com/charmbracelet/x/ansi v0.3.2 // indirect github.com/charmbracelet/x/term v0.2.0 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect @@ -133,25 +134,25 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/consensys/bavard v0.1.15 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dgraph-io/badger/v4 v4.3.0 // indirect - github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 // indirect + github.com/dgraph-io/ristretto v1.0.0 // indirect github.com/dlclark/regexp2 v1.11.4 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/edsrzf/mmap-go v1.1.1-0.20220903035803-8e5d0fe06024 // indirect github.com/elliotchance/orderedmap v1.6.0 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect - github.com/getsentry/sentry-go v0.28.1 // indirect + github.com/getsentry/sentry-go v0.29.0 // indirect github.com/go-llsqlite/adapter v0.1.0 // indirect github.com/go-llsqlite/crawshaw v0.5.5 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-resty/resty/v2 v2.14.0 // indirect + github.com/go-resty/resty/v2 v2.15.1 // indirect github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect github.com/goccy/go-json v0.10.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -160,7 +161,7 @@ require ( github.com/google/btree v1.1.3 // indirect github.com/google/flatbuffers v24.3.25+incompatible // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9 // indirect + github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/huandu/xstrings v1.5.0 // indirect github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect @@ -189,7 +190,7 @@ require ( github.com/otiai10/mint v1.6.3 // indirect github.com/pion/datachannel v1.5.9 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect - github.com/pion/ice/v2 v2.3.34 // indirect + github.com/pion/ice/v2 v2.3.35 // indirect github.com/pion/interceptor v0.1.30 // indirect github.com/pion/logging v0.2.2 // indirect github.com/pion/mdns v0.0.12 // indirect @@ -202,10 +203,10 @@ require ( github.com/pion/stun v0.6.2-0.20230901070932-d1f1ac894921 // indirect github.com/pion/transport/v2 v2.2.10 // indirect github.com/pion/turn/v2 v2.1.6 // indirect - github.com/pion/webrtc/v3 v3.3.0 // indirect + github.com/pion/webrtc/v3 v3.3.3 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.20.3 // indirect + github.com/prometheus/client_golang v1.20.4 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect @@ -225,7 +226,7 @@ require ( github.com/tklauser/numcpus v0.8.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.24-0.20240909203057-3b4dd9a88aca // indirect + github.com/ucwong/golang-kv v1.0.24-0.20240918082513-1a48acf17d80 // indirect github.com/ucwong/shard v1.0.1-0.20240327124306-59a521744cae // indirect github.com/wlynxg/anet v0.0.4 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect @@ -235,18 +236,18 @@ require ( github.com/zeebo/xxh3 v1.0.3-0.20230502181907-3808c706a06a // indirect go.etcd.io/bbolt v1.3.11 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/term v0.24.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.3.0 // indirect - modernc.org/libc v1.60.1 // indirect + modernc.org/libc v1.61.0 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.8.0 // indirect - modernc.org/sqlite v1.32.0 // indirect + modernc.org/sqlite v1.33.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect zombiezen.com/go/sqlite v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 5c23f74a5f..2300908b10 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xP github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 h1:Be6KInmFEKV81c0pOAEbRYehLMwmmGI1exuFj248AMk= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0/go.mod h1:WCPBHsOXfBVnivScjs2ypRfimjEW0qPVLGgJkZlrIOA= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 h1:cf+OIKbkmMHBaC3u78AXomweqM0oxQSgBXRZf3WH4yM= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1/go.mod h1:ap1dmS6vQKJxSMNiGJcq4QuUQkOynyD93gLw6MDF7ek= github.com/Azure/azure-storage-blob-go v0.8.1-0.20191213204130-762620a866ba/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= @@ -70,8 +70,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.69-0.20240910113603-b146bae422f6 h1:GcR8r3nDZQdpHj9wEhMwkrMTqomeccmKwYMlr++GDis= -github.com/CortexFoundation/torrentfs v1.0.69-0.20240910113603-b146bae422f6/go.mod h1:z6KXV1MKXebPHoRC0pnUw9Li6AdF7NxiQY69LIcCfJM= +github.com/CortexFoundation/torrentfs v1.0.69-0.20240919133537-42182e03b31a h1:QB/9ZauieMR9sBHj5BE0T6UwgLhDIcsE+kZkVKTmRLA= +github.com/CortexFoundation/torrentfs v1.0.69-0.20240919133537-42182e03b31a/go.mod h1:Fk38I3zj8mf6dFYrFxgWgP5IihYLPl00iLCxYfY6KIc= github.com/CortexFoundation/wormhole v0.0.2-0.20240624201423-33e289eb7662 h1:rmM5WDx5UX7V4LF1D8LtAOPDzcCKulpZ++NkP8/+Ook= github.com/CortexFoundation/wormhole v0.0.2-0.20240624201423-33e289eb7662/go.mod h1:ipzmPabDgzYKUbXkGVe2gTkBEp+MsDx6pXGiuYzmP6s= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -124,8 +124,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache/v2 v2.2.2/go.mod h1:FppZsIO+IZk7gCuj5FiIDHGygD9xvWQcqg1uIPMb6tY= github.com/allegro/bigcache/v2 v2.2.3/go.mod h1:FppZsIO+IZk7gCuj5FiIDHGygD9xvWQcqg1uIPMb6tY= -github.com/anacrolix/chansync v0.5.1 h1:j+R9DtotkXm40VFjZ8rJTSJkg2Gv1ldZt8kl96lyJJ0= -github.com/anacrolix/chansync v0.5.1/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k= +github.com/anacrolix/chansync v0.6.0 h1:/aQVvZ1yLRhmqEYrr9dC92JwzNBQ/SNnFi4uk+fTkQY= +github.com/anacrolix/chansync v0.6.0/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k= github.com/anacrolix/dht v0.0.0-20180412060941-24cbf25b72a4/go.mod h1:hQfX2BrtuQsLQMYQwsypFAab/GvHg8qxwVi4OJdR1WI= github.com/anacrolix/dht/v2 v2.0.1/go.mod h1:GbTT8BaEtfqab/LPd5tY41f3GvYeii3mmDUK300Ycyo= github.com/anacrolix/dht/v2 v2.2.1-0.20191103020011-1dba080fb358/go.mod h1:d7ARx3WpELh9uOEEr0+8wvQeVTOkPse4UU6dKpv4q0E= @@ -133,8 +133,8 @@ github.com/anacrolix/dht/v2 v2.3.2-0.20200103043204-8dce00767ebd/go.mod h1:cgjKy github.com/anacrolix/dht/v2 v2.5.1-0.20200317023935-129f05e9b752/go.mod h1:7RLvyOjm+ZPA7vgFRP+1eRjFzrh27p/nF0VCk5LcjoU= github.com/anacrolix/dht/v2 v2.6.1-0.20200416071723-3850fa1b802a/go.mod h1:7jf6kAZRU7FFwyeLP3f4LVH8WglAHdMte1mGcq8HQAg= github.com/anacrolix/dht/v2 v2.6.1/go.mod h1:7jf6kAZRU7FFwyeLP3f4LVH8WglAHdMte1mGcq8HQAg= -github.com/anacrolix/dht/v2 v2.21.1 h1:s1rKkfLLcmBHKv4v/mtMkIeHIEptzEFiB6xVu54+5/o= -github.com/anacrolix/dht/v2 v2.21.1/go.mod h1:SDGC+sEs1pnO2sJGYuhvIis7T8749dDHNfcjtdH4e3g= +github.com/anacrolix/dht/v2 v2.21.2 h1:FZ5CcrBz0OaTL5uk6eGRfByDFTPucCcP23Ov0In8uY4= +github.com/anacrolix/dht/v2 v2.21.2/go.mod h1:jlnZMIwBOSE1NQaqftjQOPH7YZr6Hbnzy0Ik/W0h1L4= github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= github.com/anacrolix/envpprof v1.0.1/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4= @@ -173,7 +173,6 @@ github.com/anacrolix/missinggo v1.1.2-0.20190815015349-b888af804467/go.mod h1:MB github.com/anacrolix/missinggo v1.2.1/go.mod h1:J5cMhif8jPmFoC3+Uvob3OXXNIhOUikzMt+uUjeM21Y= github.com/anacrolix/missinggo v1.3.0 h1:06HlMsudotL7BAELRZs0yDZ4yVXsHXGi323QBjAVASw= github.com/anacrolix/missinggo v1.3.0/go.mod h1:bqHm8cE8xr+15uVfMG3BFui/TxyB6//H5fwlq/TeqMc= -github.com/anacrolix/missinggo/perf v1.0.0 h1:7ZOGYziGEBytW49+KmYGTaNfnwUqP1HBsy6BqESAJVw= github.com/anacrolix/missinggo/perf v1.0.0/go.mod h1:ljAFWkBuzkO12MQclXzZrosP5urunoLS0Cbvb4V0uMQ= github.com/anacrolix/missinggo/v2 v2.2.0/go.mod h1:o0jgJoYOyaoYQ4E2ZMISVa9c88BbUBVQQW4QeRkNCGY= github.com/anacrolix/missinggo/v2 v2.2.1-0.20191103010835-12360f38ced0/go.mod h1:ZzG3/cc3t+5zcYWAgYrJW0MBsSwNwOkTlNquBbP51Bc= @@ -182,11 +181,13 @@ github.com/anacrolix/missinggo/v2 v2.3.1/go.mod h1:3XNH0OEmyMUZuvXmYdl+FDfXd0vvS github.com/anacrolix/missinggo/v2 v2.4.1-0.20200227072623-f02f6484f997/go.mod h1:KY+ij+mWvwGuqSuecLjjPv5LFw5ICUc1UvRems3VAZE= github.com/anacrolix/missinggo/v2 v2.4.1-0.20200419051441-747d9d7544c6/go.mod h1:HYuCbwvJXY3XbcmcIcTgZXHleoDXawxPWx/YiPzFzV0= github.com/anacrolix/missinggo/v2 v2.5.1/go.mod h1:WEjqh2rmKECd0t1VhQkLGTdIWXO6f6NLjp5GlMZ+6FA= -github.com/anacrolix/missinggo/v2 v2.7.3 h1:Ee//CmZBMadeNiYB/hHo9ly2PFOEZ4Fhsbnug3rDAIE= github.com/anacrolix/missinggo/v2 v2.7.3/go.mod h1:mIEtp9pgaXqt8VQ3NQxFOod/eQ1H0D1XsZzKUQfwtac= +github.com/anacrolix/missinggo/v2 v2.7.4 h1:47h5OXoPV8JbA/ACA+FLwKdYbAinuDO8osc2Cu9xkxg= +github.com/anacrolix/missinggo/v2 v2.7.4/go.mod h1:vVO5FEziQm+NFmJesc7StpkquZk+WJFCaL0Wp//2sa0= github.com/anacrolix/mmsg v0.0.0-20180515031531-a4a3ba1fc8bb/go.mod h1:x2/ErsYUmT77kezS63+wzZp8E3byYB0gzirM/WMBLfw= -github.com/anacrolix/mmsg v1.0.0 h1:btC7YLjOn29aTUAExJiVUhQOuf/8rhm+/nWCMAnL3Hg= github.com/anacrolix/mmsg v1.0.0/go.mod h1:x8kRaJY/dCrY9Al0PEcj1mb/uFHwP6GCJ9fLl4thEPc= +github.com/anacrolix/mmsg v1.1.1 h1:4ce/3I5kM7qSF6T5A8MOmDCfac3UqYlk5Bzh5XsWebM= +github.com/anacrolix/mmsg v1.1.1/go.mod h1:lPCXEN1eDDQtKktdKEzdw+roswx6wWPpeXAl/WpWVDU= github.com/anacrolix/multiless v0.0.0-20191223025854-070b7994e841/go.mod h1:TrCLEZfIDbMVfLoQt5tOoiBS/uq4y8+ojuEVVvTNPX4= github.com/anacrolix/multiless v0.0.0-20200413040533-acfd16f65d5d/go.mod h1:TrCLEZfIDbMVfLoQt5tOoiBS/uq4y8+ojuEVVvTNPX4= github.com/anacrolix/multiless v0.3.1-0.20221221005021-2d12701f83f7 h1:lOtCD+LzoD1g7bowhYJNR++uV+FyY5bTZXKwnPex9S8= @@ -201,8 +202,8 @@ github.com/anacrolix/sync v0.0.0-20180611022320-3c4cb11f5a01/go.mod h1:+u91KiUuf github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778/go.mod h1:s735Etp3joe/voe2sdaXLcqDdJSay1O0OPnM0ystjqk= github.com/anacrolix/sync v0.2.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g= github.com/anacrolix/sync v0.3.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g= -github.com/anacrolix/sync v0.5.1 h1:FbGju6GqSjzVoTgcXTUKkF041lnZkG5P0C3T5RL3SGc= -github.com/anacrolix/sync v0.5.1/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g= +github.com/anacrolix/sync v0.5.2 h1:7hfm7p2jUZo9ft0yE2Kqfq/qFTxCWXVIgPuOwmDrV8g= +github.com/anacrolix/sync v0.5.2/go.mod h1:dKQTT766MRNN3FRxT7SaJDYYrAfWIINT9okT5KBX4z0= github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/anacrolix/tagflag v0.0.0-20180605133421-f477c8c2f14c/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/anacrolix/tagflag v0.0.0-20180803105420-3a8ff5428f76/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= @@ -218,8 +219,8 @@ github.com/anacrolix/torrent v1.15.0/go.mod h1:MFc6KcbpAyfwGqOyRkdarUK9QnKA/FkVg github.com/anacrolix/torrent v1.15.1-0.20200504230043-cc5d2abe18e5/go.mod h1:QlOfgrCz5kbvhOz8M58dUwHY5SfZ9VbIvReZ0z0MdIk= github.com/anacrolix/torrent v1.15.1-0.20200619022403-dd51e99b88cc/go.mod h1:wuopQPC5+/M+zHYvhcA2vp5UCTm9rUc+VqjyBa882Q8= github.com/anacrolix/torrent v1.15.1-0.20200715061614-dd906f8fa72e/go.mod h1:XWo/fJN1oKgcjgxM+pUZpvalHfqHDs27BY5mBZjIQWo= -github.com/anacrolix/torrent v1.56.2-0.20240909105636-b80f6b65f205 h1:xBtw6l3Vnu0/yMHLdyjXvpiXXcJoMbJEFQlkyZ0JWyA= -github.com/anacrolix/torrent v1.56.2-0.20240909105636-b80f6b65f205/go.mod h1:SQZfGq/OCMMyIRCNfTpv9E/go4eE9WJR/YY7eC2HYok= +github.com/anacrolix/torrent v1.57.1-0.20240918090318-144b57016ca9 h1:Uapv8ngYEexiQ7fGPi+SlHj/Bz/AOg24QGesorYOtZA= +github.com/anacrolix/torrent v1.57.1-0.20240918090318-144b57016ca9/go.mod h1:1GkdyzTRinhDoLgQ/3HY6jRmRXG1WbZUFfndMlxi8Vg= github.com/anacrolix/upnp v0.1.1/go.mod h1:LXsbsp5h+WGN7YR+0A7iVXm5BL1LYryDev1zuJMWYQo= github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425/go.mod h1:Pz94W3kl8rf+wxH3IbCa9Sq+DTJr8OSbV2Q3/y51vYs= github.com/anacrolix/upnp v0.1.4 h1:+2t2KA6QOhm/49zeNyeVwDu1ZYS9dB9wfxyVvh/wk7U= @@ -262,10 +263,10 @@ github.com/aws/aws-sdk-go v1.31.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= -github.com/aws/aws-sdk-go-v2/config v1.27.33 h1:Nof9o/MsmH4oa0s2q9a0k7tMz5x/Yj5k06lDODWz3BU= -github.com/aws/aws-sdk-go-v2/config v1.27.33/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks= -github.com/aws/aws-sdk-go-v2/credentials v1.17.32 h1:7Cxhp/BnT2RcGy4VisJ9miUPecY+lyE9I8JvcZofn9I= -github.com/aws/aws-sdk-go-v2/credentials v1.17.32/go.mod h1:P5/QMF3/DCHbXGEGkdbilXHsyTBX5D3HSwcrSc9p20I= +github.com/aws/aws-sdk-go-v2/config v1.27.35 h1:jeFgiWYNV0vrgdZqB4kZBjYNdy0IKkwrAjr2fwpHIig= +github.com/aws/aws-sdk-go-v2/config v1.27.35/go.mod h1:qnpEvTq8ZfjrCqmJGRfWZuF+lGZ/vG8LK2K0L/TY1gQ= +github.com/aws/aws-sdk-go-v2/credentials v1.17.33 h1:lBHAQQznENv0gLHAZ73ONiTSkCtr8q3pSqWrpbBBZz0= +github.com/aws/aws-sdk-go-v2/credentials v1.17.33/go.mod h1:MBuqCUOT3ChfLuxNDGyra67eskx7ge9e3YKYBce7wpI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ= @@ -278,16 +279,16 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbL github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE= -github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 h1:957e1/SwXIfPi/0OUJkH9YnPZRe9G6Kisd/xUhF7AUE= -github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2/go.mod h1:343vcjcyOTuHTBBgUrOxPM36/jE96qLZnGL447ldrB0= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 h1:pIaGg+08llrP7Q5aiz9ICWbY8cqhTkyy+0SHvfzQpTc= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.7/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 h1:/Cfdu0XV3mONYKaOt1Gr0k1KvQzkzPyiKUdlWJqy+J4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 h1:NKTa1eqZYw8tiHSRGpP0VtTdub/8KNk8sDkNPFaOKDE= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.7/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= -github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= -github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 h1:hMnlDw1V8y9dKmWxxw3CqMCwx+BVQASeTE02ws+DBWo= +github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3/go.mod h1:343vcjcyOTuHTBBgUrOxPM36/jE96qLZnGL447ldrB0= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 h1:JRwuL+S1Qe1owZQoxblV7ORgRf2o0SrtzDVIbaVCdQ0= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.8/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 h1:+HpGETD9463PFSj7lX5+eq7aLDs85QUIA+NBkeAsscA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 h1:bAi+4p5EKnni+jrfcAhb7iHFQ24bthOAV9t0taf3DCE= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.8/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= +github.com/aws/smithy-go v1.21.0 h1:H7L8dtDRk0P1Qm6y0ji7MCYMQObJ5R9CRpyPhRUkLYA= +github.com/aws/smithy-go v1.21.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= 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= @@ -302,8 +303,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.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bits-and-blooms/bitset v1.14.2 h1:YXVoyPndbdvcEVcseEovVfp0qjJp7S+i5+xgp/Nfbdc= -github.com/bits-and-blooms/bitset v1.14.2/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.14.3 h1:Gd2c8lSNf9pKXom5JtD7AaKO8o7fGQ2LtFj1436qilA= +github.com/bits-and-blooms/bitset v1.14.3/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= @@ -340,23 +341,26 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbletea v1.1.0 h1:FjAl9eAL3HBCHenhz/ZPjkKdScmaS5SK69JAK2YJK9c= -github.com/charmbracelet/bubbletea v1.1.0/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4= +github.com/charmbracelet/bubbletea v1.1.1 h1:KJ2/DnmpfqFtDNVTvYZ6zpPFL9iRCRr0qqKOCvppbPY= +github.com/charmbracelet/bubbletea v1.1.1/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4= github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY= -github.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY= -github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/ansi v0.3.2 h1:wsEwgAN+C9U06l9dCVMX0/L3x7ptvY1qmjMwyfE6USY= +github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.11.7/go.mod h1:GyEn0B58Zvn/XOrkE/R31DrKqjTsBQ9E5ICzRlE09hk= -github.com/cloudflare/cloudflare-go v0.103.0 h1:XXKzgXeUbAo7UTtM4T5wuD2bJPBtNZv7TlZAEy5QI4k= -github.com/cloudflare/cloudflare-go v0.103.0/go.mod h1:0DrjT4g8wgYFYIxhlqR8xi8dNWfyHFGilUkU3+XV8h0= +github.com/cloudflare/cloudflare-go v0.104.0 h1:R/lB0dZupaZbOgibAH/BRrkFbZ6Acn/WsKg2iX2xXuY= +github.com/cloudflare/cloudflare-go v0.104.0/go.mod h1:pfUQ4PIG4ISI0/Mmc21Bp86UnFU0ktmPf3iTgbSL+cM= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= @@ -377,8 +381,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/common-nighthawk/go-figure v0.0.0-20190529165535-67e0ed34491a/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ= github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= -github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= -github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/bavard v0.1.15 h1:fxv2mg1afRMJvZgpwEgLmyr2MsQwaAYcyKf31UBHzw4= +github.com/consensys/bavard v0.1.15/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.14.0 h1:DDBdl4HaBtdQsq/wfMwJvZNE80sHidrK3Nfrefatm0E= github.com/consensys/gnark-crypto v0.14.0/go.mod h1:CU4UijNPsHawiVGNxe9co07FkzCeWHHrb1li/n1XoU0= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -392,8 +396,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a h1:W8mUrRp6NOVl3J+MYp5kPMoUZPp7aOYHtaua31lwRHg= github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a/go.mod h1:sTwzHBvIzm2RfVCGNEBZgRyjwK40bVoun3ZnGOCafNM= github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHHlMnHfoyU4= @@ -414,8 +418,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnN github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dgraph-io/badger/v4 v4.3.0 h1:lcsCE1/1qrRhqP+zYx6xDZb8n7U+QlwNicpc676Ub40= github.com/dgraph-io/badger/v4 v4.3.0/go.mod h1:Sc0T595g8zqAQRDf44n+z3wG4BOqLwceaFntt8KPxUM= -github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 h1:Pux6+xANi0I7RRo5E1gflI4EZ2yx3BGZ75JkAIvGEOA= -github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91/go.mod h1:swkazRqnUf1N62d0Nutz7KIj2UKqsm/H8tD0nBJAXqM= +github.com/dgraph-io/ristretto v1.0.0 h1:SYG07bONKMlFDUYu5pEu3DGAh8c2OFNzKm6G9J4Si84= +github.com/dgraph-io/ristretto v1.0.0/go.mod h1:jTi2FiYEhQ1NsMmA7DeBykizjOuY88NhKBkepyu1jPc= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -427,8 +431,8 @@ github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cn github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20240828124009-016eb7256539 h1:YIxvsQAoCLGScK2c9ag+4sFCgiQFpMzywJG6dQZFu9k= -github.com/dop251/goja v0.0.0-20240828124009-016eb7256539/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= +github.com/dop251/goja v0.0.0-20240919115326-6c7d1df7ff05 h1:oK4+QcKsczZjHYTHD0JAdkvq5w74JEkG95J0XNBx/BI= +github.com/dop251/goja v0.0.0-20240919115326-6c7d1df7ff05/go.mod h1:MxLav0peU43GgvwVgNbLAj1s/bSGboKkhuULvq/7hx4= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -489,8 +493,8 @@ github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILD github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getsentry/sentry-go v0.28.1 h1:zzaSm/vHmGllRM6Tpx1492r0YDzauArdBfkJRtY6P5k= -github.com/getsentry/sentry-go v0.28.1/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg= +github.com/getsentry/sentry-go v0.29.0 h1:YtWluuCFg9OfcqnaujpY918N/AhCCwarIDWOYSBAjCA= +github.com/getsentry/sentry-go v0.29.0/go.mod h1:jhPesDAL0Q0W2+2YEuVOvdWmVtdsr1+jtBrlDEVWwLY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= @@ -507,6 +511,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-llsqlite/adapter v0.1.0 h1:wGSQNsu/rtYeu/lqZNZQMjwUdEF3OW66xTLvsFwJQUw= github.com/go-llsqlite/adapter v0.1.0/go.mod h1:DADrR88ONKPPeSGjFp5iEN55Arx3fi2qXZeKCYDpbmU= github.com/go-llsqlite/crawshaw v0.5.5 h1:sXnRkiV26MBv++lbPbzp+ZzFcTqzVMxftO8yHyFvwUA= @@ -526,8 +531,8 @@ github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW github.com/go-resty/resty/v2 v2.3.0-rc.1/go.mod h1:nYW/8rxqQCmI3bPz9Fsmjbr2FBjGuR2Mzt6kDh3zZ7w= github.com/go-resty/resty/v2 v2.3.1-0.20200619075926-b87f65ce5ed5/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= github.com/go-resty/resty/v2 v2.3.1-0.20200717071130-ca7661ad51fe/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= -github.com/go-resty/resty/v2 v2.14.0 h1:/rhkzsAqGQkozwfKS5aFAbb6TyKd3zyFRWcdRXLPCAU= -github.com/go-resty/resty/v2 v2.14.0/go.mod h1:IW6mekUOsElt9C7oWr0XRt9BNSD6D5rr9mhk6NjmNHg= +github.com/go-resty/resty/v2 v2.15.1 h1:vuna8FM2EaQ6IYbtjh+Gjh00uu7xEWuuGyTKeIaYkvE= +github.com/go-resty/resty/v2 v2.15.1/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sourcemap/sourcemap v2.1.4+incompatible h1:a+iTbH5auLKxaNwQFg0B+TCYl6lbukKPc7b5x0n1s6Q= github.com/go-sourcemap/sourcemap v2.1.4+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= @@ -601,6 +606,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -617,13 +623,15 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9 h1:q5g0N9eal4bmJwXHC5z0QCKs8qhS35hFfq0BAYsIwZI= -github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 h1:c5FlPPgxOn7kJz3VoPLkQYQXGBS3EklQ4Zfi57uOuqQ= +github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -697,6 +705,7 @@ github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63 github.com/huandu/xstrings v1.2.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= @@ -706,6 +715,7 @@ github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFck github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.0/go.mod h1:BwN2XG2lMszOoquQaFdPET8FRQfrXiZsWmcMO9rkaVY= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= @@ -739,11 +749,14 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= @@ -754,6 +767,7 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -771,6 +785,7 @@ github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPR github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -835,6 +850,7 @@ github.com/mattn/go-sqlite3 v1.7.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOq github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.13.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-sqlite3 v2.0.2+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= @@ -878,6 +894,7 @@ github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOEL github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 h1:shk/vn9oCoOTmwcouEdwIeOtOGA/ELRUw/GwvxwfT+0= @@ -971,8 +988,8 @@ github.com/pion/dtls/v2 v2.2.12 h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk= github.com/pion/dtls/v2 v2.2.12/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= github.com/pion/ice v0.7.13/go.mod h1:U3ERMkJgkPMlBjzMe2XxIQPl6ZrfRHyENwGCBoFrWWk= github.com/pion/ice v0.7.14/go.mod h1:/Lz6jAUhsvXed7kNJImXtvVSgjtcdGKoZAZIYb9WEm0= -github.com/pion/ice/v2 v2.3.34 h1:Ic1ppYCj4tUOcPAp76U6F3fVrlSw8A9JtRXLqw6BbUM= -github.com/pion/ice/v2 v2.3.34/go.mod h1:mBF7lnigdqgtB+YHkaY/Y6s6tsyRyo4u4rPGRuOjUBQ= +github.com/pion/ice/v2 v2.3.35 h1:KrmahHoP3VXv40Sd12usQzjKKFNFY0pidsRup7It+RI= +github.com/pion/ice/v2 v2.3.35/go.mod h1:mBF7lnigdqgtB+YHkaY/Y6s6tsyRyo4u4rPGRuOjUBQ= github.com/pion/interceptor v0.1.30 h1:au5rlVHsgmxNi+v/mjOPazbW1SHzfx7/hYOEYQnUcxA= github.com/pion/interceptor v0.1.30/go.mod h1:RQuKT5HTdkP2Fi0cuOS5G5WNymTjzXaGF75J4k7z2nc= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= @@ -1025,8 +1042,8 @@ github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= github.com/pion/webrtc/v2 v2.2.7/go.mod h1:EfCuvKjzMgX4F/aSryRUC7L9o3u2N8WNUgnzd6wOO+8= github.com/pion/webrtc/v2 v2.2.9/go.mod h1:TcArPDphZIBtZ+mh8J/qOREyY3ca7ihQrenulOIvfPQ= -github.com/pion/webrtc/v3 v3.3.0 h1:Rf4u6n6U5t5sUxhYPQk/samzU/oDv7jk6BA5hyO2F9I= -github.com/pion/webrtc/v3 v3.3.0/go.mod h1:hVmrDJvwhEertRWObeb1xzulzHGeVUoPlWvxdGzcfU0= +github.com/pion/webrtc/v3 v3.3.3 h1:Qnh7O8CGvYfxjSZK10N0eFy8u5tzfwaNnEL0ltc/ZcU= +github.com/pion/webrtc/v3 v3.3.3/go.mod h1:9ssmnlmII7ZZtExYe7QXwh1xl6SiynZ9O4ABq+7YXwk= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -1050,8 +1067,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1069,6 +1088,7 @@ github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1079,6 +1099,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -1089,6 +1111,7 @@ github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= @@ -1155,6 +1178,7 @@ github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYED github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= @@ -1242,8 +1266,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.24-0.20240909203057-3b4dd9a88aca h1:z99VLzwH+ZaqStqK/yZDAUD/GVazJyQRCH/tVkgKoQo= -github.com/ucwong/golang-kv v1.0.24-0.20240909203057-3b4dd9a88aca/go.mod h1:TG6mpvQchCY8AIv3AByH//nQRvjbAL3AOOwCW7eI5f4= +github.com/ucwong/golang-kv v1.0.24-0.20240918082513-1a48acf17d80 h1:9SPCNmspp3kBVd9pCa9ek8eHfajSwiYMS1+urN1M1OU= +github.com/ucwong/golang-kv v1.0.24-0.20240918082513-1a48acf17d80/go.mod h1:kWJFWDxXnXjEiEQLxxC3PWPHXdkMktcwVVERWqbMSUw= 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= @@ -1311,12 +1335,12 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1355,11 +1379,7 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1402,9 +1422,6 @@ golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1466,11 +1483,7 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1490,12 +1503,10 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1551,18 +1562,22 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/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= @@ -1575,15 +1590,10 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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= @@ -1591,11 +1601,7 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1609,10 +1615,7 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1658,13 +1661,12 @@ golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200423201157-2723c5de0d66/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1799,30 +1801,56 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= +modernc.org/cc/v3 v3.38.1/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI= +modernc.org/ccgo/v3 v3.0.0-20220910160915-348f15de615a/go.mod h1:8p47QxPkdugex9J4n9P2tLZ9bK01yngIVp00g4nomW0= +modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccgo/v4 v4.21.0 h1:kKPI3dF7RIag8YcToh5ZwDcVMIv6VGa0ED5cvh0LMW4= modernc.org/ccgo/v4 v4.21.0/go.mod h1:h6kt6H/A2+ew/3MW/p6KEoQmrq/i3pr0J/SiwiaF/g0= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= -modernc.org/libc v1.60.1 h1:at373l8IFRTkJIkAU85BIuUoBM4T1b51ds0E1ovPG2s= -modernc.org/libc v1.60.1/go.mod h1:xJuobKuNxKH3RUatS7GjR+suWj+5c2K7bi4m/S5arOY= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA= +modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0= +modernc.org/libc v1.19.0/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= +modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= +modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= +modernc.org/libc v1.21.5/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= +modernc.org/libc v1.61.0 h1:eGFcvWpqlnoGwzZeZe3PWJkkKbM/3SUGyk1DVZQ0TpE= +modernc.org/libc v1.61.0/go.mod h1:DvxVX89wtGTu+r72MLGhygpfi3aUGgZRdAYGCAVVud0= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= -modernc.org/sqlite v1.32.0 h1:6BM4uGza7bWypsw4fdLRsLxut6bHe4c58VeqjRgST8s= -modernc.org/sqlite v1.32.0/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA= +modernc.org/sqlite v1.20.0/go.mod h1:EsYz8rfOvLCiYTy5ZFsOYzoCcRMu98YYkwAcCw5YIYw= +modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM= +modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/tcl v1.15.0/go.mod h1:xRoGotBZ6dU+Zo2tca+2EqVEeMmOUBzHnhIwq4YrVnE= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.0/go.mod h1:hVdgNMh8ggTuRG1rGU8x+xGRFfiQUIAw0ZqlPy8+HyQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= @@ -1833,5 +1861,6 @@ 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.12.0/go.mod h1:RKdRR9xoQDSnB47yy7G4PtrjGZJtupb/SyEbJZLaRes= zombiezen.com/go/sqlite v1.3.0 h1:98g1gnCm+CNz6AuQHu0gqyw7gR2WU3O3PJufDOStpUs= zombiezen.com/go/sqlite v1.3.0/go.mod h1:yRl27//s/9aXU3RWs8uFQwjkTG9gYNGEls6+6SvrclY= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md index 324c8ed0e4..13ab325015 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 1.4.1 (2024-09-18) + +### Features Added +* Added crc64 response header to Put Blob. +* Upgraded service version to `2024-08-04`. + +## 1.4.1-beta.1 (2024-08-27) + +### Features Added +* Upgraded service version to `2024-08-04`. + +### Other Changes +* Updated `azcore` version to `1.14.0` + ## 1.4.0 (2024-07-18) ### Other Changes diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go index adf46b0681..d5bcfb6436 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go @@ -109,6 +109,85 @@ func getHeader(key string, headers map[string][]string) string { return "" } +func getWeightTables() [][]int { + tableLv0 := [...]int{ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721, 0x723, 0x725, + 0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e, + 0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, + 0xe70, 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, + 0x0, 0x0, 0x0, 0x743, 0x744, 0x748, 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, + 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, + 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x74c, 0x0, 0x750, 0x0, + } + tableLv2 := [...]int{ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8012, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8212, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + } + tables := [][]int{tableLv0[:], tableLv2[:]} + return tables +} + +// NewHeaderStringComparer performs a multi-level, weight-based comparison of two strings +func compareHeaders(lhs, rhs string, tables [][]int) int { + currLevel, i, j := 0, 0, 0 + n := len(tables) + lhsLen := len(lhs) + rhsLen := len(rhs) + + for currLevel < n { + if currLevel == (n-1) && i != j { + if i > j { + return -1 + } + if i < j { + return 1 + } + return 0 + } + + w1 := tables[currLevel][lhs[i]] + if i >= lhsLen { + w1 = 0x1 + } + + w2 := tables[currLevel][rhs[j]] + if j >= rhsLen { + w2 = 0x1 + } + + if w1 == 0x1 && w2 == 0x1 { + i = 0 + j = 0 + currLevel++ + } else if w1 == w2 { + i++ + j++ + } else if w1 == 0 { + i++ + } else if w2 == 0 { + j++ + } else { + if w1 < w2 { + return -1 + } + if w1 > w2 { + return 1 + } + return 0 + } + } + return 0 +} + func (c *SharedKeyCredential) buildCanonicalizedHeader(headers http.Header) string { cm := map[string][]string{} for k, v := range headers { @@ -125,7 +204,11 @@ func (c *SharedKeyCredential) buildCanonicalizedHeader(headers http.Header) stri for key := range cm { keys = append(keys, key) } - sort.Strings(keys) + tables := getWeightTables() + // Sort the keys using the custom comparator + sort.Slice(keys, func(i, j int) bool { + return compareHeaders(keys[i], keys[j], tables) < 0 + }) ch := bytes.NewBufferString("") for i, key := range keys { if i > 0 { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go index b3059f6e1f..49377cf52e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go @@ -8,5 +8,5 @@ package exported const ( ModuleName = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" - ModuleVersion = "v1.4.0" + ModuleVersion = "v1.4.1" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md index 9714432c2f..805bbba944 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md @@ -7,7 +7,7 @@ go: true clear-output-folder: false version: "^3.0.0" license-header: MICROSOFT_MIT_NO_VERSION -input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a32d0b2423d19835246bb2ef92941503bfd5e734/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-12-02/blob.json" +input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f6f50c6388fd5836fa142384641b8353a99874ef/specification/storage/data-plane/Microsoft.BlobStorage/stable/2024-08-04/blob.json" credential-scope: "https://storage.azure.com/.default" output-folder: ../generated file-prefix: "zz_" @@ -22,7 +22,7 @@ export-clients: true use: "@autorest/go@4.0.0-preview.65" ``` -### Updating service version to 2024-05-04 +### Updating service version to 2024-08-04 ```yaml directive: - from: @@ -35,8 +35,21 @@ directive: where: $ transform: >- return $. - replaceAll(`[]string{"2021-12-02"}`, `[]string{ServiceVersion}`). - replaceAll(`2021-12-02`, `2024-05-04`); + replaceAll(`[]string{"2021-12-02"}`, `[]string{ServiceVersion}`); +``` + +### Fix CRC Response Header in PutBlob response +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?BlockBlob"].put.responses["201"].headers + transform: > + $["x-ms-content-crc64"] = { + "x-ms-client-name": "ContentCRC64", + "type": "string", + "format": "byte", + "description": "Returned for a block blob so that the client can check the integrity of message content." + }; ``` ### Undo breaking change with BlobName diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go index 1c2a036807..29ba5ef087 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go @@ -6,4 +6,4 @@ package generated -const ServiceVersion = "2024-05-04" +const ServiceVersion = "2024-08-04" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go index 8b24ee0898..ba342d54b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go @@ -29,7 +29,7 @@ type AppendBlobClient struct { // AppendBlob. Append Block is supported only on version 2015-02-21 version or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - body - Initial data // - options - AppendBlobClientAppendBlockOptions contains the optional parameters for the AppendBlobClient.AppendBlock method. @@ -116,7 +116,7 @@ func (client *AppendBlobClient) appendBlockCreateRequest(ctx context.Context, co if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -198,7 +198,7 @@ func (client *AppendBlobClient) appendBlockHandleResponse(resp *http.Response) ( // created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - sourceURL - Specify a URL to the copy source. // - contentLength - The length of the request. // - options - AppendBlobClientAppendBlockFromURLOptions contains the optional parameters for the AppendBlobClient.AppendBlockFromURL @@ -310,7 +310,7 @@ func (client *AppendBlobClient) appendBlockFromURLCreateRequest(ctx context.Cont if options != nil && options.SourceRange != nil { req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -384,7 +384,7 @@ func (client *AppendBlobClient) appendBlockFromURLHandleResponse(resp *http.Resp // Create - The Create Append Blob operation creates a new append blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - options - AppendBlobClientCreateOptions contains the optional parameters for the AppendBlobClient.Create method. // - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method. @@ -494,7 +494,7 @@ func (client *AppendBlobClient) createCreateRequest(ctx context.Context, content if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -557,7 +557,7 @@ func (client *AppendBlobClient) createHandleResponse(resp *http.Response) (Appen // or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - AppendBlobClientSealOptions contains the optional parameters for the AppendBlobClient.Seal method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -615,7 +615,7 @@ func (client *AppendBlobClient) sealCreateRequest(ctx context.Context, options * if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go index f30b81b970..8eea594c59 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go @@ -29,7 +29,7 @@ type BlobClient struct { // blob with zero length and full metadata. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - copyID - The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. // - options - BlobClientAbortCopyFromURLOptions contains the optional parameters for the BlobClient.AbortCopyFromURL method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -72,7 +72,7 @@ func (client *BlobClient) abortCopyFromURLCreateRequest(ctx context.Context, cop if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -101,7 +101,7 @@ func (client *BlobClient) abortCopyFromURLHandleResponse(resp *http.Response) (B // AcquireLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -161,7 +161,7 @@ func (client *BlobClient) acquireLeaseCreateRequest(ctx context.Context, duratio if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -203,7 +203,7 @@ func (client *BlobClient) acquireLeaseHandleResponse(resp *http.Response) (BlobC // BreakLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientBreakLeaseOptions contains the optional parameters for the BlobClient.BreakLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. func (client *BlobClient) BreakLease(ctx context.Context, options *BlobClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobClientBreakLeaseResponse, error) { @@ -259,7 +259,7 @@ func (client *BlobClient) breakLeaseCreateRequest(ctx context.Context, options * if options != nil && options.BreakPeriod != nil { req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -306,7 +306,7 @@ func (client *BlobClient) breakLeaseHandleResponse(resp *http.Response) (BlobCli // ChangeLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - leaseID - Specifies the current lease ID on the resource. // - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed // lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID @@ -365,7 +365,7 @@ func (client *BlobClient) changeLeaseCreateRequest(ctx context.Context, leaseID req.Raw().Header["x-ms-lease-action"] = []string{"change"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -408,7 +408,7 @@ func (client *BlobClient) changeLeaseHandleResponse(resp *http.Response) (BlobCl // until the copy is complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -517,7 +517,7 @@ func (client *BlobClient) copyFromURLCreateRequest(ctx context.Context, copySour if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -582,7 +582,7 @@ func (client *BlobClient) copyFromURLHandleResponse(resp *http.Response) (BlobCl // CreateSnapshot - The Create Snapshot operation creates a read-only snapshot of a blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientCreateSnapshotOptions contains the optional parameters for the BlobClient.CreateSnapshot method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. // - CPKScopeInfo - CPKScopeInfo contains a group of parameters for the BlobClient.SetMetadata method. @@ -659,7 +659,7 @@ func (client *BlobClient) createSnapshotCreateRequest(ctx context.Context, optio } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -721,7 +721,7 @@ func (client *BlobClient) createSnapshotHandleResponse(resp *http.Response) (Blo // return an HTTP status code of 404 (ResourceNotFound). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientDeleteOptions contains the optional parameters for the BlobClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -788,7 +788,7 @@ func (client *BlobClient) deleteCreateRequest(ctx context.Context, options *Blob if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -817,7 +817,7 @@ func (client *BlobClient) deleteHandleResponse(resp *http.Response) (BlobClientD // DeleteImmutabilityPolicy - The Delete Immutability Policy operation deletes the immutability policy on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobClient.DeleteImmutabilityPolicy // method. func (client *BlobClient) DeleteImmutabilityPolicy(ctx context.Context, options *BlobClientDeleteImmutabilityPolicyOptions) (BlobClientDeleteImmutabilityPolicyResponse, error) { @@ -854,7 +854,7 @@ func (client *BlobClient) deleteImmutabilityPolicyCreateRequest(ctx context.Cont if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -884,7 +884,7 @@ func (client *BlobClient) deleteImmutabilityPolicyHandleResponse(resp *http.Resp // can also call Download to read a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientDownloadOptions contains the optional parameters for the BlobClient.Download method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -965,7 +965,7 @@ func (client *BlobClient) downloadCreateRequest(ctx context.Context, options *Bl if options != nil && options.RangeGetContentMD5 != nil { req.Raw().Header["x-ms-range-get-content-md5"] = []string{strconv.FormatBool(*options.RangeGetContentMD5)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1192,7 +1192,7 @@ func (client *BlobClient) downloadHandleResponse(resp *http.Response) (BlobClien // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method. func (client *BlobClient) GetAccountInfo(ctx context.Context, options *BlobClientGetAccountInfoOptions) (BlobClientGetAccountInfoResponse, error) { var err error @@ -1221,9 +1221,15 @@ func (client *BlobClient) getAccountInfoCreateRequest(ctx context.Context, optio reqQP := req.Raw().URL.Query() reqQP.Set("comp", "properties") reqQP.Set("restype", "account") + if options != nil && options.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + if options != nil && options.RequestID != nil { + req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} + } + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1243,6 +1249,13 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo } result.Date = &date } + if val := resp.Header.Get("x-ms-is-hns-enabled"); val != "" { + isHierarchicalNamespaceEnabled, err := strconv.ParseBool(val) + if err != nil { + return BlobClientGetAccountInfoResponse{}, err + } + result.IsHierarchicalNamespaceEnabled = &isHierarchicalNamespaceEnabled + } if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } @@ -1259,7 +1272,7 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo // for the blob. It does not return the content of the blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -1330,7 +1343,7 @@ func (client *BlobClient) getPropertiesCreateRequest(ctx context.Context, option if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1577,7 +1590,7 @@ func (client *BlobClient) getPropertiesHandleResponse(resp *http.Response) (Blob // GetTags - The Get Tags operation enables users to get the tags associated with a blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientGetTagsOptions contains the optional parameters for the BlobClient.GetTags method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -1627,7 +1640,7 @@ func (client *BlobClient) getTagsCreateRequest(ctx context.Context, options *Blo if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1659,7 +1672,7 @@ func (client *BlobClient) getTagsHandleResponse(resp *http.Response) (BlobClient // Query - The Query operation enables users to select/project on blob data by providing simple query expressions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientQueryOptions contains the optional parameters for the BlobClient.Query method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -1729,7 +1742,7 @@ func (client *BlobClient) queryCreateRequest(ctx context.Context, options *BlobC if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if options != nil && options.QueryRequest != nil { if err := runtime.MarshalAsXML(req, *options.QueryRequest); err != nil { return nil, err @@ -1893,7 +1906,7 @@ func (client *BlobClient) queryHandleResponse(resp *http.Response) (BlobClientQu // ReleaseLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - leaseID - Specifies the current lease ID on the resource. // - options - BlobClientReleaseLeaseOptions contains the optional parameters for the BlobClient.ReleaseLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1948,7 +1961,7 @@ func (client *BlobClient) releaseLeaseCreateRequest(ctx context.Context, leaseID } req.Raw().Header["x-ms-lease-action"] = []string{"release"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1987,7 +2000,7 @@ func (client *BlobClient) releaseLeaseHandleResponse(resp *http.Response) (BlobC // RenewLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - leaseID - Specifies the current lease ID on the resource. // - options - BlobClientRenewLeaseOptions contains the optional parameters for the BlobClient.RenewLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2042,7 +2055,7 @@ func (client *BlobClient) renewLeaseCreateRequest(ctx context.Context, leaseID s } req.Raw().Header["x-ms-lease-action"] = []string{"renew"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2084,7 +2097,7 @@ func (client *BlobClient) renewLeaseHandleResponse(resp *http.Response) (BlobCli // SetExpiry - Sets the time a blob will expire and be deleted. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - expiryOptions - Required. Indicates mode of the expiry time // - options - BlobClientSetExpiryOptions contains the optional parameters for the BlobClient.SetExpiry method. func (client *BlobClient) SetExpiry(ctx context.Context, expiryOptions ExpiryOptions, options *BlobClientSetExpiryOptions) (BlobClientSetExpiryResponse, error) { @@ -2125,7 +2138,7 @@ func (client *BlobClient) setExpiryCreateRequest(ctx context.Context, expiryOpti if options != nil && options.ExpiresOn != nil { req.Raw().Header["x-ms-expiry-time"] = []string{*options.ExpiresOn} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2164,7 +2177,7 @@ func (client *BlobClient) setExpiryHandleResponse(resp *http.Response) (BlobClie // SetHTTPHeaders - The Set HTTP Headers operation sets system properties on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientSetHTTPHeadersOptions contains the optional parameters for the BlobClient.SetHTTPHeaders method. // - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -2239,7 +2252,7 @@ func (client *BlobClient) setHTTPHeadersCreateRequest(ctx context.Context, optio if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2285,7 +2298,7 @@ func (client *BlobClient) setHTTPHeadersHandleResponse(resp *http.Response) (Blo // SetImmutabilityPolicy - The Set Immutability Policy operation sets the immutability policy on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientSetImmutabilityPolicyOptions contains the optional parameters for the BlobClient.SetImmutabilityPolicy // method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2332,7 +2345,7 @@ func (client *BlobClient) setImmutabilityPolicyCreateRequest(ctx context.Context if options != nil && options.ImmutabilityPolicyExpiry != nil { req.Raw().Header["x-ms-immutability-policy-until-date"] = []string{(*options.ImmutabilityPolicyExpiry).In(gmt).Format(time.RFC1123)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2371,7 +2384,7 @@ func (client *BlobClient) setImmutabilityPolicyHandleResponse(resp *http.Respons // SetLegalHold - The Set Legal Hold operation sets a legal hold on the blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - legalHold - Specified if a legal hold should be set on the blob. // - options - BlobClientSetLegalHoldOptions contains the optional parameters for the BlobClient.SetLegalHold method. func (client *BlobClient) SetLegalHold(ctx context.Context, legalHold bool, options *BlobClientSetLegalHoldOptions) (BlobClientSetLegalHoldResponse, error) { @@ -2409,7 +2422,7 @@ func (client *BlobClient) setLegalHoldCreateRequest(ctx context.Context, legalHo req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } req.Raw().Header["x-ms-legal-hold"] = []string{strconv.FormatBool(legalHold)} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2446,7 +2459,7 @@ func (client *BlobClient) setLegalHoldHandleResponse(resp *http.Response) (BlobC // pairs // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientSetMetadataOptions contains the optional parameters for the BlobClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -2523,7 +2536,7 @@ func (client *BlobClient) setMetadataCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2578,7 +2591,7 @@ func (client *BlobClient) setMetadataHandleResponse(resp *http.Response) (BlobCl // SetTags - The Set Tags operation enables users to set tags on a blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - tags - Blob tags // - options - BlobClientSetTagsOptions contains the optional parameters for the BlobClient.SetTags method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2632,7 +2645,7 @@ func (client *BlobClient) setTagsCreateRequest(ctx context.Context, tags BlobTag if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := runtime.MarshalAsXML(req, tags); err != nil { return nil, err } @@ -2667,7 +2680,7 @@ func (client *BlobClient) setTagsHandleResponse(resp *http.Response) (BlobClient // storage type. This operation does not update the blob's ETag. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - tier - Indicates the tier to be set on the blob. // - options - BlobClientSetTierOptions contains the optional parameters for the BlobClient.SetTier method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -2722,7 +2735,7 @@ func (client *BlobClient) setTierCreateRequest(ctx context.Context, tier AccessT if options != nil && options.RehydratePriority != nil { req.Raw().Header["x-ms-rehydrate-priority"] = []string{string(*options.RehydratePriority)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2744,7 +2757,7 @@ func (client *BlobClient) setTierHandleResponse(resp *http.Response) (BlobClient // StartCopyFromURL - The Start Copy From URL operation copies a blob or an internet resource to a new blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -2848,7 +2861,7 @@ func (client *BlobClient) startCopyFromURLCreateRequest(ctx context.Context, cop if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -2896,7 +2909,7 @@ func (client *BlobClient) startCopyFromURLHandleResponse(resp *http.Response) (B // Undelete - Undelete a blob that was previously soft deleted // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - BlobClientUndeleteOptions contains the optional parameters for the BlobClient.Undelete method. func (client *BlobClient) Undelete(ctx context.Context, options *BlobClientUndeleteOptions) (BlobClientUndeleteResponse, error) { var err error @@ -2932,7 +2945,7 @@ func (client *BlobClient) undeleteCreateRequest(ctx context.Context, options *Bl if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go index fe4909d73c..13c286c7ed 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go @@ -33,7 +33,7 @@ type BlockBlobClient struct { // belong to. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - blocks - Blob Blocks. // - options - BlockBlobClientCommitBlockListOptions contains the optional parameters for the BlockBlobClient.CommitBlockList // method. @@ -152,7 +152,7 @@ func (client *BlockBlobClient) commitBlockListCreateRequest(ctx context.Context, if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := runtime.MarshalAsXML(req, blocks); err != nil { return nil, err } @@ -224,7 +224,7 @@ func (client *BlockBlobClient) commitBlockListHandleResponse(resp *http.Response // GetBlockList - The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - listType - Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. // - options - BlockBlobClientGetBlockListOptions contains the optional parameters for the BlockBlobClient.GetBlockList method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -273,7 +273,7 @@ func (client *BlockBlobClient) getBlockListCreateRequest(ctx context.Context, li if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -329,7 +329,7 @@ func (client *BlockBlobClient) getBlockListHandleResponse(resp *http.Response) ( // Block from URL API in conjunction with Put Block List. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request @@ -470,7 +470,7 @@ func (client *BlockBlobClient) putBlobFromURLCreateRequest(ctx context.Context, if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -532,7 +532,7 @@ func (client *BlockBlobClient) putBlobFromURLHandleResponse(resp *http.Response) // StageBlock - The Stage Block operation creates a new block to be committed as part of a blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal // to 64 bytes in size. For a given blob, the length of the value specified for the blockid // parameter must be the same size for each block. @@ -599,7 +599,7 @@ func (client *BlockBlobClient) stageBlockCreateRequest(ctx context.Context, bloc if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -659,7 +659,7 @@ func (client *BlockBlobClient) stageBlockHandleResponse(resp *http.Response) (Bl // are read from a URL. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal // to 64 bytes in size. For a given blob, the length of the value specified for the blockid // parameter must be the same size for each block. @@ -748,7 +748,7 @@ func (client *BlockBlobClient) stageBlockFromURLCreateRequest(ctx context.Contex if options != nil && options.SourceRange != nil { req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -807,7 +807,7 @@ func (client *BlockBlobClient) stageBlockFromURLHandleResponse(resp *http.Respon // the content of a block blob, use the Put Block List operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - body - Initial data // - options - BlockBlobClientUploadOptions contains the optional parameters for the BlockBlobClient.Upload method. @@ -927,7 +927,7 @@ func (client *BlockBlobClient) uploadCreateRequest(ctx context.Context, contentL if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -940,6 +940,13 @@ func (client *BlockBlobClient) uploadHandleResponse(resp *http.Response) (BlockB if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } + if val := resp.Header.Get("x-ms-content-crc64"); val != "" { + contentCRC64, err := base64.StdEncoding.DecodeString(val) + if err != nil { + return BlockBlobClientUploadResponse{}, err + } + result.ContentCRC64 = contentCRC64 + } if val := resp.Header.Get("Content-MD5"); val != "" { contentMD5, err := base64.StdEncoding.DecodeString(val) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go index 39958d9580..337df8872b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go @@ -31,7 +31,7 @@ type ContainerClient struct { // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -83,7 +83,7 @@ func (client *ContainerClient) acquireLeaseCreateRequest(ctx context.Context, du if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -126,7 +126,7 @@ func (client *ContainerClient) acquireLeaseHandleResponse(resp *http.Response) ( // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientBreakLeaseOptions contains the optional parameters for the ContainerClient.BreakLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. func (client *ContainerClient) BreakLease(ctx context.Context, options *ContainerClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerClientBreakLeaseResponse, error) { @@ -174,7 +174,7 @@ func (client *ContainerClient) breakLeaseCreateRequest(ctx context.Context, opti if options != nil && options.BreakPeriod != nil { req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -222,7 +222,7 @@ func (client *ContainerClient) breakLeaseHandleResponse(resp *http.Response) (Co // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - leaseID - Specifies the current lease ID on the resource. // - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed // lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID @@ -273,7 +273,7 @@ func (client *ContainerClient) changeLeaseCreateRequest(ctx context.Context, lea req.Raw().Header["x-ms-lease-action"] = []string{"change"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -316,7 +316,7 @@ func (client *ContainerClient) changeLeaseHandleResponse(resp *http.Response) (C // fails // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientCreateOptions contains the optional parameters for the ContainerClient.Create method. // - ContainerCPKScopeInfo - ContainerCPKScopeInfo contains a group of parameters for the ContainerClient.Create method. func (client *ContainerClient) Create(ctx context.Context, options *ContainerClientCreateOptions, containerCPKScopeInfo *ContainerCPKScopeInfo) (ContainerClientCreateResponse, error) { @@ -369,7 +369,7 @@ func (client *ContainerClient) createCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -409,7 +409,7 @@ func (client *ContainerClient) createHandleResponse(resp *http.Response) (Contai // deleted during garbage collection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientDeleteOptions contains the optional parameters for the ContainerClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -456,7 +456,7 @@ func (client *ContainerClient) deleteCreateRequest(ctx context.Context, options if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -486,7 +486,7 @@ func (client *ContainerClient) deleteHandleResponse(resp *http.Response) (Contai // Filter blobs searches within the given container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - where - Filters the results to return only to return only blobs whose tags match the specified expression. // - options - ContainerClientFilterBlobsOptions contains the optional parameters for the ContainerClient.FilterBlobs method. func (client *ContainerClient) FilterBlobs(ctx context.Context, where string, options *ContainerClientFilterBlobsOptions) (ContainerClientFilterBlobsResponse, error) { @@ -534,7 +534,7 @@ func (client *ContainerClient) filterBlobsCreateRequest(ctx context.Context, whe if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -567,7 +567,7 @@ func (client *ContainerClient) filterBlobsHandleResponse(resp *http.Response) (C // be accessed publicly. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientGetAccessPolicyOptions contains the optional parameters for the ContainerClient.GetAccessPolicy // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -609,7 +609,7 @@ func (client *ContainerClient) getAccessPolicyCreateRequest(ctx context.Context, if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -654,7 +654,7 @@ func (client *ContainerClient) getAccessPolicyHandleResponse(resp *http.Response // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo // method. func (client *ContainerClient) GetAccountInfo(ctx context.Context, options *ContainerClientGetAccountInfoOptions) (ContainerClientGetAccountInfoResponse, error) { @@ -684,9 +684,15 @@ func (client *ContainerClient) getAccountInfoCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("comp", "properties") reqQP.Set("restype", "account") + if options != nil && options.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + if options != nil && options.RequestID != nil { + req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} + } + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -706,6 +712,13 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response) } result.Date = &date } + if val := resp.Header.Get("x-ms-is-hns-enabled"); val != "" { + isHierarchicalNamespaceEnabled, err := strconv.ParseBool(val) + if err != nil { + return ContainerClientGetAccountInfoResponse{}, err + } + result.IsHierarchicalNamespaceEnabled = &isHierarchicalNamespaceEnabled + } if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } @@ -722,7 +735,7 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response) // does not include the container's list of blobs // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. func (client *ContainerClient) GetProperties(ctx context.Context, options *ContainerClientGetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (ContainerClientGetPropertiesResponse, error) { @@ -762,7 +775,7 @@ func (client *ContainerClient) getPropertiesCreateRequest(ctx context.Context, o if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -851,7 +864,7 @@ func (client *ContainerClient) getPropertiesHandleResponse(resp *http.Response) // NewListBlobFlatSegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientListBlobFlatSegmentOptions contains the optional parameters for the ContainerClient.NewListBlobFlatSegmentPager // method. // @@ -884,7 +897,7 @@ func (client *ContainerClient) ListBlobFlatSegmentCreateRequest(ctx context.Cont if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -918,7 +931,7 @@ func (client *ContainerClient) ListBlobFlatSegmentHandleResponse(resp *http.Resp // NewListBlobHierarchySegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - delimiter - When the request includes this parameter, the operation returns a BlobPrefix element in the response body that // acts as a placeholder for all blobs whose names begin with the same substring up to the // appearance of the delimiter character. The delimiter may be a single character or a string. @@ -975,7 +988,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentCreateRequest(ctx context if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1011,7 +1024,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentHandleResponse(resp *http // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - leaseID - Specifies the current lease ID on the resource. // - options - ContainerClientReleaseLeaseOptions contains the optional parameters for the ContainerClient.ReleaseLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1058,7 +1071,7 @@ func (client *ContainerClient) releaseLeaseCreateRequest(ctx context.Context, le } req.Raw().Header["x-ms-lease-action"] = []string{"release"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1097,7 +1110,7 @@ func (client *ContainerClient) releaseLeaseHandleResponse(resp *http.Response) ( // Rename - Renames an existing container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - sourceContainerName - Required. Specifies the name of the container to rename. // - options - ContainerClientRenameOptions contains the optional parameters for the ContainerClient.Rename method. func (client *ContainerClient) Rename(ctx context.Context, sourceContainerName string, options *ContainerClientRenameOptions) (ContainerClientRenameResponse, error) { @@ -1139,7 +1152,7 @@ func (client *ContainerClient) renameCreateRequest(ctx context.Context, sourceCo if options != nil && options.SourceLeaseID != nil { req.Raw().Header["x-ms-source-lease-id"] = []string{*options.SourceLeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1169,7 +1182,7 @@ func (client *ContainerClient) renameHandleResponse(resp *http.Response) (Contai // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - leaseID - Specifies the current lease ID on the resource. // - options - ContainerClientRenewLeaseOptions contains the optional parameters for the ContainerClient.RenewLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1216,7 +1229,7 @@ func (client *ContainerClient) renewLeaseCreateRequest(ctx context.Context, leas } req.Raw().Header["x-ms-lease-action"] = []string{"renew"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1258,7 +1271,7 @@ func (client *ContainerClient) renewLeaseHandleResponse(resp *http.Response) (Co // Restore - Restores a previously-deleted container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientRestoreOptions contains the optional parameters for the ContainerClient.Restore method. func (client *ContainerClient) Restore(ctx context.Context, options *ContainerClientRestoreOptions) (ContainerClientRestoreResponse, error) { var err error @@ -1301,7 +1314,7 @@ func (client *ContainerClient) restoreCreateRequest(ctx context.Context, options if options != nil && options.DeletedContainerVersion != nil { req.Raw().Header["x-ms-deleted-container-version"] = []string{*options.DeletedContainerVersion} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1331,7 +1344,7 @@ func (client *ContainerClient) restoreHandleResponse(resp *http.Response) (Conta // may be accessed publicly. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - containerACL - the acls for the container // - options - ContainerClientSetAccessPolicyOptions contains the optional parameters for the ContainerClient.SetAccessPolicy // method. @@ -1384,7 +1397,7 @@ func (client *ContainerClient) setAccessPolicyCreateRequest(ctx context.Context, if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} type wrapper struct { XMLName xml.Name `xml:"SignedIdentifiers"` ContainerACL *[]*SignedIdentifier `xml:"SignedIdentifier"` @@ -1430,7 +1443,7 @@ func (client *ContainerClient) setAccessPolicyHandleResponse(resp *http.Response // SetMetadata - operation sets one or more user-defined name-value pairs for the specified container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ContainerClientSetMetadataOptions contains the optional parameters for the ContainerClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1482,7 +1495,7 @@ func (client *ContainerClient) setMetadataCreateRequest(ctx context.Context, opt } } } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -1521,7 +1534,7 @@ func (client *ContainerClient) setMetadataHandleResponse(resp *http.Response) (C // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header // value: multipart/mixed; boundary=batch_ @@ -1565,7 +1578,7 @@ func (client *ContainerClient) submitBatchCreateRequest(ctx context.Context, con if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := req.SetBody(body, multipartContentType); err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go index 35a67a2791..89d05310a8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go @@ -302,7 +302,13 @@ type BlobClientDownloadOptions struct { // BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method. type BlobClientGetAccountInfoOptions struct { - // placeholder for future optional parameters + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage + // analytics logging is enabled. + RequestID *string + + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + Timeout *int32 } // BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method. @@ -873,7 +879,13 @@ type ContainerClientGetAccessPolicyOptions struct { // ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo method. type ContainerClientGetAccountInfoOptions struct { - // placeholder for future optional parameters + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage + // analytics logging is enabled. + RequestID *string + + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + Timeout *int32 } // ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method. @@ -1357,7 +1369,13 @@ type ServiceClientFilterBlobsOptions struct { // ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method. type ServiceClientGetAccountInfoOptions struct { - // placeholder for future optional parameters + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage + // analytics logging is enabled. + RequestID *string + + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + Timeout *int32 } // ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go index dd040e48a2..9e71d24417 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go @@ -27,7 +27,7 @@ type PageBlobClient struct { // ClearPages - The Clear Pages operation clears a set of pages from a page blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - options - PageBlobClientClearPagesOptions contains the optional parameters for the PageBlobClient.ClearPages method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -114,7 +114,7 @@ func (client *PageBlobClient) clearPagesCreateRequest(ctx context.Context, conte if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -178,7 +178,7 @@ func (client *PageBlobClient) clearPagesHandleResponse(resp *http.Response) (Pag // 2016-05-31. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -235,7 +235,7 @@ func (client *PageBlobClient) copyIncrementalCreateRequest(ctx context.Context, if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil { req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -280,7 +280,7 @@ func (client *PageBlobClient) copyIncrementalHandleResponse(resp *http.Response) // Create - The Create operation creates a new page blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned // to a 512-byte boundary. @@ -399,7 +399,7 @@ func (client *PageBlobClient) createCreateRequest(ctx context.Context, contentLe if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -461,7 +461,7 @@ func (client *PageBlobClient) createHandleResponse(resp *http.Response) (PageBlo // NewGetPageRangesPager - The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot // of a page blob // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - PageBlobClientGetPageRangesOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesPager // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -533,7 +533,7 @@ func (client *PageBlobClient) GetPageRangesCreateRequest(ctx context.Context, op if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -582,7 +582,7 @@ func (client *PageBlobClient) GetPageRangesHandleResponse(resp *http.Response) ( // NewGetPageRangesDiffPager - The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that // were changed between target blob and previous snapshot. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - PageBlobClientGetPageRangesDiffOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesDiffPager // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -660,7 +660,7 @@ func (client *PageBlobClient) GetPageRangesDiffCreateRequest(ctx context.Context if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -709,7 +709,7 @@ func (client *PageBlobClient) GetPageRangesDiffHandleResponse(resp *http.Respons // Resize - Resize the Blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned // to a 512-byte boundary. // - options - PageBlobClientResizeOptions contains the optional parameters for the PageBlobClient.Resize method. @@ -782,7 +782,7 @@ func (client *PageBlobClient) resizeCreateRequest(ctx context.Context, blobConte if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -828,7 +828,7 @@ func (client *PageBlobClient) resizeHandleResponse(resp *http.Response) (PageBlo // UpdateSequenceNumber - Update the sequence number of the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - sequenceNumberAction - Required if the x-ms-blob-sequence-number header is set for the request. This property applies to // page blobs only. This property indicates how the service should modify the blob's sequence number // - options - PageBlobClientUpdateSequenceNumberOptions contains the optional parameters for the PageBlobClient.UpdateSequenceNumber @@ -891,7 +891,7 @@ func (client *PageBlobClient) updateSequenceNumberCreateRequest(ctx context.Cont req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } req.Raw().Header["x-ms-sequence-number-action"] = []string{string(sequenceNumberAction)} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -937,7 +937,7 @@ func (client *PageBlobClient) updateSequenceNumberHandleResponse(resp *http.Resp // UploadPages - The Upload Pages operation writes a range of pages to a page blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - body - Initial data // - options - PageBlobClientUploadPagesOptions contains the optional parameters for the PageBlobClient.UploadPages method. @@ -1031,7 +1031,7 @@ func (client *PageBlobClient) uploadPagesCreateRequest(ctx context.Context, cont if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err } @@ -1108,7 +1108,7 @@ func (client *PageBlobClient) uploadPagesHandleResponse(resp *http.Response) (Pa // a URL // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - sourceURL - Specify a URL to the copy source. // - sourceRange - Bytes of source data in the specified range. The length of this range should match the ContentLength header // and x-ms-range/Range destination range header. @@ -1224,7 +1224,7 @@ func (client *PageBlobClient) uploadPagesFromURLCreateRequest(ctx context.Contex req.Raw().Header["x-ms-source-if-unmodified-since"] = []string{(*sourceModifiedAccessConditions.SourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123)} } req.Raw().Header["x-ms-source-range"] = []string{sourceRange} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go index adb736607f..ff9f3d3de1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go @@ -490,6 +490,9 @@ type BlobClientGetAccountInfoResponse struct { // Date contains the information returned from the Date header response. Date *time.Time + // IsHierarchicalNamespaceEnabled contains the information returned from the x-ms-is-hns-enabled header response. + IsHierarchicalNamespaceEnabled *bool + // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string @@ -1176,6 +1179,9 @@ type BlockBlobClientUploadResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string + // ContentCRC64 contains the information returned from the x-ms-content-crc64 header response. + ContentCRC64 []byte + // ContentMD5 contains the information returned from the Content-MD5 header response. ContentMD5 []byte @@ -1371,6 +1377,9 @@ type ContainerClientGetAccountInfoResponse struct { // Date contains the information returned from the Date header response. Date *time.Time + // IsHierarchicalNamespaceEnabled contains the information returned from the x-ms-is-hns-enabled header response. + IsHierarchicalNamespaceEnabled *bool + // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go index ae58529494..f1533cef0f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go @@ -30,7 +30,7 @@ type ServiceClient struct { // be scoped within the expression to a single container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - where - Filters the results to return only to return only blobs whose tags match the specified expression. // - options - ServiceClientFilterBlobsOptions contains the optional parameters for the ServiceClient.FilterBlobs method. func (client *ServiceClient) FilterBlobs(ctx context.Context, where string, options *ServiceClientFilterBlobsOptions) (ServiceClientFilterBlobsResponse, error) { @@ -77,7 +77,7 @@ func (client *ServiceClient) filterBlobsCreateRequest(ctx context.Context, where if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -109,7 +109,7 @@ func (client *ServiceClient) filterBlobsHandleResponse(resp *http.Response) (Ser // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method. func (client *ServiceClient) GetAccountInfo(ctx context.Context, options *ServiceClientGetAccountInfoOptions) (ServiceClientGetAccountInfoResponse, error) { var err error @@ -138,9 +138,15 @@ func (client *ServiceClient) getAccountInfoCreateRequest(ctx context.Context, op reqQP := req.Raw().URL.Query() reqQP.Set("comp", "properties") reqQP.Set("restype", "account") + if options != nil && options.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + if options != nil && options.RequestID != nil { + req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} + } + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -183,7 +189,7 @@ func (client *ServiceClient) getAccountInfoHandleResponse(resp *http.Response) ( // CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. func (client *ServiceClient) GetProperties(ctx context.Context, options *ServiceClientGetPropertiesOptions) (ServiceClientGetPropertiesResponse, error) { var err error @@ -220,7 +226,7 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, opt if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -246,7 +252,7 @@ func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (S // location endpoint when read-access geo-redundant replication is enabled for the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ServiceClientGetStatisticsOptions contains the optional parameters for the ServiceClient.GetStatistics method. func (client *ServiceClient) GetStatistics(ctx context.Context, options *ServiceClientGetStatisticsOptions) (ServiceClientGetStatisticsResponse, error) { var err error @@ -283,7 +289,7 @@ func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, opt if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -316,7 +322,7 @@ func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (S // bearer token authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - keyInfo - Key information // - options - ServiceClientGetUserDelegationKeyOptions contains the optional parameters for the ServiceClient.GetUserDelegationKey // method. @@ -355,7 +361,7 @@ func (client *ServiceClient) getUserDelegationKeyCreateRequest(ctx context.Conte if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := runtime.MarshalAsXML(req, keyInfo); err != nil { return nil, err } @@ -390,7 +396,7 @@ func (client *ServiceClient) getUserDelegationKeyHandleResponse(resp *http.Respo // NewListContainersSegmentPager - The List Containers Segment operation returns a list of the containers under the specified // account // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - options - ServiceClientListContainersSegmentOptions contains the optional parameters for the ServiceClient.NewListContainersSegmentPager // method. // @@ -422,7 +428,7 @@ func (client *ServiceClient) ListContainersSegmentCreateRequest(ctx context.Cont if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} return req, nil } @@ -448,7 +454,7 @@ func (client *ServiceClient) ListContainersSegmentHandleResponse(resp *http.Resp // and CORS (Cross-Origin Resource Sharing) rules // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - storageServiceProperties - The StorageService properties. // - options - ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method. func (client *ServiceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, options *ServiceClientSetPropertiesOptions) (ServiceClientSetPropertiesResponse, error) { @@ -486,7 +492,7 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, sto if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := runtime.MarshalAsXML(req, storageServiceProperties); err != nil { return nil, err } @@ -511,7 +517,7 @@ func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (S // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2024-08-04 // - contentLength - The length of the request. // - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header // value: multipart/mixed; boundary=batch_ @@ -554,7 +560,7 @@ func (client *ServiceClient) submitBatchCreateRequest(ctx context.Context, conte if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{ServiceVersion} + req.Raw().Header["x-ms-version"] = []string{"2024-08-04"} if err := req.SetBody(body, multipartContentType); err != nil { return nil, err } diff --git a/vendor/github.com/anacrolix/chansync/broadcast-cond.go.go b/vendor/github.com/anacrolix/chansync/broadcast-cond.go.go index 90f56b7cfb..6ca2b288e2 100644 --- a/vendor/github.com/anacrolix/chansync/broadcast-cond.go.go +++ b/vendor/github.com/anacrolix/chansync/broadcast-cond.go.go @@ -1,8 +1,9 @@ package chansync import ( - "github.com/anacrolix/chansync/events" "github.com/anacrolix/sync" + + "github.com/anacrolix/chansync/events" ) // Can be used as zero-value. Due to the caller needing to bring their own synchronization, an diff --git a/vendor/github.com/anacrolix/chansync/flag.go b/vendor/github.com/anacrolix/chansync/flag.go index e9d50612fb..72e203a435 100644 --- a/vendor/github.com/anacrolix/chansync/flag.go +++ b/vendor/github.com/anacrolix/chansync/flag.go @@ -2,6 +2,7 @@ package chansync import ( "sync" + "sync/atomic" "github.com/anacrolix/chansync/events" ) @@ -15,17 +16,23 @@ type ReadOnlyFlag interface { // Flag wraps a boolean value that starts as false (off). You can wait for it to be on or off, and // set the value as needed. type Flag struct { - mu sync.Mutex - on chan struct{} - off chan struct{} - state bool + mu sync.Mutex + // It could be possible to optimize this to only allocate channels when one doesn't exist. + on chan struct{} + off chan struct{} + state atomic.Bool + // It could be possible to optimize this away to just checking if the desired on or off channel + // is present. inited bool } +// To match the SetOnce API. +func (me *Flag) IsSet() bool { + return me.Bool() +} + func (me *Flag) Bool() bool { - me.mu.Lock() - defer me.mu.Unlock() - return me.state + return me.state.Load() } func (me *Flag) On() events.Active { @@ -42,6 +49,8 @@ func (me *Flag) Off() events.Active { return me.off } +// Everywhere this is called then checks state and potentially modifies channels so it's probably +// not worth using sync.Once. func (me *Flag) init() { if me.inited { return @@ -61,25 +70,29 @@ func (me *Flag) SetBool(b bool) { } func (me *Flag) Set() { + if me.state.Load() { + return + } me.mu.Lock() defer me.mu.Unlock() me.init() - if me.state { + if !me.state.CompareAndSwap(false, true) { return } - me.state = true close(me.on) me.off = make(chan struct{}) } func (me *Flag) Clear() { + if !me.state.Load() { + return + } me.mu.Lock() defer me.mu.Unlock() me.init() - if !me.state { + if !me.state.CompareAndSwap(true, false) { return } - me.state = false close(me.off) me.on = make(chan struct{}) } diff --git a/vendor/github.com/anacrolix/chansync/semaphore.go b/vendor/github.com/anacrolix/chansync/semaphore.go index 22a9ac30cb..79e78bda79 100644 --- a/vendor/github.com/anacrolix/chansync/semaphore.go +++ b/vendor/github.com/anacrolix/chansync/semaphore.go @@ -29,3 +29,6 @@ func (me Semaphore) Release() events.Release { func (me Semaphore) Value() int { return len(me.ch) } + +// Returns the resource count when all are available. +func (me Semaphore) Cap() int { return cap(me.ch) } diff --git a/vendor/github.com/anacrolix/dht/v2/server.go b/vendor/github.com/anacrolix/dht/v2/server.go index 7e8086f326..85709d52cd 100644 --- a/vendor/github.com/anacrolix/dht/v2/server.go +++ b/vendor/github.com/anacrolix/dht/v2/server.go @@ -87,7 +87,9 @@ func (s *Server) WriteStatus(w io.Writer) { fmt.Fprintf(w, "Nodes in table: %d good, %d total\n", s.numGoodNodes(), s.numNodes()) fmt.Fprintf(w, "Ongoing transactions: %d\n", s.transactions.NumActive()) fmt.Fprintf(w, "Server node ID: %x\n", s.id.Bytes()) - for i, b := range s.table.buckets { + buckets := &s.table.buckets + for i := range s.table.buckets { + b := &buckets[i] if b.Len() == 0 && b.lastChanged.IsZero() { continue } @@ -1180,7 +1182,15 @@ func (s *Server) Close() { go s.socket.Close() } -func (s *Server) GetPeers(ctx context.Context, addr Addr, infoHash int160.T, scrape bool, rl QueryRateLimiting) (ret QueryResult) { +func (s *Server) GetPeers( + ctx context.Context, + addr Addr, + infoHash int160.T, + // Be advised that if you set this, you might not get any "Return.values" back. That wasn't my + // reading of BEP 33 but there you go. + scrape bool, + rl QueryRateLimiting, +) (ret QueryResult) { args := krpc.MsgArgs{ InfoHash: infoHash.AsByteArray(), // TODO: Maybe IPv4-only Servers won't want IPv6 nodes? @@ -1332,7 +1342,7 @@ func (s *Server) refreshBucket(bucketIndex int) *traversal.Stats { res := s.FindNode(NewAddr(addr.UDP()), id, QueryRateLimiting{}) err := res.Err if err != nil && !errors.Is(err, TransactionTimeout) { - s.logger().Levelf(log.Warning, "error doing find node while refreshing bucket: %v", err) + s.logger().Levelf(log.Debug, "error doing find node while refreshing bucket: %v", err) } return res.TraversalQueryResult(addr) }, diff --git a/vendor/github.com/anacrolix/dht/v2/table.go b/vendor/github.com/anacrolix/dht/v2/table.go index 7bda3ea1cd..0d3398a3ec 100644 --- a/vendor/github.com/anacrolix/dht/v2/table.go +++ b/vendor/github.com/anacrolix/dht/v2/table.go @@ -57,8 +57,8 @@ func (tbl *table) bucketForID(id int160.T) *bucket { } func (tbl *table) numNodes() (num int) { - for _, b := range tbl.buckets { - num += b.Len() + for i := range tbl.buckets { + num += tbl.buckets[i].Len() } return } @@ -74,8 +74,8 @@ func (tbl *table) bucketIndex(id int160.T) int { } func (tbl *table) forNodes(f func(*node) bool) bool { - for _, b := range tbl.buckets { - if !b.EachNode(f) { + for i := range tbl.buckets { + if !tbl.buckets[i].EachNode(f) { return false } } diff --git a/vendor/github.com/anacrolix/missinggo/perf/LICENSE b/vendor/github.com/anacrolix/missinggo/perf/LICENSE deleted file mode 100644 index bd25398f83..0000000000 --- a/vendor/github.com/anacrolix/missinggo/perf/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Matt Joiner - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/anacrolix/missinggo/v2/limitlen.go b/vendor/github.com/anacrolix/missinggo/v2/limitlen.go index 4b77604c61..554e7f6650 100644 --- a/vendor/github.com/anacrolix/missinggo/v2/limitlen.go +++ b/vendor/github.com/anacrolix/missinggo/v2/limitlen.go @@ -1,7 +1,8 @@ package missinggo -// Sets an upper bound on the len of b. max can be any type that will cast to -// int64. +// Deprecated: Use b[:min(len(b), ...)]. +// Sets an upper bound on the len of b. max can be any type +// that will cast to int64. func LimitLen(b []byte, max ...interface{}) []byte { return b[:MinInt(len(b), max...)] } diff --git a/vendor/github.com/anacrolix/missinggo/v2/minmax.go b/vendor/github.com/anacrolix/missinggo/v2/minmax.go index b72f9da976..89f335eda0 100644 --- a/vendor/github.com/anacrolix/missinggo/v2/minmax.go +++ b/vendor/github.com/anacrolix/missinggo/v2/minmax.go @@ -2,6 +2,7 @@ package missinggo import "reflect" +// Deprecated: Use max builtin. func Max(_less interface{}, vals ...interface{}) interface{} { ret := reflect.ValueOf(vals[0]) retType := ret.Type() @@ -16,12 +17,14 @@ func Max(_less interface{}, vals ...interface{}) interface{} { return ret.Interface() } +// Deprecated: Use max builtin. func MaxInt(first int64, rest ...interface{}) int64 { return Max(func(l, r interface{}) bool { return l.(int64) < r.(int64) }, append([]interface{}{first}, rest...)...).(int64) } +// Deprecated: Use min builtin. func MinInt(first interface{}, rest ...interface{}) int64 { ret := reflect.ValueOf(first).Int() for _, _i := range rest { diff --git a/vendor/github.com/anacrolix/missinggo/perf/event.go b/vendor/github.com/anacrolix/missinggo/v2/perf/event.go similarity index 100% rename from vendor/github.com/anacrolix/missinggo/perf/event.go rename to vendor/github.com/anacrolix/missinggo/v2/perf/event.go diff --git a/vendor/github.com/anacrolix/missinggo/perf/events.go b/vendor/github.com/anacrolix/missinggo/v2/perf/events.go similarity index 100% rename from vendor/github.com/anacrolix/missinggo/perf/events.go rename to vendor/github.com/anacrolix/missinggo/v2/perf/events.go diff --git a/vendor/github.com/anacrolix/missinggo/perf/mutex.go b/vendor/github.com/anacrolix/missinggo/v2/perf/mutex.go similarity index 94% rename from vendor/github.com/anacrolix/missinggo/perf/mutex.go rename to vendor/github.com/anacrolix/missinggo/v2/perf/mutex.go index c4ac0d9940..624ea7a430 100644 --- a/vendor/github.com/anacrolix/missinggo/perf/mutex.go +++ b/vendor/github.com/anacrolix/missinggo/v2/perf/mutex.go @@ -3,7 +3,7 @@ package perf import ( "sync" - "github.com/anacrolix/missinggo" + "github.com/anacrolix/missinggo/v2" ) type TimedLocker struct { diff --git a/vendor/github.com/anacrolix/missinggo/perf/scope.go b/vendor/github.com/anacrolix/missinggo/v2/perf/scope.go similarity index 100% rename from vendor/github.com/anacrolix/missinggo/perf/scope.go rename to vendor/github.com/anacrolix/missinggo/v2/perf/scope.go diff --git a/vendor/github.com/anacrolix/missinggo/perf/timer.go b/vendor/github.com/anacrolix/missinggo/v2/perf/timer.go similarity index 100% rename from vendor/github.com/anacrolix/missinggo/perf/timer.go rename to vendor/github.com/anacrolix/missinggo/v2/perf/timer.go diff --git a/vendor/github.com/anacrolix/mmsg/LICENSE b/vendor/github.com/anacrolix/mmsg/LICENSE new file mode 100644 index 0000000000..a612ad9813 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/vendor/github.com/anacrolix/mmsg/README b/vendor/github.com/anacrolix/mmsg/README new file mode 100644 index 0000000000..cc4c07a481 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/README @@ -0,0 +1,8 @@ +github.com/anacrolix/mmsg exposes the batching methods from golang.org/x/net/internal/socket, falling back on OSs that don't implement them. + +golang.org/x/net does expose the batching APIs but you have to be explicit about whether you're using ipv4 or ipv6, and IDGAF, it shouldn't be exposed like that. + +./socket is taken from golang.org/x/net/internal/socket because we need access to the package and it's internal to golang.org/x/net/internal/socket. +./internal/nettest is taken from golang.org/x/net/nettest. I think because ./socket expects it and we don't want to unnecessarily introduce extra dependencies to golang.org/x/net. + +The LICENSE file is taken from golang.org/x/net and put into the respective directories sourced from that module. diff --git a/vendor/github.com/anacrolix/mmsg/mmsg.go b/vendor/github.com/anacrolix/mmsg/mmsg.go index 5ff423bcc1..70bdcba413 100644 --- a/vendor/github.com/anacrolix/mmsg/mmsg.go +++ b/vendor/github.com/anacrolix/mmsg/mmsg.go @@ -1,9 +1,9 @@ package mmsg import ( + "errors" "net" - - "github.com/anacrolix/missinggo/expect" + "strings" "github.com/anacrolix/mmsg/socket" ) @@ -13,6 +13,7 @@ import ( const flags = 0 type Conn struct { + // If this is not nil, attempts to use batch APIs will be skipped automatically. err error s *socket.Conn pr PacketReader @@ -22,11 +23,17 @@ type PacketReader interface { ReadFrom([]byte) (int, net.Addr, error) } +// pr must implement net.Conn for mmsg to be enabled. func NewConn(pr PacketReader) *Conn { ret := Conn{ pr: pr, } - ret.s, ret.err = socket.NewConn(pr) + nc, ok := pr.(net.Conn) + if ok { + ret.s, ret.err = socket.NewConn(nc) + } else { + ret.err = errors.New("mmsg.NewConn: not a net.Conn") + } return &ret } @@ -47,8 +54,10 @@ func (me *Conn) RecvMsgs(ms []Message) (n int, err error) { sms[i].Buffers = ms[i].Buffers } n, err = me.s.RecvMsgs(sms, flags) - if err != nil && err.Error() == "not implemented" { - expect.Nil(me.err) + if err != nil && strings.Contains(err.Error(), "not implemented") { + if me.err != nil { + panic(me.err) + } me.err = err if n <= 0 { return me.recvMsgAsMsgs(ms) @@ -96,6 +105,7 @@ func (me *Message) Payload() (p []byte) { panic(n) } +// Returns not nil if message batching is not working. func (me *Conn) Err() error { return me.err } diff --git a/vendor/github.com/anacrolix/mmsg/socket/LICENSE b/vendor/github.com/anacrolix/mmsg/socket/LICENSE new file mode 100644 index 0000000000..2a7cf70da6 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/LICENSE @@ -0,0 +1,27 @@ +Copyright 2009 The Go Authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google LLC nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr.go index 1eb07d26de..33a5bf59c3 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr.go +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_bsd.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_bsd.go index d1d0c2de54..68f438c845 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_bsd.go +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_bsd.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd openbsd +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_32bit.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_32bit.go index bac66811dd..058ea8de89 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_32bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_32bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm mips mipsle 386 -// +build linux +//go:build (arm || mips || mipsle || 386 || ppc) && linux package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_64bit.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_64bit.go index 63f0534fa7..3ca0d3a0ab 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_64bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_linux_64bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x -// +build linux +//go:build (arm64 || amd64 || loong64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_solaris_64bit.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_solaris_64bit.go index 7dedd430eb..6d0e426cdd 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_solaris_64bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_solaris_64bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 -// +build solaris +//go:build amd64 && solaris package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_stub.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_stub.go index a4e71226f8..7ca9cb7e78 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_stub.go +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_stub.go @@ -2,13 +2,23 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos package socket -type cmsghdr struct{} +func controlHeaderLen() int { + return 0 +} + +func controlMessageLen(dataLen int) int { + return 0 +} -const sizeofCmsghdr = 0 +func controlMessageSpace(dataLen int) int { + return 0 +} + +type cmsghdr struct{} func (h *cmsghdr) len() int { return 0 } func (h *cmsghdr) lvl() int { return 0 } diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_unix.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_unix.go new file mode 100644 index 0000000000..0211f225bf --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_unix.go @@ -0,0 +1,21 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos + +package socket + +import "golang.org/x/sys/unix" + +func controlHeaderLen() int { + return unix.CmsgLen(0) +} + +func controlMessageLen(dataLen int) int { + return unix.CmsgLen(dataLen) +} + +func controlMessageSpace(dataLen int) int { + return unix.CmsgSpace(dataLen) +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_zos_s390x.go b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_zos_s390x.go new file mode 100644 index 0000000000..68dc8ad638 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/cmsghdr_zos_s390x.go @@ -0,0 +1,11 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package socket + +func (h *cmsghdr) set(l, lvl, typ int) { + h.Len = int32(l) + h.Level = int32(lvl) + h.Type = int32(typ) +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/complete_dontwait.go b/vendor/github.com/anacrolix/mmsg/socket/complete_dontwait.go new file mode 100644 index 0000000000..2038f29043 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/complete_dontwait.go @@ -0,0 +1,25 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris + +package socket + +import ( + "syscall" +) + +// ioComplete checks the flags and result of a syscall, to be used as return +// value in a syscall.RawConn.Read or Write callback. +func ioComplete(flags int, operr error) bool { + if flags&syscall.MSG_DONTWAIT != 0 { + // Caller explicitly said don't wait, so always return immediately. + return true + } + if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { + // No data available, block for I/O and try again. + return false + } + return true +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/complete_nodontwait.go b/vendor/github.com/anacrolix/mmsg/socket/complete_nodontwait.go new file mode 100644 index 0000000000..70e6f448b0 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/complete_nodontwait.go @@ -0,0 +1,21 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || windows || zos + +package socket + +import ( + "syscall" +) + +// ioComplete checks the flags and result of a syscall, to be used as return +// value in a syscall.RawConn.Read or Write callback. +func ioComplete(flags int, operr error) bool { + if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { + // No data available, block for I/O and try again. + return false + } + return true +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/empty.s b/vendor/github.com/anacrolix/mmsg/socket/empty.s new file mode 100644 index 0000000000..49d79791e0 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/empty.s @@ -0,0 +1,7 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin && go1.12 + +// This exists solely so we can linkname in symbols from syscall. diff --git a/vendor/github.com/anacrolix/mmsg/socket/error_unix.go b/vendor/github.com/anacrolix/mmsg/socket/error_unix.go index 93dff91802..7a5cc5c43e 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/error_unix.go +++ b/vendor/github.com/anacrolix/mmsg/socket/error_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/iovec_32bit.go b/vendor/github.com/anacrolix/mmsg/socket/iovec_32bit.go index 05d6082d14..340e53fbda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/iovec_32bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/iovec_32bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm mips mipsle 386 -// +build darwin dragonfly freebsd linux netbsd openbsd +//go:build (arm || mips || mipsle || 386 || ppc) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd) package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/iovec_64bit.go b/vendor/github.com/anacrolix/mmsg/socket/iovec_64bit.go index afb34ad58e..26470c191a 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/iovec_64bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/iovec_64bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x -// +build darwin dragonfly freebsd linux netbsd openbsd +//go:build (arm64 || amd64 || loong64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || zos) package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/iovec_solaris_64bit.go b/vendor/github.com/anacrolix/mmsg/socket/iovec_solaris_64bit.go index 8d17a40c40..8859ce1035 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/iovec_solaris_64bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/iovec_solaris_64bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 -// +build solaris +//go:build amd64 && solaris package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/iovec_stub.go b/vendor/github.com/anacrolix/mmsg/socket/iovec_stub.go index c87d2a9339..da886b0326 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/iovec_stub.go +++ b/vendor/github.com/anacrolix/mmsg/socket/iovec_stub.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_stub.go b/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_stub.go index 2e80a9cb74..4825b21e3e 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_stub.go +++ b/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_stub.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !linux,!netbsd +//go:build !aix && !linux && !netbsd package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_unix.go b/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_unix.go index 3c42ea7ad8..311fd2c789 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_unix.go +++ b/vendor/github.com/anacrolix/mmsg/socket/mmsghdr_unix.go @@ -2,29 +2,19 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux netbsd +//go:build aix || linux || netbsd package socket -import "net" +import ( + "net" + "os" + "sync" + "syscall" +) type mmsghdrs []mmsghdr -func (hs mmsghdrs) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr) []byte) error { - for i := range hs { - vs := make([]iovec, len(ms[i].Buffers)) - var sa []byte - if parseFn != nil { - sa = make([]byte, sizeofSockaddrInet6) - } - if marshalFn != nil { - sa = marshalFn(ms[i].Addr) - } - hs[i].Hdr.pack(vs, ms[i].Buffers, ms[i].OOB, sa) - } - return nil -} - func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { for i := range hs { ms[i].N = int(hs[i].Len) @@ -40,3 +30,166 @@ func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, } return nil } + +// mmsghdrsPacker packs Message-slices into mmsghdrs (re-)using pre-allocated buffers. +type mmsghdrsPacker struct { + // hs are the pre-allocated mmsghdrs. + hs mmsghdrs + // sockaddrs is the pre-allocated buffer for the Hdr.Name buffers. + // We use one large buffer for all messages and slice it up. + sockaddrs []byte + // vs are the pre-allocated iovecs. + // We allocate one large buffer for all messages and slice it up. This allows to reuse the buffer + // if the number of buffers per message is distributed differently between calls. + vs []iovec +} + +func (p *mmsghdrsPacker) prepare(ms []Message) { + n := len(ms) + if n <= cap(p.hs) { + p.hs = p.hs[:n] + } else { + p.hs = make(mmsghdrs, n) + } + if n*sizeofSockaddrInet6 <= cap(p.sockaddrs) { + p.sockaddrs = p.sockaddrs[:n*sizeofSockaddrInet6] + } else { + p.sockaddrs = make([]byte, n*sizeofSockaddrInet6) + } + + nb := 0 + for _, m := range ms { + nb += len(m.Buffers) + } + if nb <= cap(p.vs) { + p.vs = p.vs[:nb] + } else { + p.vs = make([]iovec, nb) + } +} + +func (p *mmsghdrsPacker) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr, []byte) int) mmsghdrs { + p.prepare(ms) + hs := p.hs + vsRest := p.vs + saRest := p.sockaddrs + for i := range hs { + nvs := len(ms[i].Buffers) + vs := vsRest[:nvs] + vsRest = vsRest[nvs:] + + var sa []byte + if parseFn != nil { + sa = saRest[:sizeofSockaddrInet6] + saRest = saRest[sizeofSockaddrInet6:] + } else if marshalFn != nil { + n := marshalFn(ms[i].Addr, saRest) + if n > 0 { + sa = saRest[:n] + saRest = saRest[n:] + } + } + hs[i].Hdr.pack(vs, ms[i].Buffers, ms[i].OOB, sa) + } + return hs +} + +// syscaller is a helper to invoke recvmmsg and sendmmsg via the RawConn.Read/Write interface. +// It is reusable, to amortize the overhead of allocating a closure for the function passed to +// RawConn.Read/Write. +type syscaller struct { + n int + operr error + hs mmsghdrs + flags int + + boundRecvmmsgF func(uintptr) bool + boundSendmmsgF func(uintptr) bool +} + +func (r *syscaller) init() { + r.boundRecvmmsgF = r.recvmmsgF + r.boundSendmmsgF = r.sendmmsgF +} + +func (r *syscaller) recvmmsg(c syscall.RawConn, hs mmsghdrs, flags int) (int, error) { + r.n = 0 + r.operr = nil + r.hs = hs + r.flags = flags + if err := c.Read(r.boundRecvmmsgF); err != nil { + return r.n, err + } + if r.operr != nil { + return r.n, os.NewSyscallError("recvmmsg", r.operr) + } + return r.n, nil +} + +func (r *syscaller) recvmmsgF(s uintptr) bool { + r.n, r.operr = recvmmsg(s, r.hs, r.flags) + return ioComplete(r.flags, r.operr) +} + +func (r *syscaller) sendmmsg(c syscall.RawConn, hs mmsghdrs, flags int) (int, error) { + r.n = 0 + r.operr = nil + r.hs = hs + r.flags = flags + if err := c.Write(r.boundSendmmsgF); err != nil { + return r.n, err + } + if r.operr != nil { + return r.n, os.NewSyscallError("sendmmsg", r.operr) + } + return r.n, nil +} + +func (r *syscaller) sendmmsgF(s uintptr) bool { + r.n, r.operr = sendmmsg(s, r.hs, r.flags) + return ioComplete(r.flags, r.operr) +} + +// mmsgTmps holds reusable temporary helpers for recvmmsg and sendmmsg. +type mmsgTmps struct { + packer mmsghdrsPacker + syscaller syscaller +} + +var defaultMmsgTmpsPool = mmsgTmpsPool{ + p: sync.Pool{ + New: func() interface{} { + tmps := new(mmsgTmps) + tmps.syscaller.init() + return tmps + }, + }, +} + +type mmsgTmpsPool struct { + p sync.Pool +} + +func (p *mmsgTmpsPool) Get() *mmsgTmps { + m := p.p.Get().(*mmsgTmps) + // Clear fields up to the len (not the cap) of the slice, + // assuming that the previous caller only used that many elements. + for i := range m.packer.sockaddrs { + m.packer.sockaddrs[i] = 0 + } + m.packer.sockaddrs = m.packer.sockaddrs[:0] + for i := range m.packer.vs { + m.packer.vs[i] = iovec{} + } + m.packer.vs = m.packer.vs[:0] + for i := range m.packer.hs { + m.packer.hs[i].Len = 0 + m.packer.hs[i].Hdr = msghdr{} + } + m.packer.hs = m.packer.hs[:0] + return m +} + +func (p *mmsgTmpsPool) Put(tmps *mmsgTmps) { + p.p.Put(tmps) +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsd.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsd.go index 5567afc88d..ebff4f6e05 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsd.go +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsd.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd openbsd +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsdvar.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsdvar.go index b8c87b72b9..62e6fe8616 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsdvar.go +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_bsdvar.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd +//go:build aix || darwin || dragonfly || freebsd || netbsd package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_32bit.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_32bit.go index a7a5987c88..3dd07250a6 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_32bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_32bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm mips mipsle 386 -// +build linux +//go:build (arm || mips || mipsle || 386 || ppc) && linux package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_64bit.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_64bit.go index 610fc4f3bb..5af9ddd6ab 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_64bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_linux_64bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x -// +build linux +//go:build (arm64 || amd64 || loong64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_solaris_64bit.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_solaris_64bit.go index 6465b20732..e212b50f8d 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/msghdr_solaris_64bit.go +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_solaris_64bit.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 -// +build solaris +//go:build amd64 && solaris package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_stub.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_stub.go index 64e8173352..e876776459 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/msghdr_stub.go +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_stub.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos package socket diff --git a/vendor/github.com/anacrolix/mmsg/socket/msghdr_zos_s390x.go b/vendor/github.com/anacrolix/mmsg/socket/msghdr_zos_s390x.go new file mode 100644 index 0000000000..529db68ee3 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/msghdr_zos_s390x.go @@ -0,0 +1,35 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build s390x && zos + +package socket + +import "unsafe" + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { + for i := range vs { + vs[i].set(bs[i]) + } + if len(vs) > 0 { + h.Iov = &vs[0] + h.Iovlen = int32(len(vs)) + } + if len(oob) > 0 { + h.Control = (*byte)(unsafe.Pointer(&oob[0])) + h.Controllen = uint32(len(oob)) + } + if sa != nil { + h.Name = (*byte)(unsafe.Pointer(&sa[0])) + h.Namelen = uint32(len(sa)) + } +} + +func (h *msghdr) controllen() int { + return int(h.Controllen) +} + +func (h *msghdr) flags() int { + return int(h.Flags) +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/norace.go b/vendor/github.com/anacrolix/mmsg/socket/norace.go new file mode 100644 index 0000000000..8af30ecfbb --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/norace.go @@ -0,0 +1,12 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !race + +package socket + +func (m *Message) raceRead() { +} +func (m *Message) raceWrite() { +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/race.go b/vendor/github.com/anacrolix/mmsg/socket/race.go new file mode 100644 index 0000000000..9afa958083 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/race.go @@ -0,0 +1,37 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build race + +package socket + +import ( + "runtime" + "unsafe" +) + +// This package reads and writes the Message buffers using a +// direct system call, which the race detector can't see. +// These functions tell the race detector what is going on during the syscall. + +func (m *Message) raceRead() { + for _, b := range m.Buffers { + if len(b) > 0 { + runtime.RaceReadRange(unsafe.Pointer(&b[0]), len(b)) + } + } + if b := m.OOB; len(b) > 0 { + runtime.RaceReadRange(unsafe.Pointer(&b[0]), len(b)) + } +} +func (m *Message) raceWrite() { + for _, b := range m.Buffers { + if len(b) > 0 { + runtime.RaceWriteRange(unsafe.Pointer(&b[0]), len(b)) + } + } + if b := m.OOB; len(b) > 0 { + runtime.RaceWriteRange(unsafe.Pointer(&b[0]), len(b)) + } +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/rawconn.go b/vendor/github.com/anacrolix/mmsg/socket/rawconn.go index 31c673e851..87e81071c1 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/rawconn.go +++ b/vendor/github.com/anacrolix/mmsg/socket/rawconn.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.9 - package socket import ( @@ -19,18 +17,45 @@ type Conn struct { c syscall.RawConn } +// tcpConn is an interface implemented by net.TCPConn. +// It can be used for interface assertions to check if a net.Conn is a TCP connection. +type tcpConn interface { + SyscallConn() (syscall.RawConn, error) + SetLinger(int) error +} + +var _ tcpConn = (*net.TCPConn)(nil) + +// udpConn is an interface implemented by net.UDPConn. +// It can be used for interface assertions to check if a net.Conn is a UDP connection. +type udpConn interface { + SyscallConn() (syscall.RawConn, error) + ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) +} + +var _ udpConn = (*net.UDPConn)(nil) + +// ipConn is an interface implemented by net.IPConn. +// It can be used for interface assertions to check if a net.Conn is an IP connection. +type ipConn interface { + SyscallConn() (syscall.RawConn, error) + ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *net.IPAddr, err error) +} + +var _ ipConn = (*net.IPConn)(nil) + // NewConn returns a new raw connection. -func NewConn(c interface{}) (*Conn, error) { +func NewConn(c net.Conn) (*Conn, error) { var err error var cc Conn switch c := c.(type) { - case *net.TCPConn: + case tcpConn: cc.network = "tcp" cc.c, err = c.SyscallConn() - case *net.UDPConn: + case udpConn: cc.network = "udp" cc.c, err = c.SyscallConn() - case *net.IPConn: + case ipConn: cc.network = "ip" cc.c, err = c.SyscallConn() default: diff --git a/vendor/github.com/anacrolix/mmsg/socket/rawconn_mmsg.go b/vendor/github.com/anacrolix/mmsg/socket/rawconn_mmsg.go index 499164a3fb..0431390789 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/rawconn_mmsg.go +++ b/vendor/github.com/anacrolix/mmsg/socket/rawconn_mmsg.go @@ -2,41 +2,29 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.9 -// +build linux +//go:build linux package socket import ( "net" - "os" - "syscall" ) func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { - hs := make(mmsghdrs, len(ms)) + for i := range ms { + ms[i].raceWrite() + } + tmps := defaultMmsgTmpsPool.Get() + defer defaultMmsgTmpsPool.Put(tmps) var parseFn func([]byte, string) (net.Addr, error) if c.network != "tcp" { parseFn = parseInetAddr } - if err := hs.pack(ms, parseFn, nil); err != nil { - return 0, err - } - var operr error - var n int - fn := func(s uintptr) bool { - n, operr = recvmmsg(s, hs, flags) - if operr == syscall.EAGAIN { - return false - } - return true - } - if err := c.c.Read(fn); err != nil { + hs := tmps.packer.pack(ms, parseFn, nil) + n, err := tmps.syscaller.recvmmsg(c.c, hs, flags) + if err != nil { return n, err } - if operr != nil { - return n, os.NewSyscallError("recvmmsg", operr) - } if err := hs[:n].unpack(ms[:n], parseFn, c.network); err != nil { return n, err } @@ -44,29 +32,20 @@ func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { } func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { - hs := make(mmsghdrs, len(ms)) - var marshalFn func(net.Addr) []byte + for i := range ms { + ms[i].raceRead() + } + tmps := defaultMmsgTmpsPool.Get() + defer defaultMmsgTmpsPool.Put(tmps) + var marshalFn func(net.Addr, []byte) int if c.network != "tcp" { marshalFn = marshalInetAddr } - if err := hs.pack(ms, nil, marshalFn); err != nil { - return 0, err - } - var operr error - var n int - fn := func(s uintptr) bool { - n, operr = sendmmsg(s, hs, flags) - if operr == syscall.EAGAIN { - return false - } - return true - } - if err := c.c.Write(fn); err != nil { + hs := tmps.packer.pack(ms, nil, marshalFn) + n, err := tmps.syscaller.sendmmsg(c.c, hs, flags) + if err != nil { return n, err } - if operr != nil { - return n, os.NewSyscallError("sendmmsg", operr) - } if err := hs[:n].unpack(ms[:n], nil, ""); err != nil { return n, err } diff --git a/vendor/github.com/anacrolix/mmsg/socket/rawconn_msg.go b/vendor/github.com/anacrolix/mmsg/socket/rawconn_msg.go index b21d2e6418..7c0d7410bc 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/rawconn_msg.go +++ b/vendor/github.com/anacrolix/mmsg/socket/rawconn_msg.go @@ -2,32 +2,27 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.9 -// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos package socket import ( + "net" "os" - "syscall" ) func (c *Conn) recvMsg(m *Message, flags int) error { - var h msghdr - vs := make([]iovec, len(m.Buffers)) - var sa []byte - if c.network != "tcp" { - sa = make([]byte, sizeofSockaddrInet6) - } - h.pack(vs, m.Buffers, m.OOB, sa) - var operr error - var n int + m.raceWrite() + var ( + operr error + n int + oobn int + recvflags int + from net.Addr + ) fn := func(s uintptr) bool { - n, operr = recvmsg(s, &h, flags) - if operr == syscall.EAGAIN { - return false - } - return true + n, oobn, recvflags, from, operr = recvmsg(s, m.Buffers, m.OOB, flags, c.network) + return ioComplete(flags, operr) } if err := c.c.Read(fn); err != nil { return err @@ -35,35 +30,22 @@ func (c *Conn) recvMsg(m *Message, flags int) error { if operr != nil { return os.NewSyscallError("recvmsg", operr) } - if c.network != "tcp" { - var err error - m.Addr, err = parseInetAddr(sa[:], c.network) - if err != nil { - return err - } - } + m.Addr = from m.N = n - m.NN = h.controllen() - m.Flags = h.flags() + m.NN = oobn + m.Flags = recvflags return nil } func (c *Conn) sendMsg(m *Message, flags int) error { - var h msghdr - vs := make([]iovec, len(m.Buffers)) - var sa []byte - if m.Addr != nil { - sa = marshalInetAddr(m.Addr) - } - h.pack(vs, m.Buffers, m.OOB, sa) - var operr error - var n int + m.raceRead() + var ( + operr error + n int + ) fn := func(s uintptr) bool { - n, operr = sendmsg(s, &h, flags) - if operr == syscall.EAGAIN { - return false - } - return true + n, operr = sendmsg(s, m.Buffers, m.OOB, m.Addr, flags) + return ioComplete(flags, operr) } if err := c.c.Write(fn); err != nil { return err diff --git a/vendor/github.com/anacrolix/mmsg/socket/rawconn_nommsg.go b/vendor/github.com/anacrolix/mmsg/socket/rawconn_nommsg.go index f78832aa4a..e363fb5a89 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/rawconn_nommsg.go +++ b/vendor/github.com/anacrolix/mmsg/socket/rawconn_nommsg.go @@ -2,17 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.9 -// +build !linux +//go:build !linux package socket -import "errors" - func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } diff --git a/vendor/github.com/anacrolix/mmsg/socket/rawconn_nomsg.go b/vendor/github.com/anacrolix/mmsg/socket/rawconn_nomsg.go index 96733cbe1b..ff7a8baf0b 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/rawconn_nomsg.go +++ b/vendor/github.com/anacrolix/mmsg/socket/rawconn_nomsg.go @@ -2,17 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.9 -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos package socket -import "errors" - func (c *Conn) recvMsg(m *Message, flags int) error { - return errors.New("not implemented") + return errNotImplemented } func (c *Conn) sendMsg(m *Message, flags int) error { - return errors.New("not implemented") + return errNotImplemented } diff --git a/vendor/github.com/anacrolix/mmsg/socket/rawconn_stub.go b/vendor/github.com/anacrolix/mmsg/socket/rawconn_stub.go deleted file mode 100644 index d2add1a0aa..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/rawconn_stub.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.9 - -package socket - -import "errors" - -func (c *Conn) recvMsg(m *Message, flags int) error { - return errors.New("not implemented") -} - -func (c *Conn) sendMsg(m *Message, flags int) error { - return errors.New("not implemented") -} - -func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { - return 0, errors.New("not implemented") -} - -func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { - return 0, errors.New("not implemented") -} diff --git a/vendor/github.com/anacrolix/mmsg/socket/reflect.go b/vendor/github.com/anacrolix/mmsg/socket/reflect.go deleted file mode 100644 index bb179f11d8..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/reflect.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.9 - -package socket - -import ( - "errors" - "net" - "os" - "reflect" - "runtime" -) - -// A Conn represents a raw connection. -type Conn struct { - c net.Conn -} - -// NewConn returns a new raw connection. -func NewConn(c net.Conn) (*Conn, error) { - return &Conn{c: c}, nil -} - -func (o *Option) get(c *Conn, b []byte) (int, error) { - s, err := socketOf(c.c) - if err != nil { - return 0, err - } - n, err := getsockopt(s, o.Level, o.Name, b) - return n, os.NewSyscallError("getsockopt", err) -} - -func (o *Option) set(c *Conn, b []byte) error { - s, err := socketOf(c.c) - if err != nil { - return err - } - return os.NewSyscallError("setsockopt", setsockopt(s, o.Level, o.Name, b)) -} - -func socketOf(c net.Conn) (uintptr, error) { - switch c.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - v := reflect.ValueOf(c) - switch e := v.Elem(); e.Kind() { - case reflect.Struct: - fd := e.FieldByName("conn").FieldByName("fd") - switch e := fd.Elem(); e.Kind() { - case reflect.Struct: - sysfd := e.FieldByName("sysfd") - if runtime.GOOS == "windows" { - return uintptr(sysfd.Uint()), nil - } - return uintptr(sysfd.Int()), nil - } - } - } - return 0, errors.New("invalid type") -} diff --git a/vendor/github.com/anacrolix/mmsg/socket/socket.go b/vendor/github.com/anacrolix/mmsg/socket/socket.go index 6b8f5aa620..886f4ba7fa 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/socket.go +++ b/vendor/github.com/anacrolix/mmsg/socket/socket.go @@ -4,14 +4,17 @@ // Package socket provides a portable interface for socket system // calls. -package socket +package socket // import "github.com/anacrolix/mmsg/socket" import ( "errors" "net" + "runtime" "unsafe" ) +var errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH) + // An Option represents a sticky socket option. type Option struct { Level int // level @@ -87,17 +90,9 @@ func (o *Option) SetInt(c *Conn, v int) error { return o.set(c, b) } -func controlHeaderLen() int { - return roundup(sizeofCmsghdr) -} - -func controlMessageLen(dataLen int) int { - return roundup(sizeofCmsghdr) + dataLen -} - // ControlMessageSpace returns the whole length of control message. func ControlMessageSpace(dataLen int) int { - return roundup(sizeofCmsghdr) + roundup(dataLen) + return controlMessageSpace(dataLen) } // A ControlMessage represents the head message in a stream of control diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys.go b/vendor/github.com/anacrolix/mmsg/socket/sys.go index 4f0eead138..4a26af1863 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys.go @@ -9,13 +9,8 @@ import ( "unsafe" ) -var ( - // NativeEndian is the machine native endian implementation of - // ByteOrder. - NativeEndian binary.ByteOrder - - kernelAlign int -) +// NativeEndian is the machine native endian implementation of ByteOrder. +var NativeEndian binary.ByteOrder func init() { i := uint32(1) @@ -25,9 +20,4 @@ func init() { } else { NativeEndian = binary.BigEndian } - kernelAlign = probeProtocolStack() -} - -func roundup(l int) int { - return (l + kernelAlign - 1) & ^(kernelAlign - 1) } diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_bsd.go b/vendor/github.com/anacrolix/mmsg/socket/sys_bsd.go index f13e14ff36..e7664d48be 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_bsd.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_bsd.go @@ -2,16 +2,14 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd openbsd +//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris package socket -import "errors" - func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_bsdvar.go b/vendor/github.com/anacrolix/mmsg/socket/sys_bsdvar.go deleted file mode 100644 index f723fa36af..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_bsdvar.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build freebsd netbsd openbsd - -package socket - -import "unsafe" - -func probeProtocolStack() int { - var p uintptr - return int(unsafe.Sizeof(p)) -} diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_const_unix.go b/vendor/github.com/anacrolix/mmsg/socket/sys_const_unix.go new file mode 100644 index 0000000000..d7627f87eb --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_const_unix.go @@ -0,0 +1,20 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos + +package socket + +import "golang.org/x/sys/unix" + +const ( + sysAF_UNSPEC = unix.AF_UNSPEC + sysAF_INET = unix.AF_INET + sysAF_INET6 = unix.AF_INET6 + + sysSOCK_RAW = unix.SOCK_RAW + + sizeofSockaddrInet4 = unix.SizeofSockaddrInet4 + sizeofSockaddrInet6 = unix.SizeofSockaddrInet6 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_dragonfly.go b/vendor/github.com/anacrolix/mmsg/socket/sys_dragonfly.go deleted file mode 100644 index b17d223bff..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_dragonfly.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -func probeProtocolStack() int { return 4 } diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_linux.go b/vendor/github.com/anacrolix/mmsg/socket/sys_linux.go index 1559521e03..08d4910778 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_linux.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_linux.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux,!s390x,!386 +//go:build linux && !s390x && !386 package socket @@ -11,11 +11,6 @@ import ( "unsafe" ) -func probeProtocolStack() int { - var p uintptr - return int(unsafe.Sizeof(p)) -} - func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { n, _, errno := syscall.Syscall6(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) return int(n), errnoErr(errno) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_linux_386.go b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_386.go index 235b2cc08a..c877ef23ae 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_linux_386.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_386.go @@ -9,41 +9,14 @@ import ( "unsafe" ) -func probeProtocolStack() int { return 4 } - const ( - sysSETSOCKOPT = 0xe - sysGETSOCKOPT = 0xf - sysSENDMSG = 0x10 - sysRECVMSG = 0x11 - sysRECVMMSG = 0x13 - sysSENDMMSG = 0x14 + sysRECVMMSG = 0x13 + sysSENDMMSG = 0x14 ) func socketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) func rawsocketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) -func getsockopt(s uintptr, level, name int, b []byte) (int, error) { - l := uint32(len(b)) - _, errno := socketcall(sysGETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) - return int(l), errnoErr(errno) -} - -func setsockopt(s uintptr, level, name int, b []byte) error { - _, errno := socketcall(sysSETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) - return errnoErr(errno) -} - -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, errno := socketcall(sysRECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags), 0, 0, 0) - return int(n), errnoErr(errno) -} - -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, errno := socketcall(sysSENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags), 0, 0, 0) - return int(n), errnoErr(errno) -} - func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { n, errno := socketcall(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) return int(n), errnoErr(errno) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_linux_loong64.go b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_loong64.go new file mode 100644 index 0000000000..1d182470d0 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_loong64.go @@ -0,0 +1,12 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build loong64 + +package socket + +const ( + sysRECVMMSG = 0xf3 + sysSENDMMSG = 0x10d +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_darwin.go b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_ppc.go similarity index 53% rename from vendor/github.com/anacrolix/mmsg/socket/sys_darwin.go rename to vendor/github.com/anacrolix/mmsg/socket/sys_linux_ppc.go index b17d223bff..90cfaa9fec 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_darwin.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_ppc.go @@ -1,7 +1,10 @@ -// Copyright 2017 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package socket -func probeProtocolStack() int { return 4 } +const ( + sysRECVMMSG = 0x157 + sysSENDMMSG = 0x15d +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_linux_riscv64.go b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_riscv64.go new file mode 100644 index 0000000000..0e407d1257 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_riscv64.go @@ -0,0 +1,12 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build riscv64 + +package socket + +const ( + sysRECVMMSG = 0xf3 + sysSENDMMSG = 0x10d +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_linux_s390x.go b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_s390x.go index 327979efbb..c877ef23ae 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_linux_s390x.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_linux_s390x.go @@ -9,41 +9,14 @@ import ( "unsafe" ) -func probeProtocolStack() int { return 8 } - const ( - sysSETSOCKOPT = 0xe - sysGETSOCKOPT = 0xf - sysSENDMSG = 0x10 - sysRECVMSG = 0x11 - sysRECVMMSG = 0x13 - sysSENDMMSG = 0x14 + sysRECVMMSG = 0x13 + sysSENDMMSG = 0x14 ) func socketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) func rawsocketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) -func getsockopt(s uintptr, level, name int, b []byte) (int, error) { - l := uint32(len(b)) - _, errno := socketcall(sysGETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) - return int(l), errnoErr(errno) -} - -func setsockopt(s uintptr, level, name int, b []byte) error { - _, errno := socketcall(sysSETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) - return errnoErr(errno) -} - -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, errno := socketcall(sysRECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags), 0, 0, 0) - return int(n), errnoErr(errno) -} - -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, errno := socketcall(sysSENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags), 0, 0, 0) - return int(n), errnoErr(errno) -} - func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { n, errno := socketcall(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) return int(n), errnoErr(errno) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_posix.go b/vendor/github.com/anacrolix/mmsg/socket/sys_posix.go index dc130c27eb..58d8654824 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_posix.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_posix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build go1.9 -// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos package socket @@ -17,37 +16,38 @@ import ( "time" ) -func marshalInetAddr(a net.Addr) []byte { +// marshalInetAddr writes a in sockaddr format into the buffer b. +// The buffer must be sufficiently large (sizeofSockaddrInet4/6). +// Returns the number of bytes written. +func marshalInetAddr(a net.Addr, b []byte) int { switch a := a.(type) { case *net.TCPAddr: - return marshalSockaddr(a.IP, a.Port, a.Zone) + return marshalSockaddr(a.IP, a.Port, a.Zone, b) case *net.UDPAddr: - return marshalSockaddr(a.IP, a.Port, a.Zone) + return marshalSockaddr(a.IP, a.Port, a.Zone, b) case *net.IPAddr: - return marshalSockaddr(a.IP, 0, a.Zone) + return marshalSockaddr(a.IP, 0, a.Zone, b) default: - return nil + return 0 } } -func marshalSockaddr(ip net.IP, port int, zone string) []byte { +func marshalSockaddr(ip net.IP, port int, zone string, b []byte) int { if ip4 := ip.To4(); ip4 != nil { - b := make([]byte, sizeofSockaddrInet) switch runtime.GOOS { - case "android", "linux", "solaris", "windows": + case "android", "illumos", "linux", "solaris", "windows": NativeEndian.PutUint16(b[:2], uint16(sysAF_INET)) default: - b[0] = sizeofSockaddrInet + b[0] = sizeofSockaddrInet4 b[1] = sysAF_INET } binary.BigEndian.PutUint16(b[2:4], uint16(port)) copy(b[4:8], ip4) - return b + return sizeofSockaddrInet4 } if ip6 := ip.To16(); ip6 != nil && ip.To4() == nil { - b := make([]byte, sizeofSockaddrInet6) switch runtime.GOOS { - case "android", "linux", "solaris", "windows": + case "android", "illumos", "linux", "solaris", "windows": NativeEndian.PutUint16(b[:2], uint16(sysAF_INET6)) default: b[0] = sizeofSockaddrInet6 @@ -58,9 +58,9 @@ func marshalSockaddr(ip net.IP, port int, zone string) []byte { if zone != "" { NativeEndian.PutUint32(b[24:28], uint32(zoneCache.index(zone))) } - return b + return sizeofSockaddrInet6 } - return nil + return 0 } func parseInetAddr(b []byte, network string) (net.Addr, error) { @@ -69,7 +69,7 @@ func parseInetAddr(b []byte, network string) (net.Addr, error) { } var af int switch runtime.GOOS { - case "android", "linux", "solaris", "windows": + case "android", "illumos", "linux", "solaris", "windows": af = int(NativeEndian.Uint16(b[:2])) default: af = int(b[1]) @@ -77,7 +77,7 @@ func parseInetAddr(b []byte, network string) (net.Addr, error) { var ip net.IP var zone string if af == sysAF_INET { - if len(b) < sizeofSockaddrInet { + if len(b) < sizeofSockaddrInet4 { return nil, errors.New("short address") } ip = make(net.IP, net.IPv4len) @@ -121,18 +121,21 @@ var zoneCache = ipv6ZoneCache{ toName: make(map[int]string), } -func (zc *ipv6ZoneCache) update(ift []net.Interface) { +// update refreshes the network interface information if the cache was last +// updated more than 1 minute ago, or if force is set. It returns whether the +// cache was updated. +func (zc *ipv6ZoneCache) update(ift []net.Interface, force bool) (updated bool) { zc.Lock() defer zc.Unlock() now := time.Now() - if zc.lastFetched.After(now.Add(-60 * time.Second)) { - return + if !force && zc.lastFetched.After(now.Add(-60*time.Second)) { + return false } zc.lastFetched = now if len(ift) == 0 { var err error if ift, err = net.Interfaces(); err != nil { - return + return false } } zc.toIndex = make(map[string]int, len(ift)) @@ -143,25 +146,38 @@ func (zc *ipv6ZoneCache) update(ift []net.Interface) { zc.toName[ifi.Index] = ifi.Name } } + return true } func (zc *ipv6ZoneCache) name(zone int) string { - zoneCache.update(nil) + updated := zoneCache.update(nil, false) zoneCache.RLock() - defer zoneCache.RUnlock() name, ok := zoneCache.toName[zone] - if !ok { + zoneCache.RUnlock() + if !ok && !updated { + zoneCache.update(nil, true) + zoneCache.RLock() + name, ok = zoneCache.toName[zone] + zoneCache.RUnlock() + } + if !ok { // last resort name = strconv.Itoa(zone) } return name } func (zc *ipv6ZoneCache) index(zone string) int { - zoneCache.update(nil) + updated := zoneCache.update(nil, false) zoneCache.RLock() - defer zoneCache.RUnlock() index, ok := zoneCache.toIndex[zone] - if !ok { + zoneCache.RUnlock() + if !ok && !updated { + zoneCache.update(nil, true) + zoneCache.RLock() + index, ok = zoneCache.toIndex[zone] + zoneCache.RUnlock() + } + if !ok { // last resort index, _ = strconv.Atoi(zone) } return index diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_solaris.go b/vendor/github.com/anacrolix/mmsg/socket/sys_solaris.go deleted file mode 100644 index cced74e60d..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_solaris.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -import ( - "errors" - "runtime" - "syscall" - "unsafe" -) - -func probeProtocolStack() int { - switch runtime.GOARCH { - case "amd64": - return 4 - default: - var p uintptr - return int(unsafe.Sizeof(p)) - } -} - -//go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so" -//go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so" -//go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so" -//go:cgo_import_dynamic libc___xnet_sendmsg __xnet_sendmsg "libsocket.so" - -//go:linkname procGetsockopt libc___xnet_getsockopt -//go:linkname procSetsockopt libc_setsockopt -//go:linkname procRecvmsg libc___xnet_recvmsg -//go:linkname procSendmsg libc___xnet_sendmsg - -var ( - procGetsockopt uintptr - procSetsockopt uintptr - procRecvmsg uintptr - procSendmsg uintptr -) - -func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno) -func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno) - -func getsockopt(s uintptr, level, name int, b []byte) (int, error) { - l := uint32(len(b)) - _, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procGetsockopt)), 5, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) - return int(l), errnoErr(errno) -} - -func setsockopt(s uintptr, level, name int, b []byte) error { - _, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procSetsockopt)), 5, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) - return errnoErr(errno) -} - -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procRecvmsg)), 3, s, uintptr(unsafe.Pointer(h)), uintptr(flags), 0, 0, 0) - return int(n), errnoErr(errno) -} - -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procSendmsg)), 3, s, uintptr(unsafe.Pointer(h)), uintptr(flags), 0, 0, 0) - return int(n), errnoErr(errno) -} - -func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") -} - -func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") -} diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_solaris_amd64.s b/vendor/github.com/anacrolix/mmsg/socket/sys_solaris_amd64.s deleted file mode 100644 index a18ac5ed75..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_solaris_amd64.s +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -TEXT ·sysvicall6(SB),NOSPLIT,$0-88 - JMP syscall·sysvicall6(SB) - -TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 - JMP syscall·rawSysvicall6(SB) diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_stub.go b/vendor/github.com/anacrolix/mmsg/socket/sys_stub.go index d9f06d00e9..2e5b473c66 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_stub.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_stub.go @@ -2,16 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos package socket -import ( - "errors" - "net" - "runtime" - "unsafe" -) +import "net" const ( sysAF_UNSPEC = 0x0 @@ -19,46 +14,39 @@ const ( sysAF_INET6 = 0xa sysSOCK_RAW = 0x3 -) -func probeProtocolStack() int { - switch runtime.GOARCH { - case "amd64p32", "mips64p32": - return 4 - default: - var p uintptr - return int(unsafe.Sizeof(p)) - } -} + sizeofSockaddrInet4 = 0x10 + sizeofSockaddrInet6 = 0x1c +) func marshalInetAddr(ip net.IP, port int, zone string) []byte { return nil } func parseInetAddr(b []byte, network string) (net.Addr, error) { - return nil, errors.New("not implemented") + return nil, errNotImplemented } func getsockopt(s uintptr, level, name int, b []byte) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } func setsockopt(s uintptr, level, name int, b []byte) error { - return errors.New("not implemented") + return errNotImplemented } -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - return 0, errors.New("not implemented") +func recvmsg(s uintptr, buffers [][]byte, oob []byte, flags int, network string) (n, oobn int, recvflags int, from net.Addr, err error) { + return 0, 0, 0, nil, errNotImplemented } -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - return 0, errors.New("not implemented") +func sendmsg(s uintptr, buffers [][]byte, oob []byte, to net.Addr, flags int) (int, error) { + return 0, errNotImplemented } func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_unix.go b/vendor/github.com/anacrolix/mmsg/socket/sys_unix.go index 18eba30853..93058db5b9 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_unix.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_unix.go @@ -2,32 +2,120 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux,!s390x,!386 netbsd openbsd +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris package socket import ( - "syscall" + "net" "unsafe" + + "golang.org/x/sys/unix" ) +//go:linkname syscall_getsockopt syscall.getsockopt +func syscall_getsockopt(s, level, name int, val unsafe.Pointer, vallen *uint32) error + +//go:linkname syscall_setsockopt syscall.setsockopt +func syscall_setsockopt(s, level, name int, val unsafe.Pointer, vallen uintptr) error + func getsockopt(s uintptr, level, name int, b []byte) (int, error) { l := uint32(len(b)) - _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) - return int(l), errnoErr(errno) + err := syscall_getsockopt(int(s), level, name, unsafe.Pointer(&b[0]), &l) + return int(l), err } func setsockopt(s uintptr, level, name int, b []byte) error { - _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) - return errnoErr(errno) + return syscall_setsockopt(int(s), level, name, unsafe.Pointer(&b[0]), uintptr(len(b))) } -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := syscall.Syscall(syscall.SYS_RECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) - return int(n), errnoErr(errno) +func recvmsg(s uintptr, buffers [][]byte, oob []byte, flags int, network string) (n, oobn int, recvflags int, from net.Addr, err error) { + var unixFrom unix.Sockaddr + n, oobn, recvflags, unixFrom, err = unix.RecvmsgBuffers(int(s), buffers, oob, flags) + if unixFrom != nil { + from = sockaddrToAddr(unixFrom, network) + } + return } -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := syscall.Syscall(syscall.SYS_SENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) - return int(n), errnoErr(errno) +func sendmsg(s uintptr, buffers [][]byte, oob []byte, to net.Addr, flags int) (int, error) { + var unixTo unix.Sockaddr + if to != nil { + unixTo = addrToSockaddr(to) + } + return unix.SendmsgBuffers(int(s), buffers, oob, unixTo, flags) +} + +// addrToSockaddr converts a net.Addr to a unix.Sockaddr. +func addrToSockaddr(a net.Addr) unix.Sockaddr { + var ( + ip net.IP + port int + zone string + ) + switch a := a.(type) { + case *net.TCPAddr: + ip = a.IP + port = a.Port + zone = a.Zone + case *net.UDPAddr: + ip = a.IP + port = a.Port + zone = a.Zone + case *net.IPAddr: + ip = a.IP + zone = a.Zone + default: + return nil + } + + if ip4 := ip.To4(); ip4 != nil { + sa := unix.SockaddrInet4{Port: port} + copy(sa.Addr[:], ip4) + return &sa + } + + if ip6 := ip.To16(); ip6 != nil && ip.To4() == nil { + sa := unix.SockaddrInet6{Port: port} + copy(sa.Addr[:], ip6) + if zone != "" { + sa.ZoneId = uint32(zoneCache.index(zone)) + } + return &sa + } + + return nil +} + +// sockaddrToAddr converts a unix.Sockaddr to a net.Addr. +func sockaddrToAddr(sa unix.Sockaddr, network string) net.Addr { + var ( + ip net.IP + port int + zone string + ) + switch sa := sa.(type) { + case *unix.SockaddrInet4: + ip = make(net.IP, net.IPv4len) + copy(ip, sa.Addr[:]) + port = sa.Port + case *unix.SockaddrInet6: + ip = make(net.IP, net.IPv6len) + copy(ip, sa.Addr[:]) + port = sa.Port + if sa.ZoneId > 0 { + zone = zoneCache.name(int(sa.ZoneId)) + } + default: + return nil + } + + switch network { + case "tcp", "tcp4", "tcp6": + return &net.TCPAddr{IP: ip, Port: port, Zone: zone} + case "udp", "udp4", "udp6": + return &net.UDPAddr{IP: ip, Port: port, Zone: zone} + default: + return &net.IPAddr{IP: ip, Zone: zone} + } } diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_windows.go b/vendor/github.com/anacrolix/mmsg/socket/sys_windows.go index 54a470ebe3..b738b89ddd 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/sys_windows.go +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_windows.go @@ -5,9 +5,11 @@ package socket import ( - "errors" + "net" "syscall" "unsafe" + + "golang.org/x/sys/windows" ) func probeProtocolStack() int { @@ -16,30 +18,13 @@ func probeProtocolStack() int { } const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x17 - - sysSOCK_RAW = 0x3 -) + sysAF_UNSPEC = windows.AF_UNSPEC + sysAF_INET = windows.AF_INET + sysAF_INET6 = windows.AF_INET6 -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]uint8 -} + sysSOCK_RAW = windows.SOCK_RAW -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -const ( - sizeofSockaddrInet = 0x10 + sizeofSockaddrInet4 = 0x10 sizeofSockaddrInet6 = 0x1c ) @@ -53,18 +38,18 @@ func setsockopt(s uintptr, level, name int, b []byte) error { return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), int32(len(b))) } -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - return 0, errors.New("not implemented") +func recvmsg(s uintptr, buffers [][]byte, oob []byte, flags int, network string) (n, oobn int, recvflags int, from net.Addr, err error) { + return 0, 0, 0, nil, errNotImplemented } -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - return 0, errors.New("not implemented") +func sendmsg(s uintptr, buffers [][]byte, oob []byte, to net.Addr, flags int) (int, error) { + return 0, errNotImplemented } func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { - return 0, errors.New("not implemented") + return 0, errNotImplemented } diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_zos_s390x.go b/vendor/github.com/anacrolix/mmsg/socket/sys_zos_s390x.go new file mode 100644 index 0000000000..eaa896cb57 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_zos_s390x.go @@ -0,0 +1,66 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package socket + +import ( + "net" + "syscall" + "unsafe" +) + +func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) +func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func probeProtocolStack() int { + return 4 // sizeof(int) on GOOS=zos GOARCH=s390x +} + +func getsockopt(s uintptr, level, name int, b []byte) (int, error) { + l := uint32(len(b)) + _, _, errno := syscall_syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) + return int(l), errnoErr(errno) +} + +func setsockopt(s uintptr, level, name int, b []byte) error { + _, _, errno := syscall_syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) + return errnoErr(errno) +} + +func recvmsg(s uintptr, buffers [][]byte, oob []byte, flags int, network string) (n, oobn int, recvflags int, from net.Addr, err error) { + var h msghdr + vs := make([]iovec, len(buffers)) + var sa []byte + if network != "tcp" { + sa = make([]byte, sizeofSockaddrInet6) + } + h.pack(vs, buffers, oob, sa) + sn, _, errno := syscall_syscall(syscall.SYS___RECVMSG_A, s, uintptr(unsafe.Pointer(&h)), uintptr(flags)) + n = int(sn) + oobn = h.controllen() + recvflags = h.flags() + err = errnoErr(errno) + if network != "tcp" { + var err2 error + from, err2 = parseInetAddr(sa, network) + if err2 != nil && err == nil { + err = err2 + } + } + return +} + +func sendmsg(s uintptr, buffers [][]byte, oob []byte, to net.Addr, flags int) (int, error) { + var h msghdr + vs := make([]iovec, len(buffers)) + var sa []byte + if to != nil { + var a [sizeofSockaddrInet6]byte + n := marshalInetAddr(to, a[:]) + sa = a[:n] + } + h.pack(vs, buffers, oob, sa) + n, _, errno := syscall_syscall(syscall.SYS___SENDMSG_A, s, uintptr(unsafe.Pointer(&h)), uintptr(flags)) + return int(n), errnoErr(errno) +} diff --git a/vendor/github.com/anacrolix/mmsg/socket/sys_zos_s390x.s b/vendor/github.com/anacrolix/mmsg/socket/sys_zos_s390x.s new file mode 100644 index 0000000000..60d5839c25 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/sys_zos_s390x.s @@ -0,0 +1,11 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +TEXT ·syscall_syscall(SB),NOSPLIT,$0 + JMP syscall·_syscall(SB) + +TEXT ·syscall_syscall6(SB),NOSPLIT,$0 + JMP syscall·_syscall6(SB) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_aix_ppc64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_aix_ppc64.go new file mode 100644 index 0000000000..45bab004c1 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_aix_ppc64.go @@ -0,0 +1,39 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_aix.go + +// Added for go1.11 compatibility +//go:build aix + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen int32 + Control *byte + Controllen uint32 + Flags int32 +} + +type mmsghdr struct { + Hdr msghdr + Len uint32 + Pad_cgo_0 [4]byte +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_386.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_386.go deleted file mode 100644 index 26f8feff3a..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_386.go +++ /dev/null @@ -1,59 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_darwin.go - -package socket - -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1e - - sysSOCK_RAW = 0x3 -) - -type iovec struct { - Base *byte - Len uint32 -} - -type msghdr struct { - Name *byte - Namelen uint32 - Iov *iovec - Iovlen int32 - Control *byte - Controllen uint32 - Flags int32 -} - -type cmsghdr struct { - Len uint32 - Level int32 - Type int32 -} - -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c -) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_amd64.go index e2987f7db8..98dcfe412a 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_darwin.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1e - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -34,28 +26,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm.go deleted file mode 100644 index 26f8feff3a..0000000000 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm.go +++ /dev/null @@ -1,59 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_darwin.go - -package socket - -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1e - - sysSOCK_RAW = 0x3 -) - -type iovec struct { - Base *byte - Len uint32 -} - -type msghdr struct { - Name *byte - Namelen uint32 - Iov *iovec - Iovlen int32 - Control *byte - Controllen uint32 - Flags int32 -} - -type cmsghdr struct { - Len uint32 - Level int32 - Type int32 -} - -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c -) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm64.go index e2987f7db8..98dcfe412a 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_darwin_arm64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_darwin.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1e - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -34,28 +26,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_dragonfly_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_dragonfly_amd64.go index c582abd57d..636d129aee 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_dragonfly_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_dragonfly_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_dragonfly.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1c - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -34,28 +26,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_386.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_386.go index 04a24886c7..87707fed01 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_386.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_386.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_freebsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1c - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -32,28 +24,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_amd64.go index 35c7cb9c95..7db7781129 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_freebsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1c - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -34,28 +26,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm.go index 04a24886c7..87707fed01 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_freebsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1c - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -32,28 +24,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm64.go new file mode 100644 index 0000000000..7db7781129 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_arm64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_freebsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Pad_cgo_0 [4]byte + Iov *iovec + Iovlen int32 + Pad_cgo_1 [4]byte + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_riscv64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_riscv64.go new file mode 100644 index 0000000000..965c0b28b5 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_freebsd_riscv64.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_freebsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen int32 + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_386.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_386.go index 430206930b..4c19269bee 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_386.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_386.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -37,27 +29,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofMmsghdr = 0x20 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_amd64.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm.go index 430206930b..4c19269bee 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -37,27 +29,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofMmsghdr = 0x20 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm64.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_arm64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_loong64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_loong64.go new file mode 100644 index 0000000000..b6fc15a1a2 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_loong64.go @@ -0,0 +1,39 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +//go:build loong64 + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint64 + Control *byte + Controllen uint64 + Flags int32 + Pad_cgo_0 [4]byte +} + +type mmsghdr struct { + Hdr msghdr + Len uint32 + Pad_cgo_0 [4]byte +} + +type cmsghdr struct { + Len uint64 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips.go index 430206930b..4c19269bee 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -37,27 +29,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofMmsghdr = 0x20 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64le.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64le.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64le.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mips64le.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mipsle.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mipsle.go index 430206930b..4c19269bee 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mipsle.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_mipsle.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -37,27 +29,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofMmsghdr = 0x20 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc.go new file mode 100644 index 0000000000..4c19269bee --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { + Base *byte + Len uint32 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint32 + Control *byte + Controllen uint32 + Flags int32 +} + +type mmsghdr struct { + Hdr msghdr + Len uint32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64le.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64le.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64le.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_ppc64le.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_riscv64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_riscv64.go new file mode 100644 index 0000000000..e67fc3cbaa --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_riscv64.go @@ -0,0 +1,39 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +//go:build riscv64 + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint64 + Control *byte + Controllen uint64 + Flags int32 + Pad_cgo_0 [4]byte +} + +type mmsghdr struct { + Hdr msghdr + Len uint32 + Pad_cgo_0 [4]byte +} + +type cmsghdr struct { + Len uint64 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_s390x.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_s390x.go index 1502f6c552..3dcd5c8eda 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_s390x.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_linux_s390x.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0xa - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,27 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - X__pad [8]uint8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0x10 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_386.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_386.go index db60491fe3..f95572dc00 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_386.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_386.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_netbsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x18 - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -37,29 +29,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofMmsghdr = 0x20 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_amd64.go index 2a1a79985a..a92fd60e4d 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_netbsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x18 - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -40,29 +32,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofMmsghdr = 0x40 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm.go index db60491fe3..f95572dc00 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_netbsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x18 - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -37,29 +29,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofMmsghdr = 0x20 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm64.go new file mode 100644 index 0000000000..a92fd60e4d --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_netbsd_arm64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_netbsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Pad_cgo_0 [4]byte + Iov *iovec + Iovlen int32 + Pad_cgo_1 [4]byte + Control *byte + Controllen uint32 + Flags int32 +} + +type mmsghdr struct { + Hdr msghdr + Len uint32 + Pad_cgo_0 [4]byte +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_386.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_386.go index 1c836361e8..e792ec2115 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_386.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_386.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_openbsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x18 - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -32,28 +24,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_amd64.go index a6c0bf464a..b68ff2d57f 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_openbsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x18 - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint64 @@ -34,28 +26,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm.go index 1c836361e8..e792ec2115 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_openbsd.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x18 - - sysSOCK_RAW = 0x3 -) - type iovec struct { Base *byte Len uint32 @@ -32,28 +24,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm64.go new file mode 100644 index 0000000000..b68ff2d57f --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_arm64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Pad_cgo_0 [4]byte + Iov *iovec + Iovlen uint32 + Pad_cgo_1 [4]byte + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_mips64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_mips64.go new file mode 100644 index 0000000000..3c9576e2d8 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_mips64.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint32 + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_ppc64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_ppc64.go new file mode 100644 index 0000000000..cebde7634f --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_ppc64.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint32 + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_riscv64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_riscv64.go new file mode 100644 index 0000000000..cebde7634f --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_openbsd_riscv64.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint32 + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 +) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_solaris_amd64.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_solaris_amd64.go index 327c63290c..359cfec40a 100644 --- a/vendor/github.com/anacrolix/mmsg/socket/zsys_solaris_amd64.go +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_solaris_amd64.go @@ -1,16 +1,8 @@ -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_solaris.go package socket -const ( - sysAF_UNSPEC = 0x0 - sysAF_INET = 0x2 - sysAF_INET6 = 0x1a - - sysSOCK_RAW = 0x4 -) - type iovec struct { Base *int8 Len uint64 @@ -34,27 +26,7 @@ type cmsghdr struct { Type int32 } -type sockaddrInet struct { - Family uint16 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 - X__sin6_src_id uint32 -} - const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x20 + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 ) diff --git a/vendor/github.com/anacrolix/mmsg/socket/zsys_zos_s390x.go b/vendor/github.com/anacrolix/mmsg/socket/zsys_zos_s390x.go new file mode 100644 index 0000000000..49b62c8561 --- /dev/null +++ b/vendor/github.com/anacrolix/mmsg/socket/zsys_zos_s390x.go @@ -0,0 +1,28 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Iov *iovec + Control *byte + Flags int32 + Namelen uint32 + Iovlen int32 + Controllen uint32 +} + +type cmsghdr struct { + Len int32 + Level int32 + Type int32 +} + +const sizeofCmsghdr = 12 diff --git a/vendor/github.com/anacrolix/sync/lockstats.go b/vendor/github.com/anacrolix/sync/lockstats.go index c58f49c7e1..48b369f629 100644 --- a/vendor/github.com/anacrolix/sync/lockstats.go +++ b/vendor/github.com/anacrolix/sync/lockstats.go @@ -4,7 +4,7 @@ import ( "sort" "sync" - "github.com/anacrolix/missinggo/perf" + "github.com/anacrolix/missinggo/v2/perf" ) var ( @@ -16,7 +16,6 @@ var ( type ( lockStats = perf.Event lockStackKey = [32]uintptr - lockCount = int64 ) type stackLockStats struct { diff --git a/vendor/github.com/anacrolix/sync/sync.go b/vendor/github.com/anacrolix/sync/sync.go index e6ef7edc04..cb1408177f 100644 --- a/vendor/github.com/anacrolix/sync/sync.go +++ b/vendor/github.com/anacrolix/sync/sync.go @@ -25,7 +25,7 @@ import ( "sync" "text/tabwriter" - "github.com/anacrolix/missinggo" + "github.com/anacrolix/missinggo/v2" ) var ( diff --git a/vendor/github.com/anacrolix/torrent/client.go b/vendor/github.com/anacrolix/torrent/client.go index 31a6d88c99..47b43042db 100644 --- a/vendor/github.com/anacrolix/torrent/client.go +++ b/vendor/github.com/anacrolix/torrent/client.go @@ -25,9 +25,9 @@ import ( . "github.com/anacrolix/generics" g "github.com/anacrolix/generics" "github.com/anacrolix/log" - "github.com/anacrolix/missinggo/perf" "github.com/anacrolix/missinggo/v2" "github.com/anacrolix/missinggo/v2/bitmap" + "github.com/anacrolix/missinggo/v2/perf" "github.com/anacrolix/missinggo/v2/pproffd" "github.com/anacrolix/sync" "github.com/cespare/xxhash" diff --git a/vendor/github.com/anacrolix/torrent/mse/mse.go b/vendor/github.com/anacrolix/torrent/mse/mse.go index f1bd63b8a3..6bbc6e0c8d 100644 --- a/vendor/github.com/anacrolix/torrent/mse/mse.go +++ b/vendor/github.com/anacrolix/torrent/mse/mse.go @@ -12,14 +12,15 @@ import ( "errors" "expvar" "fmt" - "github.com/anacrolix/torrent/internal/ctxrw" "io" "math" "math/big" "strconv" "sync" - "github.com/anacrolix/missinggo/perf" + "github.com/anacrolix/torrent/internal/ctxrw" + + "github.com/anacrolix/missinggo/v2/perf" ) const ( diff --git a/vendor/github.com/anacrolix/torrent/socket.go b/vendor/github.com/anacrolix/torrent/socket.go index 18c8b86034..e34ff90636 100644 --- a/vendor/github.com/anacrolix/torrent/socket.go +++ b/vendor/github.com/anacrolix/torrent/socket.go @@ -11,8 +11,8 @@ import ( g "github.com/anacrolix/generics" "github.com/anacrolix/log" - "github.com/anacrolix/missinggo/perf" "github.com/anacrolix/missinggo/v2" + "github.com/anacrolix/missinggo/v2/perf" ) type Listener interface { 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 8325c8a0be..ec2c4c5f55 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,11 @@ +# v1.27.35 (2024-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.34 (2024-09-16) + +* **Bug Fix**: Read `AWS_CONTAINER_CREDENTIALS_FULL_URI` env variable if set when reading a profile with `credential_source`. Also ensure `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is always read before it + # v1.27.33 (2024-09-04) * **Dependency Update**: Updated to the latest SDK module versions 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 411bda659d..3bf12e2a8a 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.27.33" +const goModuleVersion = "1.27.35" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go index 89368520f3..7ae252e2e8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go @@ -162,12 +162,12 @@ func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *En // Get credentials from CredentialProcess err = processCredentials(ctx, cfg, sharedConfig, configs) - case len(envConfig.ContainerCredentialsEndpoint) != 0: - err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) - case len(envConfig.ContainerCredentialsRelativePath) != 0: err = resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) + case len(envConfig.ContainerCredentialsEndpoint) != 0: + err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) + default: err = resolveEC2RoleCredentials(ctx, cfg, configs) } @@ -355,10 +355,13 @@ func resolveCredsFromSource(ctx context.Context, cfg *aws.Config, envConfig *Env cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials} case credSourceECSContainer: - if len(envConfig.ContainerCredentialsRelativePath) == 0 { - return fmt.Errorf("EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set") + if len(envConfig.ContainerCredentialsRelativePath) != 0 { + return resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) + } + if len(envConfig.ContainerCredentialsEndpoint) != 0 { + return resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) } - return resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) + return fmt.Errorf("EcsContainer was specified as the credential_source, but neither 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' or AWS_CONTAINER_CREDENTIALS_FULL_URI' was set") default: return fmt.Errorf("credential_source values must be EcsContainer, Ec2InstanceMetadata, or Environment") 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 dfb3dc94b7..7b8fd32bf9 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,7 @@ +# v1.17.33 (2024-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.17.32 (2024-09-04) * **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 e7467a7d98..faf7b0dae7 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.17.32" +const goModuleVersion = "1.17.33" 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 e025651150..126fac0c84 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,7 @@ +# v1.43.3 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + # v1.43.2 (2024-09-04) * No change notes available for this release. 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 39b937fabe..5007df1a89 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 @@ -239,16 +239,15 @@ func setResolvedDefaultsMode(o *Options) { // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AccountIDEndpointMode: cfg.AccountIDEndpointMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -542,25 +541,6 @@ func initializeTimeOffsetResolver(c *Client) { c.timeOffset = new(atomic.Int64) } -func checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error { - switch mode { - case aws.AccountIDEndpointModeUnset: - case aws.AccountIDEndpointModePreferred: - case aws.AccountIDEndpointModeDisabled: - case aws.AccountIDEndpointModeRequired: - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok { - return fmt.Errorf("accountID is required but not set") - } else if ca.Credentials.AccountID == "" { - return fmt.Errorf("accountID is required but not set") - } - // default check in case invalid mode is configured through request config - default: - return fmt.Errorf("invalid accountID endpoint mode %s, must be preferred/required/disabled", mode) - } - - return nil -} - func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { ua, err := getOrAddRequestUserAgent(stack) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/endpoints.go index 1777d15bb9..acfa535d04 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/route53/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/route53/endpoints.go @@ -794,10 +794,6 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return next.HandleFinalize(ctx, in) } - if err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil { - return out, metadata, fmt.Errorf("invalid accountID set: %w", err) - } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) 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 f4811f61dc..1108b71c41 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.43.2" +const goModuleVersion = "1.43.3" 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 7859e293f5..23abeee139 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 @@ -24,9 +24,6 @@ type Options struct { // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error - // Indicates how aws account ID is applied in endpoint2.0 routing - AccountIDEndpointMode aws.AccountIDEndpointMode - // The optional application specific identifier appended to the User-Agent header. AppID string 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 a72bd91dfb..06a0a759f0 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,7 @@ +# v1.22.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + # v1.22.7 (2024-09-04) * No change notes available for this release. 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 a06c6e738f..68a759dfd4 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 @@ -237,16 +237,15 @@ func setResolvedDefaultsMode(o *Options) { // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AccountIDEndpointMode: cfg.AccountIDEndpointMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -540,25 +539,6 @@ func initializeTimeOffsetResolver(c *Client) { c.timeOffset = new(atomic.Int64) } -func checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error { - switch mode { - case aws.AccountIDEndpointModeUnset: - case aws.AccountIDEndpointModePreferred: - case aws.AccountIDEndpointModeDisabled: - case aws.AccountIDEndpointModeRequired: - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok { - return fmt.Errorf("accountID is required but not set") - } else if ca.Credentials.AccountID == "" { - return fmt.Errorf("accountID is required but not set") - } - // default check in case invalid mode is configured through request config - default: - return fmt.Errorf("invalid accountID endpoint mode %s, must be preferred/required/disabled", mode) - } - - return nil -} - func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { ua, err := getOrAddRequestUserAgent(stack) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go index 75ae283ef8..af95e21a9b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go @@ -506,10 +506,6 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return next.HandleFinalize(ctx, in) } - if err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil { - return out, metadata, fmt.Errorf("invalid accountID set: %w", err) - } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) 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 012580e77f..743d204555 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.22.7" +const goModuleVersion = "1.22.8" 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 0ba182e976..3561c44308 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 @@ -24,9 +24,6 @@ type Options struct { // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error - // Indicates how aws account ID is applied in endpoint2.0 routing - AccountIDEndpointMode aws.AccountIDEndpointMode - // The optional application specific identifier appended to the User-Agent header. AppID string 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 6924f05836..00c0650003 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,7 @@ +# v1.26.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + # v1.26.7 (2024-09-04) * No change notes available for this release. 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 25cd1c0488..8b6579d8cb 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 @@ -237,16 +237,15 @@ func setResolvedDefaultsMode(o *Options) { // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AccountIDEndpointMode: cfg.AccountIDEndpointMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -540,25 +539,6 @@ func initializeTimeOffsetResolver(c *Client) { c.timeOffset = new(atomic.Int64) } -func checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error { - switch mode { - case aws.AccountIDEndpointModeUnset: - case aws.AccountIDEndpointModePreferred: - case aws.AccountIDEndpointModeDisabled: - case aws.AccountIDEndpointModeRequired: - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok { - return fmt.Errorf("accountID is required but not set") - } else if ca.Credentials.AccountID == "" { - return fmt.Errorf("accountID is required but not set") - } - // default check in case invalid mode is configured through request config - default: - return fmt.Errorf("invalid accountID endpoint mode %s, must be preferred/required/disabled", mode) - } - - return nil -} - func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { ua, err := getOrAddRequestUserAgent(stack) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go index d7099721fe..7a48f0535a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go @@ -506,10 +506,6 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return next.HandleFinalize(ctx, in) } - if err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil { - return out, metadata, fmt.Errorf("invalid accountID set: %w", err) - } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) 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 880f8bbeff..d675038c7c 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.26.7" +const goModuleVersion = "1.26.8" 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 a012e4cb8d..69ded47c74 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 @@ -24,9 +24,6 @@ type Options struct { // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error - // Indicates how aws account ID is applied in endpoint2.0 routing - AccountIDEndpointMode aws.AccountIDEndpointMode - // The optional application specific identifier appended to the User-Agent header. AppID string 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 9bcf2568ed..d97f6c74f5 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,7 @@ +# v1.30.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + # v1.30.7 (2024-09-04) * No change notes available for this release. 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 acd2b8e7a1..2994eac824 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 @@ -241,16 +241,15 @@ func setResolvedDefaultsMode(o *Options) { // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AccountIDEndpointMode: cfg.AccountIDEndpointMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) @@ -544,25 +543,6 @@ func initializeTimeOffsetResolver(c *Client) { c.timeOffset = new(atomic.Int64) } -func checkAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) error { - switch mode { - case aws.AccountIDEndpointModeUnset: - case aws.AccountIDEndpointModePreferred: - case aws.AccountIDEndpointModeDisabled: - case aws.AccountIDEndpointModeRequired: - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); !ok { - return fmt.Errorf("accountID is required but not set") - } else if ca.Credentials.AccountID == "" { - return fmt.Errorf("accountID is required but not set") - } - // default check in case invalid mode is configured through request config - default: - return fmt.Errorf("invalid accountID endpoint mode %s, must be preferred/required/disabled", mode) - } - - return nil -} - func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { ua, err := getOrAddRequestUserAgent(stack) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go index 35305d8976..3a5c71a726 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go @@ -1086,10 +1086,6 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return next.HandleFinalize(ctx, in) } - if err := checkAccountID(getIdentity(ctx), m.options.AccountIDEndpointMode); err != nil { - return out, metadata, fmt.Errorf("invalid accountID set: %w", err) - } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) 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 c3a970dff4..412f5c555f 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.30.7" +const goModuleVersion = "1.30.8" 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 a9a35881af..bb291161aa 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 @@ -24,9 +24,6 @@ type Options struct { // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error - // Indicates how aws account ID is applied in endpoint2.0 routing - AccountIDEndpointMode aws.AccountIDEndpointMode - // The optional application specific identifier appended to the User-Agent header. AppID string diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 96d57df805..28d3ccb90f 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,16 @@ +# Release (2024-09-19) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.21.0 + * **Feature**: Add tracing and metrics APIs, and builtin instrumentation for both, in generated clients. +* `github.com/aws/smithy-go/metrics/smithyotelmetrics`: [v1.0.0](metrics/smithyotelmetrics/CHANGELOG.md#v100-2024-09-19) + * **Release**: Initial release of `smithyotelmetrics` module, which is used to adapt an OpenTelemetry SDK meter provider to be used with Smithy clients. +* `github.com/aws/smithy-go/tracing/smithyoteltracing`: [v1.0.0](tracing/smithyoteltracing/CHANGELOG.md#v100-2024-09-19) + * **Release**: Initial release of `smithyoteltracing` module, which is used to adapt an OpenTelemetry SDK tracer provider to be used with Smithy clients. + # Release (2024-08-14) ## Module Highlights 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 33355b22c8..24162a6f5b 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.20.4" +const goModuleVersion = "1.21.0" diff --git a/vendor/github.com/aws/smithy-go/middleware/context.go b/vendor/github.com/aws/smithy-go/middleware/context.go new file mode 100644 index 0000000000..f51aa4f04f --- /dev/null +++ b/vendor/github.com/aws/smithy-go/middleware/context.go @@ -0,0 +1,41 @@ +package middleware + +import "context" + +type ( + serviceIDKey struct{} + operationNameKey struct{} +) + +// WithServiceID adds a service ID to the context, scoped to middleware stack +// values. +// +// This API is called in the client runtime when bootstrapping an operation and +// should not typically be used directly. +func WithServiceID(parent context.Context, id string) context.Context { + return WithStackValue(parent, serviceIDKey{}, id) +} + +// GetServiceID retrieves the service ID from the context. This is typically +// the service shape's name from its Smithy model. Service clients for specific +// systems (e.g. AWS SDK) may use an alternate designated value. +func GetServiceID(ctx context.Context) string { + id, _ := GetStackValue(ctx, serviceIDKey{}).(string) + return id +} + +// WithOperationName adds the operation name to the context, scoped to +// middleware stack values. +// +// This API is called in the client runtime when bootstrapping an operation and +// should not typically be used directly. +func WithOperationName(parent context.Context, id string) context.Context { + return WithStackValue(parent, operationNameKey{}, id) +} + +// GetOperationName retrieves the operation name from the context. This is +// typically the operation shape's name from its Smithy model. +func GetOperationName(ctx context.Context) string { + name, _ := GetStackValue(ctx, operationNameKey{}).(string) + return name +} diff --git a/vendor/github.com/aws/smithy-go/properties.go b/vendor/github.com/aws/smithy-go/properties.go index c9af66c0ea..68df4c4e0e 100644 --- a/vendor/github.com/aws/smithy-go/properties.go +++ b/vendor/github.com/aws/smithy-go/properties.go @@ -1,9 +1,11 @@ package smithy +import "maps" + // PropertiesReader provides an interface for reading metadata from the // underlying metadata container. type PropertiesReader interface { - Get(key interface{}) interface{} + Get(key any) any } // Properties provides storing and reading metadata values. Keys may be any @@ -12,14 +14,14 @@ type PropertiesReader interface { // The zero value for a Properties instance is ready for reads/writes without // any additional initialization. type Properties struct { - values map[interface{}]interface{} + values map[any]any } // Get attempts to retrieve the value the key points to. Returns nil if the // key was not found. // // Panics if key type is not comparable. -func (m *Properties) Get(key interface{}) interface{} { +func (m *Properties) Get(key any) any { m.lazyInit() return m.values[key] } @@ -28,7 +30,7 @@ func (m *Properties) Get(key interface{}) interface{} { // that key it will be replaced with the new value. // // Panics if the key type is not comparable. -func (m *Properties) Set(key, value interface{}) { +func (m *Properties) Set(key, value any) { m.lazyInit() m.values[key] = value } @@ -36,7 +38,7 @@ func (m *Properties) Set(key, value interface{}) { // Has returns whether the key exists in the metadata. // // Panics if the key type is not comparable. -func (m *Properties) Has(key interface{}) bool { +func (m *Properties) Has(key any) bool { m.lazyInit() _, ok := m.values[key] return ok @@ -55,8 +57,13 @@ func (m *Properties) SetAll(other *Properties) { } } +// Values returns a shallow clone of the property set's values. +func (m *Properties) Values() map[any]any { + return maps.Clone(m.values) +} + func (m *Properties) lazyInit() { if m.values == nil { - m.values = map[interface{}]interface{}{} + m.values = map[any]any{} } } diff --git a/vendor/github.com/aws/smithy-go/tracing/context.go b/vendor/github.com/aws/smithy-go/tracing/context.go new file mode 100644 index 0000000000..a404ed9d37 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/tracing/context.go @@ -0,0 +1,96 @@ +package tracing + +import "context" + +type ( + operationTracerKey struct{} + spanLineageKey struct{} +) + +// GetSpan returns the active trace Span on the context. +// +// The boolean in the return indicates whether a Span was actually in the +// context, but a no-op implementation will be returned if not, so callers +// can generally disregard the boolean unless they wish to explicitly confirm +// presence/absence of a Span. +func GetSpan(ctx context.Context) (Span, bool) { + lineage := getLineage(ctx) + if len(lineage) == 0 { + return nopSpan{}, false + } + + return lineage[len(lineage)-1], true +} + +// WithSpan sets the active trace Span on the context. +func WithSpan(parent context.Context, span Span) context.Context { + lineage := getLineage(parent) + if len(lineage) == 0 { + return context.WithValue(parent, spanLineageKey{}, []Span{span}) + } + + lineage = append(lineage, span) + return context.WithValue(parent, spanLineageKey{}, lineage) +} + +// PopSpan pops the current Span off the context, setting the active Span on +// the returned Context back to its parent and returning the REMOVED one. +// +// PopSpan on a context with no active Span will return a no-op instance. +// +// This is mostly necessary for the runtime to manage base trace spans due to +// the wrapped-function nature of the middleware stack. End-users of Smithy +// clients SHOULD NOT generally be using this API. +func PopSpan(parent context.Context) (context.Context, Span) { + lineage := getLineage(parent) + if len(lineage) == 0 { + return parent, nopSpan{} + } + + span := lineage[len(lineage)-1] + lineage = lineage[:len(lineage)-1] + return context.WithValue(parent, spanLineageKey{}, lineage), span +} + +func getLineage(ctx context.Context) []Span { + v := ctx.Value(spanLineageKey{}) + if v == nil { + return nil + } + + return v.([]Span) +} + +// GetOperationTracer returns the embedded operation-scoped Tracer on a +// Context. +// +// The boolean in the return indicates whether a Tracer was actually in the +// context, but a no-op implementation will be returned if not, so callers +// can generally disregard the boolean unless they wish to explicitly confirm +// presence/absence of a Tracer. +func GetOperationTracer(ctx context.Context) (Tracer, bool) { + v := ctx.Value(operationTracerKey{}) + if v == nil { + return nopTracer{}, false + } + + return v.(Tracer), true +} + +// WithOperationTracer returns a child Context embedding the given Tracer. +// +// The runtime will use this embed a scoped tracer for client operations, +// Smithy/SDK client callers DO NOT need to do this explicitly. +func WithOperationTracer(parent context.Context, tracer Tracer) context.Context { + return context.WithValue(parent, operationTracerKey{}, tracer) +} + +// StartSpan is a convenience API for creating tracing Spans from a Context. +// +// StartSpan uses the operation-scoped Tracer, previously stored using +// [WithOperationTracer], to start the Span. If a Tracer has not been embedded +// the returned Span will be a no-op implementation. +func StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) { + tracer, _ := GetOperationTracer(ctx) + return tracer.StartSpan(ctx, name, opts...) +} diff --git a/vendor/github.com/aws/smithy-go/tracing/nop.go b/vendor/github.com/aws/smithy-go/tracing/nop.go new file mode 100644 index 0000000000..573d28b1c1 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/tracing/nop.go @@ -0,0 +1,32 @@ +package tracing + +import "context" + +// NopTracerProvider is a no-op tracing implementation. +type NopTracerProvider struct{} + +var _ TracerProvider = (*NopTracerProvider)(nil) + +// Tracer returns a tracer which creates no-op spans. +func (NopTracerProvider) Tracer(string, ...TracerOption) Tracer { + return nopTracer{} +} + +type nopTracer struct{} + +var _ Tracer = (*nopTracer)(nil) + +func (nopTracer) StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) { + return ctx, nopSpan{} +} + +type nopSpan struct{} + +var _ Span = (*nopSpan)(nil) + +func (nopSpan) Name() string { return "" } +func (nopSpan) Context() SpanContext { return SpanContext{} } +func (nopSpan) AddEvent(string, ...EventOption) {} +func (nopSpan) SetProperty(any, any) {} +func (nopSpan) SetStatus(SpanStatus) {} +func (nopSpan) End() {} diff --git a/vendor/github.com/aws/smithy-go/tracing/tracing.go b/vendor/github.com/aws/smithy-go/tracing/tracing.go new file mode 100644 index 0000000000..089ed3932e --- /dev/null +++ b/vendor/github.com/aws/smithy-go/tracing/tracing.go @@ -0,0 +1,95 @@ +// Package tracing defines tracing APIs to be used by Smithy clients. +package tracing + +import ( + "context" + + "github.com/aws/smithy-go" +) + +// SpanStatus records the "success" state of an observed span. +type SpanStatus int + +// Enumeration of SpanStatus. +const ( + SpanStatusUnset SpanStatus = iota + SpanStatusOK + SpanStatusError +) + +// SpanKind indicates the nature of the work being performed. +type SpanKind int + +// Enumeration of SpanKind. +const ( + SpanKindInternal SpanKind = iota + SpanKindClient + SpanKindServer + SpanKindProducer + SpanKindConsumer +) + +// TracerProvider is the entry point for creating client traces. +type TracerProvider interface { + Tracer(scope string, opts ...TracerOption) Tracer +} + +// TracerOption applies configuration to a tracer. +type TracerOption func(o *TracerOptions) + +// TracerOptions represent configuration for tracers. +type TracerOptions struct { + Properties smithy.Properties +} + +// Tracer is the entry point for creating observed client Spans. +// +// Spans created by tracers propagate by existing on the Context. Consumers of +// the API can use [GetSpan] to pull the active Span from a Context. +// +// Creation of child Spans is implicit through Context persistence. If +// CreateSpan is called with a Context that holds a Span, the result will be a +// child of that Span. +type Tracer interface { + StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) +} + +// SpanOption applies configuration to a span. +type SpanOption func(o *SpanOptions) + +// SpanOptions represent configuration for span events. +type SpanOptions struct { + Kind SpanKind + Properties smithy.Properties +} + +// Span records a conceptually individual unit of work that takes place in a +// Smithy client operation. +type Span interface { + Name() string + Context() SpanContext + AddEvent(name string, opts ...EventOption) + SetStatus(status SpanStatus) + SetProperty(k, v any) + End() +} + +// EventOption applies configuration to a span event. +type EventOption func(o *EventOptions) + +// EventOptions represent configuration for span events. +type EventOptions struct { + Properties smithy.Properties +} + +// SpanContext uniquely identifies a Span. +type SpanContext struct { + TraceID string + SpanID string + IsRemote bool +} + +// IsValid is true when a span has nonzero trace and span IDs. +func (ctx *SpanContext) IsValid() bool { + return len(ctx.TraceID) != 0 && len(ctx.SpanID) != 0 +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/client.go b/vendor/github.com/aws/smithy-go/transport/http/client.go index e691c69bf4..c43c346b6f 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/client.go +++ b/vendor/github.com/aws/smithy-go/transport/http/client.go @@ -7,6 +7,7 @@ import ( smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" ) // ClientDo provides the interface for custom HTTP client implementations. @@ -42,6 +43,9 @@ func NewClientHandler(client ClientDo) ClientHandler { func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( out interface{}, metadata middleware.Metadata, err error, ) { + ctx, span := tracing.StartSpan(ctx, "DoHTTPRequest") + defer span.End() + req, ok := input.(*Request) if !ok { return nil, metadata, fmt.Errorf("expect Smithy http.Request value as input, got unsupported type %T", input) @@ -52,6 +56,16 @@ func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( return nil, metadata, err } + span.SetProperty("http.method", req.Method) + span.SetProperty("http.request_content_length", -1) // at least indicate unknown + length, ok, err := req.StreamLength() + if err != nil { + return nil, metadata, err + } + if ok { + span.SetProperty("http.request_content_length", length) + } + resp, err := c.client.Do(builtRequest) if resp == nil { // Ensure a http response value is always present to prevent unexpected @@ -79,6 +93,10 @@ func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( _ = builtRequest.Body.Close() } + span.SetProperty("net.protocol.version", fmt.Sprintf("%d.%d", resp.ProtoMajor, resp.ProtoMinor)) + span.SetProperty("http.status_code", resp.StatusCode) + span.SetProperty("http.response_content_length", resp.ContentLength) + return &Response{Response: resp}, metadata, err } diff --git a/vendor/github.com/bits-and-blooms/bitset/bitset.go b/vendor/github.com/bits-and-blooms/bitset/bitset.go index 26cd6e4a42..2e8d9cef17 100644 --- a/vendor/github.com/bits-and-blooms/bitset/bitset.go +++ b/vendor/github.com/bits-and-blooms/bitset/bitset.go @@ -68,9 +68,16 @@ var base64Encoding = base64.URLEncoding // Base64StdEncoding Marshal/Unmarshal BitSet with base64.StdEncoding(Default: base64.URLEncoding) func Base64StdEncoding() { base64Encoding = base64.StdEncoding } -// LittleEndian Marshal/Unmarshal Binary as Little Endian(Default: binary.BigEndian) +// LittleEndian sets Marshal/Unmarshal Binary as Little Endian (Default: binary.BigEndian) func LittleEndian() { binaryOrder = binary.LittleEndian } +// BigEndian sets Marshal/Unmarshal Binary as Big Endian (Default: binary.BigEndian) +func BigEndian() { binaryOrder = binary.BigEndian } + +// BinaryOrder returns the current binary order, see also LittleEndian() +// and BigEndian() to change the order. +func BinaryOrder() binary.ByteOrder { return binaryOrder } + // A BitSet is a set of bits. The zero value of a BitSet is an empty set of length 0. type BitSet struct { length uint @@ -104,7 +111,9 @@ func FromWithLength(len uint, set []uint64) *BitSet { return &BitSet{len, set} } -// Bytes returns the bitset as array of words +// Bytes returns the bitset as array of 64-bit words, giving direct access to the internal representation. +// It is not a copy, so changes to the returned slice will affect the bitset. +// It is meant for advanced users. func (b *BitSet) Bytes() []uint64 { return b.set } @@ -118,7 +127,7 @@ func wordsNeeded(i uint) int { } // wordsNeededUnbound calculates the number of words needed for i bits, possibly exceeding the capacity. -// This function is useful if you know that the capacity cannot be exceeded (e.g., you have an existing bitmap). +// This function is useful if you know that the capacity cannot be exceeded (e.g., you have an existing BitSet). func wordsNeededUnbound(i uint) int { return int((i + (wordSize - 1)) >> log2WordSize) } @@ -148,15 +157,16 @@ func New(length uint) (bset *BitSet) { } // Cap returns the total possible capacity, or number of bits -// that can be stored in the BitSet. Note that this is further limited -// by the maximum allocation size in Go, and your available memory, -// as any Go data structure. +// that can be stored in the BitSet theoretically. Under 32-bit system, +// it is 4294967295 and under 64-bit system, it is 18446744073709551615. +// Note that this is further limited by the maximum allocation size in Go, +// and your available memory, as any Go data structure. func Cap() uint { return ^uint(0) } // Len returns the number of bits in the BitSet. -// Note the difference to method Count, see example. +// Note that it differ from Count function. func (b *BitSet) Len() uint { return b.length } @@ -189,10 +199,10 @@ func (b *BitSet) Test(i uint) bool { // Set bit i to 1, the capacity of the bitset is automatically // increased accordingly. -// If i>= Cap(), this function will panic. // Warning: using a very large value for 'i' // may lead to a memory shortage and a panic: the caller is responsible // for providing sensible parameters in line with their memory capacity. +// The memory usage is at least slightly over i/8 bytes. func (b *BitSet) Set(i uint) *BitSet { if i >= b.length { // if we need more bits, make 'em b.extendSet(i) @@ -201,7 +211,7 @@ func (b *BitSet) Set(i uint) *BitSet { return b } -// Clear bit i to 0 +// Clear bit i to 0. This never cause a memory allocation. It is always safe. func (b *BitSet) Clear(i uint) *BitSet { if i >= b.length { return b @@ -211,7 +221,6 @@ func (b *BitSet) Clear(i uint) *BitSet { } // SetTo sets bit i to value. -// If i>= Cap(), this function will panic. // Warning: using a very large value for 'i' // may lead to a memory shortage and a panic: the caller is responsible // for providing sensible parameters in line with their memory capacity. @@ -223,7 +232,6 @@ func (b *BitSet) SetTo(i uint, value bool) *BitSet { } // Flip bit at i. -// If i>= Cap(), this function will panic. // Warning: using a very large value for 'i' // may lead to a memory shortage and a panic: the caller is responsible // for providing sensible parameters in line with their memory capacity. @@ -236,7 +244,6 @@ func (b *BitSet) Flip(i uint) *BitSet { } // FlipRange bit in [start, end). -// If end>= Cap(), this function will panic. // Warning: using a very large value for 'end' // may lead to a memory shortage and a panic: the caller is responsible // for providing sensible parameters in line with their memory capacity. @@ -278,6 +285,7 @@ func (b *BitSet) FlipRange(start, end uint) *BitSet { // memory usage until the GC runs. Normally this should not be a problem, but if you // have an extremely large BitSet its important to understand that the old BitSet will // remain in memory until the GC frees it. +// If you are memory constrained, this function may cause a panic. func (b *BitSet) Shrink(lastbitindex uint) *BitSet { length := lastbitindex + 1 idx := wordsNeeded(length) @@ -297,6 +305,11 @@ func (b *BitSet) Shrink(lastbitindex uint) *BitSet { // Compact shrinks BitSet to so that we preserve all set bits, while minimizing // memory usage. Compact calls Shrink. +// A new slice is allocated to store the new bits, so you may see an increase in +// memory usage until the GC runs. Normally this should not be a problem, but if you +// have an extremely large BitSet its important to understand that the old BitSet will +// remain in memory until the GC frees it. +// If you are memory constrained, this function may cause a panic. func (b *BitSet) Compact() *BitSet { idx := len(b.set) - 1 for ; idx >= 0 && b.set[idx] == 0; idx-- { @@ -356,7 +369,8 @@ func (b *BitSet) InsertAt(idx uint) *BitSet { return b } -// String creates a string representation of the Bitmap +// String creates a string representation of the BitSet. It is only intended for +// human-readable output and not for serialization. func (b *BitSet) String() string { // follows code from https://github.com/RoaringBitmap/roaring var buffer bytes.Buffer @@ -544,7 +558,8 @@ func (b *BitSet) NextClear(i uint) (uint, bool) { return 0, false } -// ClearAll clears the entire BitSet +// ClearAll clears the entire BitSet. +// It does not free the memory. func (b *BitSet) ClearAll() *BitSet { if b != nil && b.set != nil { for i := range b.set { @@ -961,6 +976,7 @@ func (b *BitSet) IsStrictSuperSet(other *BitSet) bool { // DumpAsBits dumps a bit set as a string of bits. Following the usual convention in Go, // the least significant bits are printed last (index 0 is at the end of the string). +// This is useful for debugging and testing. It is not suitable for serialization. func (b *BitSet) DumpAsBits() string { if b.set == nil { return "." @@ -1023,6 +1039,15 @@ func writeUint64Array(writer io.Writer, data []uint64) error { // WriteTo writes a BitSet to a stream. The format is: // 1. uint64 length // 2. []uint64 set +// The length is the number of bits in the BitSet. +// +// The set is a slice of uint64s containing between length and length + 63 bits. +// It is interpreted as a big-endian array of uint64s by default (see BinaryOrder()) +// meaning that the first 8 bits are stored at byte index 7, the next 8 bits are stored +// at byte index 6... the bits 64 to 71 are stored at byte index 8, etc. +// If you change the binary order, you need to do so for both reading and writing. +// We recommend using the default binary order. +// // Upon success, the number of bytes written is returned. // // Performance: if this function is used to write to a disk or network @@ -1053,6 +1078,7 @@ func (b *BitSet) WriteTo(stream io.Writer) (int64, error) { // The format is: // 1. uint64 length // 2. []uint64 set +// See WriteTo for details. // Upon success, the number of bytes read is returned. // If the current BitSet is not large enough to hold the data, // it is extended. In case of error, the BitSet is either @@ -1104,6 +1130,7 @@ func (b *BitSet) ReadFrom(stream io.Reader) (int64, error) { } // MarshalBinary encodes a BitSet into a binary form and returns the result. +// Please see WriteTo for details. func (b *BitSet) MarshalBinary() ([]byte, error) { var buf bytes.Buffer _, err := b.WriteTo(&buf) @@ -1115,6 +1142,7 @@ func (b *BitSet) MarshalBinary() ([]byte, error) { } // UnmarshalBinary decodes the binary form generated by MarshalBinary. +// Please see WriteTo for details. func (b *BitSet) UnmarshalBinary(data []byte) error { buf := bytes.NewReader(data) _, err := b.ReadFrom(buf) diff --git a/vendor/github.com/charmbracelet/bubbletea/README.md b/vendor/github.com/charmbracelet/bubbletea/README.md index 9a8d93e2a2..f80e04ea21 100644 --- a/vendor/github.com/charmbracelet/bubbletea/README.md +++ b/vendor/github.com/charmbracelet/bubbletea/README.md @@ -35,7 +35,7 @@ Be sure to check out [Bubbles][bubbles], a library of common UI components for B Text Input Example from Bubbles

-*** +--- ## Tutorial @@ -49,7 +49,7 @@ By the way, the non-annotated source code for this program is available [on GitHub][tut-source]. [elm]: https://guide.elm-lang.org/architecture/ -[tut-source]:https://github.com/charmbracelet/bubbletea/tree/master/tutorials/basics +[tut-source]: https://github.com/charmbracelet/bubbletea/tree/master/tutorials/basics ### Enough! Let's get to it. @@ -72,9 +72,9 @@ import ( Bubble Tea programs are comprised of a **model** that describes the application state and three simple methods on that model: -* **Init**, a function that returns an initial command for the application to run. -* **Update**, a function that handles incoming events and updates the model accordingly. -* **View**, a function that renders the UI based on the data in the model. +- **Init**, a function that returns an initial command for the application to run. +- **Update**, a function that handles incoming events and updates the model accordingly. +- **View**, a function that renders the UI based on the data in the model. ### The Model @@ -275,11 +275,11 @@ $ dlv connect 127.0.0.1:43000 ``` If you do not explicitly supply the `--listen` flag, the port used will vary -per run, so passing this in makes the debugger easier to use from a script -or your IDE of choice. +per run, so passing this in makes the debugger easier to use from a script +or your IDE of choice. -Additionally, we pass in `--api-version=2` because delve defaults to version 1 -for backwards compatibility reasons. However, delve recommends using version 2 +Additionally, we pass in `--api-version=2` because delve defaults to version 1 +for backwards compatibility reasons. However, delve recommends using version 2 for all new development and some clients may no longer work with version 1. For more information, see the [Delve documentation](https://github.com/go-delve/delve/tree/master/Documentation/api). @@ -305,13 +305,13 @@ your program in another window. ## Libraries we use with Bubble Tea -* [Bubbles][bubbles]: Common Bubble Tea components such as text inputs, viewports, spinners and so on -* [Lip Gloss][lipgloss]: Style, format and layout tools for terminal applications -* [Harmonica][harmonica]: A spring animation library for smooth, natural motion -* [BubbleZone][bubblezone]: Easy mouse event tracking for Bubble Tea components -* [ntcharts][ntcharts]: A terminal charting library built for Bubble Tea and [Lip Gloss][lipgloss] -* [Termenv][termenv]: Advanced ANSI styling for terminal applications -* [Reflow][reflow]: Advanced ANSI-aware methods for working with text +- [Bubbles][bubbles]: Common Bubble Tea components such as text inputs, viewports, spinners and so on +- [Lip Gloss][lipgloss]: Style, format and layout tools for terminal applications +- [Harmonica][harmonica]: A spring animation library for smooth, natural motion +- [BubbleZone][bubblezone]: Easy mouse event tracking for Bubble Tea components +- [ntcharts][ntcharts]: A terminal charting library built for Bubble Tea and [Lip Gloss][lipgloss] +- [Termenv][termenv]: Advanced ANSI styling for terminal applications +- [Reflow][reflow]: Advanced ANSI-aware methods for working with text [bubbles]: https://github.com/charmbracelet/bubbles [lipgloss]: https://github.com/charmbracelet/lipgloss @@ -323,109 +323,44 @@ your program in another window. ## Bubble Tea in the Wild -For some Bubble Tea programs in production, see: - -* [ASCII Movie](https://github.com/gabe565/ascii-movie): a Star Wars ASCII art movie player -* [AT CLI](https://github.com/daskycodes/at_cli): execute AT Commands via serial port connections -* [Aztify](https://github.com/Azure/aztfy): bring Microsoft Azure resources under Terraform -* [brows](https://github.com/rubysolo/brows): a GitHub release browser -* [Canard](https://github.com/mrusme/canard): an RSS client -* [charm](https://github.com/charmbracelet/charm): the official Charm user account manager -* [chatgpt-cli](https://github.com/j178/chatgpt): a CLI for ChatGPT -* [chatgpt-tui](https://github.com/tearingItUp786/chatgpt-tui): a TUI for ChatGPT with SQLite sessions -* [ChatGPTUI](https://github.com/dwisiswant0/chatgptui): a TUI for ChatGPT -* [chezmoi](https://github.com/twpayne/chezmoi): securely manage your dotfiles across multiple machines -* [chip-8](https://github.com/braheezy/chip-8): a CHIP-8 interpreter -* [chtop](https://github.com/chhetripradeep/chtop): monitor your ClickHouse node without leaving the terminal -* [circumflex](https://github.com/bensadeh/circumflex): read Hacker News in the terminal -* [clidle](https://github.com/ajeetdsouza/clidle): a Wordle clone -* [cLive](https://github.com/koki-develop/clive): automate terminal operations and view them live in a browser -* [container-canary](https://github.com/NVIDIA/container-canary): a container validator -* [countdown](https://github.com/aldernero/countdown): a multi-event countdown timer -* [CRT](https://github.com/BigJk/crt): a simple terminal emulator for running Bubble Tea in a dedicated window, with optional shaders -* [cueitup](https://github.com/dhth/cueitup): inspect messages in an AWS SQS queue in a simple and deliberate manner -* [Daytona](https://github.com/daytonaio/daytona): an development environment manager -* [dns53](https://github.com/purpleclay/dns53): dynamic DNS with Amazon Route53; expose your EC2 quickly, securely and privately -* [eks-node-viewer](https://github.com/awslabs/eks-node-viewer): a tool for visualizing dynamic node usage within an EKS cluster -* [End Of Eden](https://github.com/BigJk/end_of_eden): a "Slay the Spire"-like, roguelike deck-builder game -* [enola](https://github.com/sherlock-project/enola): find social media accounts by username across social networks -* [flapioca](https://github.com/kbrgl/flapioca): Flappy Bird on the CLI! -* [fm](https://github.com/knipferrc/fm): a terminal-based file manager -* [fork-cleaner](https://github.com/caarlos0/fork-cleaner): clean up old and inactive forks in your GitHub account -* [fractals-cli](https://github.com/MicheleFiladelfia/fractals-cli): a multiplatform terminal fractal explorer -* [fztea](https://github.com/jon4hz/fztea): a Flipper Zero TUI -* [gama](https://github.com/termkit/gama): manage GitHub Actions from the terminal -* [gambit](https://github.com/maaslalani/gambit): chess in the terminal -* [gembro](https://git.sr.ht/~rafael/gembro): a mouse-driven Gemini browser -* [gh-b](https://github.com/joaom00/gh-b): a GitHub CLI extension for managing branches -* [gh-dash](https://www.github.com/dlvhdr/gh-dash): a GitHub CLI extension for PRs and issues -* [gitflow-toolkit](https://github.com/mritd/gitflow-toolkit): a GitFlow submission tool -* [Glow](https://github.com/charmbracelet/glow): a markdown reader, browser, and online markdown stash -* [go-sweep](https://github.com/maxpaulus43/go-sweep): Minesweeper in the terminal -* [gocovsh](https://github.com/orlangure/gocovsh): explore Go coverage reports from the CLI -* [got](https://github.com/fedeztk/got): a simple translator and text-to-speech app built on simplytranslate's APIs -* [gum](https://github.com/charmbracelet/gum): interactivity and styling for shells and shell scripts -* [hiSHtory](https://github.com/ddworken/hishtory): your shell history in context: synced, and queryable -* [httpit](https://github.com/gonetx/httpit): a rapid http(s) benchmark tool -* [Huh?](https://github.com/charmbracelet/huh): an interactive prompt and form toolkit -* [IDNT](https://github.com/r-darwish/idnt): a batch software uninstaller -* [json-log-viewer](https://github.com/hedhyw/json-log-viewer): an interactive JSON log viewer -* [kboard](https://github.com/CamiloGarciaLaRotta/kboard): a typing game -* [kplay](https://github.com/dhth/kplay): inspect messages in a Kafka topic -* [laboon](https://github.com/arisnacg/laboon): a Docker-desktop-style container manager -* [mc](https://github.com/minio/mc): the official [MinIO](https://min.io) client -* [mergestat](https://github.com/mergestat/mergestat): run SQL queries on git repositories -* [meteor](https://github.com/stefanlogue/meteor): a highly customizable conventional commit message tool -* [mods](https://github.com/charmbracelet/mods): AI on the CLI, built for pipelines -* [nachrichten](https://github.com/zMoooooritz/nachrichten): access up-to-date news in German provided by the [Tagesschau](https://www.tagesschau.de/) -* [Neon Modem Overdrive](https://github.com/mrusme/neonmodem): a BBS-style TUI client for Discourse, Lemmy, Lobste.rs and Hacker News -* [nom](https://github.com/guyfedwards/nom): an RSS reader and manager -* [Noted](https://github.com/torbratsberg/noted): a note viewer and manager -* [outtasync](https://github.com/dhth/outtasync): identify CloudFormation stacks that are out of sync with their template files -* [pathos](https://github.com/chip/pathos): a PATH environment variable editor -* [Plandex](https://github.com/plandex-ai/plandex): a terminal-based AI coding engine for complex tasks -* [portal](https://github.com/ZinoKader/portal): secure transfers between computers -* [prs](https://github.com/dhth/prs): stay up to date with your PRs -* [puffin](https://github.com/siddhantac/puffin): a TUI for hledger to manage your finances -* [pug](https://github.com/leg100/pug): terraform task manager -* [punchout](https://github.com/dhth/punchout): takes the suck out of logging time on JIRA -* [redis-viewer](https://github.com/SaltFishPr/redis-viewer): a Redis database browser -* [redis_tui](https://github.com/mat2cc/redis_tui): a Redis database browser -* [schemas](https://github.com/dhth/schemas): lets you inspect postgres schemas in the terminal -* [scrabbler](https://github.com/wI2L/scrabbler): an automatic draw tool for your duplicate Scrabble games -* [sku](https://github.com/fedeztk/sku): Sudoku on the CLI -* [Slides](https://github.com/maaslalani/slides): a markdown-based presentation tool -* [SlurmCommander](https://github.com/CLIP-HPC/SlurmCommander): a Slurm workload manager -* [Soft Serve](https://github.com/charmbracelet/soft-serve): a command-line-first Git server that runs a TUI over SSH -* [solitaire-tui](https://github.com/brianstrauch/solitaire-tui): Klondike Solitaire for the terminal -* [StormForge Optimize Controller](https://github.com/thestormforge/optimize-controller): a tool for experimenting with application configurations in Kubernetes -* [Storydb](https://github.com/grrlopes/storydb): an improved bash/zsh-style ctrl+r command history finder -* [STTG](https://github.com/wille1101/sttg): a teletext client for SVT, Sweden’s national public television station -* [sttr](https://github.com/abhimanyu003/sttr): a general-purpose text transformer -* [superfile](https://github.com/MHNightCat/superfile) a fancy, modern terminal-based file manager -* [tasktimer](https://github.com/caarlos0/tasktimer): a dead-simple task timer -* [termdbms](https://github.com/mathaou/termdbms): a keyboard and mouse driven database browser -* [tgpt](https://github.com/aandrew-me/tgpt): conversational AI for the CLI; no API keys necessary -* [ticker](https://github.com/achannarasappa/ticker): a terminal stock viewer and stock position tracker -* [trainer](https://github.com/rusinikita/trainer): a Go concurrency coding interview simulator with learning materials -* [tran](https://github.com/abdfnx/tran): securely transfer stuff between computers (based on [portal](https://github.com/ZinoKader/portal)) -* [Trufflehog](https://github.com/trufflesecurity/trufflehog): find leaked credentials -* [Typer](https://github.com/maaslalani/typer): a typing test -* [typioca](https://github.com/bloznelis/typioca): a typing test -* [tz](https://github.com/oz/tz): a scheduling aid for people in multiple time zones -* [ugm](https://github.com/ariasmn/ugm): a unix user and group browser -* [walk](https://github.com/antonmedv/walk): a terminal navigator -* [wander](https://github.com/robinovitch61/wander): a HashiCorp Nomad terminal client -* [WG Commander](https://github.com/AndrianBdn/wg-cmd): a TUI for a simple WireGuard VPN setup -* [wishlist](https://github.com/charmbracelet/wishlist): an SSH directory +There are over 8k applications built with Bubble Tea! Here are a handful of ’em. + +### Staff favourites + +- [chezmoi](https://github.com/twpayne/chezmoi): securely manage your dotfiles across multiple machines +- [circumflex](https://github.com/bensadeh/circumflex): read Hacker News in the terminal +- [gh-dash](https://www.github.com/dlvhdr/gh-dash): a GitHub CLI extension for PRs and issues +- [Tetrigo](https://github.com/Broderick-Westrope/tetrigo): Tetris in the terminal + +### In Industry + +- Microsoft Azure – [Aztify](https://github.com/Azure/aztfy): bring Microsoft Azure resources under Terraform +- Daytona – [Daytona](https://github.com/daytonaio/daytona): open source dev environment manager +- Truffle Security Co. – [Trufflehog](https://github.com/trufflesecurity/trufflehog): find leaked credentials +- NVIDIA – [container-canary](https://github.com/NVIDIA/container-canary) from NVIDIA: a container validator +- AWS – [eks-node-viewer](https://github.com/awslabs/eks-node-viewer) from AWS: a tool for visualizing dynamic node usage within an EKS cluster +- MinIO – [mc](https://github.com/minio/mc) from Min.io: the official [MinIO](https://min.io) client + +### Charm stuff + +- [Glow](https://github.com/charmbracelet/glow): a markdown reader, browser, and online markdown stash +- [Huh?](https://github.com/charmbracelet/huh): an interactive prompt and form toolkit +- [Mods](https://github.com/charmbracelet/mods): AI on the CLI, built for pipelines +- [Wishlist](https://github.com/charmbracelet/wishlist): an SSH directory (and bastion!) + +### There’s so much more where that came from + +For more applications built with Bubble Tea see [Charm & Friends][community]. +Is there something cool you made with Bubble Tea you want to share? [PRs][community] are +welcome! ## Feedback -We'd love to hear your thoughts on this project. Feel free to drop us a note! +We’d love to hear your thoughts on this project. Feel free to drop us a note! -* [Twitter](https://twitter.com/charmcli) -* [The Fediverse](https://mastodon.social/@charmcli) -* [Discord](https://charm.sh/chat) +- [Twitter](https://twitter.com/charmcli) +- [The Fediverse](https://mastodon.social/@charmcli) +- [Discord](https://charm.sh/chat) ## Acknowledgments @@ -437,12 +372,13 @@ of days past. [elm]: https://guide.elm-lang.org/architecture/ [gotea]: https://github.com/tj/go-tea [zb]: https://de.wikipedia.org/wiki/Zeichenorientierte_Benutzerschnittstelle +[community]: https://github.com/charm-and-friends/charm-in-the-wild ## License [MIT](https://github.com/charmbracelet/bubbletea/raw/master/LICENSE) -*** +--- Part of [Charm](https://charm.sh). diff --git a/vendor/github.com/charmbracelet/bubbletea/options.go b/vendor/github.com/charmbracelet/bubbletea/options.go index 4a56fc8114..06abf4a983 100644 --- a/vendor/github.com/charmbracelet/bubbletea/options.go +++ b/vendor/github.com/charmbracelet/bubbletea/options.go @@ -235,9 +235,13 @@ func WithFPS(fps int) ProgramOption { } } -// WithReportFocus enables reporting when the terminal gains and lost focus. +// WithReportFocus enables reporting when the terminal gains and loses +// focus. When this is enabled [FocusMsg] and [BlurMsg] messages will be sent +// to your Update method. // -// You can then check for FocusMsg and BlurMsg in your model's Update method. +// Note that while most terminals and multiplexers support focus reporting, +// some do not. Also note that tmux needs to be configured to report focus +// events. func WithReportFocus() ProgramOption { return func(p *Program) { p.startupOptions |= withReportFocus diff --git a/vendor/github.com/charmbracelet/bubbletea/tea.go b/vendor/github.com/charmbracelet/bubbletea/tea.go index 5ed9707622..87211ba299 100644 --- a/vendor/github.com/charmbracelet/bubbletea/tea.go +++ b/vendor/github.com/charmbracelet/bubbletea/tea.go @@ -128,6 +128,10 @@ func (h channelHandlers) shutdown() { type Program struct { initialModel Model + // handlers is a list of channels that need to be waited on before the + // program can exit. + handlers channelHandlers + // Configuration options that will set as the program is initializing, // treated as bits. These options can be set via various ProgramOptions. startupOptions startupOptions @@ -312,6 +316,11 @@ func (p *Program) handleCommands(cmds chan Cmd) chan struct{} { // possible to cancel them so we'll have to leak the goroutine // until Cmd returns. go func() { + // Recover from panics. + if !p.startupOptions.has(withoutCatchPanics) { + defer p.recoverFromPanic() + } + msg := cmd() // this can be long. p.Send(msg) }() @@ -460,7 +469,7 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) { // terminated by either [Program.Quit], [Program.Kill], or its signal handler. // Returns the final model. func (p *Program) Run() (Model, error) { - handlers := channelHandlers{} + p.handlers = channelHandlers{} cmds := make(chan Cmd) p.errs = make(chan error) p.finished = make(chan struct{}, 1) @@ -507,19 +516,12 @@ func (p *Program) Run() (Model, error) { // Handle signals. if !p.startupOptions.has(withoutSignalHandler) { - handlers.add(p.handleSignals()) + p.handlers.add(p.handleSignals()) } // Recover from panics. if !p.startupOptions.has(withoutCatchPanics) { - defer func() { - if r := recover(); r != nil { - p.shutdown(true) - fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r) - debug.PrintStack() - return - } - }() + defer p.recoverFromPanic() } // If no renderer is set use the standard one. @@ -561,7 +563,7 @@ func (p *Program) Run() (Model, error) { model := p.initialModel if initCmd := model.Init(); initCmd != nil { ch := make(chan struct{}) - handlers.add(ch) + p.handlers.add(ch) go func() { defer close(ch) @@ -584,10 +586,10 @@ func (p *Program) Run() (Model, error) { } // Handle resize events. - handlers.add(p.handleResize()) + p.handlers.add(p.handleResize()) // Process commands. - handlers.add(p.handleCommands(cmds)) + p.handlers.add(p.handleCommands(cmds)) // Run event loop, handle updates and draw. model, err := p.eventLoop(model, cmds) @@ -599,21 +601,6 @@ func (p *Program) Run() (Model, error) { p.renderer.write(model.View()) } - // Tear down. - p.cancel() - - // Check if the cancel reader has been setup before waiting and closing. - if p.cancelReader != nil { - // Wait for input loop to finish. - if p.cancelReader.Cancel() { - p.waitForReadLoop() - } - _ = p.cancelReader.Close() - } - - // Wait for all handlers to finish. - handlers.shutdown() - // Restore terminal state. p.shutdown(killed) @@ -668,7 +655,7 @@ func (p *Program) Quit() { // The final render that you would normally see when quitting will be skipped. // [program.Run] returns a [ErrProgramKilled] error. func (p *Program) Kill() { - p.cancel() + p.shutdown(true) } // Wait waits/blocks until the underlying Program finished shutting down. @@ -679,6 +666,22 @@ func (p *Program) Wait() { // shutdown performs operations to free up resources and restore the terminal // to its original state. func (p *Program) shutdown(kill bool) { + p.cancel() + + // Wait for all handlers to finish. + p.handlers.shutdown() + + // Check if the cancel reader has been setup before waiting and closing. + if p.cancelReader != nil { + // Wait for input loop to finish. + if p.cancelReader.Cancel() { + if !kill { + p.waitForReadLoop() + } + } + _ = p.cancelReader.Close() + } + if p.renderer != nil { if kill { p.renderer.kill() @@ -688,7 +691,19 @@ func (p *Program) shutdown(kill bool) { } _ = p.restoreTerminalState() - p.finished <- struct{}{} + if !kill { + p.finished <- struct{}{} + } +} + +// recoverFromPanic recovers from a panic, prints the stack trace, and restores +// the terminal to a usable state. +func (p *Program) recoverFromPanic() { + if r := recover(); r != nil { + p.shutdown(true) + fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r) + debug.PrintStack() + } } // ReleaseTerminal restores the original terminal state and cancels the input diff --git a/vendor/github.com/charmbracelet/x/ansi/background.go b/vendor/github.com/charmbracelet/x/ansi/background.go index f519af08f1..6c66e629f7 100644 --- a/vendor/github.com/charmbracelet/x/ansi/background.go +++ b/vendor/github.com/charmbracelet/x/ansi/background.go @@ -23,6 +23,12 @@ func SetForegroundColor(c color.Color) string { // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands const RequestForegroundColor = "\x1b]10;?\x07" +// ResetForegroundColor is a sequence that resets the default terminal +// foreground color. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands +const ResetForegroundColor = "\x1b]110\x07" + // SetBackgroundColor returns a sequence that sets the default terminal // background color. // @@ -42,6 +48,12 @@ func SetBackgroundColor(c color.Color) string { // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands const RequestBackgroundColor = "\x1b]11;?\x07" +// ResetBackgroundColor is a sequence that resets the default terminal +// background color. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands +const ResetBackgroundColor = "\x1b]111\x07" + // SetCursorColor returns a sequence that sets the terminal cursor color. // // OSC 12 ; color ST @@ -59,3 +71,8 @@ func SetCursorColor(c color.Color) string { // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands const RequestCursorColor = "\x1b]12;?\x07" + +// ResetCursorColor is a sequence that resets the terminal cursor color. +// +// See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands +const ResetCursorColor = "\x1b]112\x07" diff --git a/vendor/github.com/charmbracelet/x/ansi/mode.go b/vendor/github.com/charmbracelet/x/ansi/mode.go index 7d25ddc542..5d70543456 100644 --- a/vendor/github.com/charmbracelet/x/ansi/mode.go +++ b/vendor/github.com/charmbracelet/x/ansi/mode.go @@ -26,18 +26,22 @@ package ansi // // See: https://vt100.net/docs/vt510-rm/DECCKM.html const ( - EnableCursorKeys = "\x1b[?1h" - DisableCursorKeys = "\x1b[?1l" - RequestCursorKeys = "\x1b[?1$p" + CursorKeysMode = "?1" + + EnableCursorKeys = "\x1b[" + CursorKeysMode + "h" + DisableCursorKeys = "\x1b[" + CursorKeysMode + "l" + RequestCursorKeys = "\x1b[" + CursorKeysMode + "$p" ) // Text Cursor Enable Mode (DECTCEM) is a mode that shows/hides the cursor. // // See: https://vt100.net/docs/vt510-rm/DECTCEM.html const ( - ShowCursor = "\x1b[?25h" - HideCursor = "\x1b[?25l" - RequestCursorVisibility = "\x1b[?25$p" + CursorVisibilityMode = "?25" + + ShowCursor = "\x1b[" + CursorVisibilityMode + "h" + HideCursor = "\x1b[" + CursorVisibilityMode + "l" + RequestCursorVisibility = "\x1b[" + CursorVisibilityMode + "$p" ) // VT Mouse Tracking is a mode that determines whether the mouse reports on @@ -45,9 +49,11 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( - EnableMouse = "\x1b[?1000h" - DisableMouse = "\x1b[?1000l" - RequestMouse = "\x1b[?1000$p" + MouseMode = "?1000" + + EnableMouse = "\x1b[" + MouseMode + "h" + DisableMouse = "\x1b[" + MouseMode + "l" + RequestMouse = "\x1b[" + MouseMode + "$p" ) // VT Hilite Mouse Tracking is a mode that determines whether the mouse reports on @@ -55,9 +61,11 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( - EnableMouseHilite = "\x1b[?1001h" - DisableMouseHilite = "\x1b[?1001l" - RequestMouseHilite = "\x1b[?1001$p" + MouseHiliteMode = "?1001" + + EnableMouseHilite = "\x1b[" + MouseHiliteMode + "h" + DisableMouseHilite = "\x1b[" + MouseHiliteMode + "l" + RequestMouseHilite = "\x1b[" + MouseHiliteMode + "$p" ) // Cell Motion Mouse Tracking is a mode that determines whether the mouse @@ -65,9 +73,11 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( - EnableMouseCellMotion = "\x1b[?1002h" - DisableMouseCellMotion = "\x1b[?1002l" - RequestMouseCellMotion = "\x1b[?1002$p" + MouseCellMotionMode = "?1002" + + EnableMouseCellMotion = "\x1b[" + MouseCellMotionMode + "h" + DisableMouseCellMotion = "\x1b[" + MouseCellMotionMode + "l" + RequestMouseCellMotion = "\x1b[" + MouseCellMotionMode + "$p" ) // All Mouse Tracking is a mode that determines whether the mouse reports on @@ -75,18 +85,22 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( - EnableMouseAllMotion = "\x1b[?1003h" - DisableMouseAllMotion = "\x1b[?1003l" - RequestMouseAllMotion = "\x1b[?1003$p" + MouseAllMotionMode = "?1003" + + EnableMouseAllMotion = "\x1b[" + MouseAllMotionMode + "h" + DisableMouseAllMotion = "\x1b[" + MouseAllMotionMode + "l" + RequestMouseAllMotion = "\x1b[" + MouseAllMotionMode + "$p" ) // Report Focus is a mode that makes the terminal report focus-in and focus-out events. // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-FocusIn_FocusOut const ( - EnableReportFocus = "\x1b[?1004h" - DisableReportFocus = "\x1b[?1004l" - RequestReportFocus = "\x1b[?1004$p" + ReportFocusMode = "?1004" + + EnableReportFocus = "\x1b[" + ReportFocusMode + "h" + DisableReportFocus = "\x1b[" + ReportFocusMode + "l" + RequestReportFocus = "\x1b[" + ReportFocusMode + "$p" ) // SGR Mouse Extension is a mode that determines whether the mouse reports events @@ -94,9 +108,11 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking const ( - EnableMouseSgrExt = "\x1b[?1006h" - DisableMouseSgrExt = "\x1b[?1006l" - RequestMouseSgrExt = "\x1b[?1006$p" + MouseSgrExtMode = "?1006" + + EnableMouseSgrExt = "\x1b[" + MouseSgrExtMode + "h" + DisableMouseSgrExt = "\x1b[" + MouseSgrExtMode + "l" + RequestMouseSgrExt = "\x1b[" + MouseSgrExtMode + "$p" ) // Alternate Screen Buffer is a mode that determines whether the alternate screen @@ -104,9 +120,11 @@ const ( // // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer const ( - EnableAltScreenBuffer = "\x1b[?1049h" - DisableAltScreenBuffer = "\x1b[?1049l" - RequestAltScreenBuffer = "\x1b[?1049$p" + AltScreenBufferMode = "?1049" + + EnableAltScreenBuffer = "\x1b[" + AltScreenBufferMode + "h" + DisableAltScreenBuffer = "\x1b[" + AltScreenBufferMode + "l" + RequestAltScreenBuffer = "\x1b[" + AltScreenBufferMode + "$p" ) // Bracketed Paste Mode is a mode that determines whether pasted text is @@ -115,9 +133,11 @@ const ( // See: https://cirw.in/blog/bracketed-paste // See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Bracketed-Paste-Mode const ( - EnableBracketedPaste = "\x1b[?2004h" - DisableBracketedPaste = "\x1b[?2004l" - RequestBracketedPaste = "\x1b[?2004$p" + BracketedPasteMode = "?2004" + + EnableBracketedPaste = "\x1b[" + BracketedPasteMode + "h" + DisableBracketedPaste = "\x1b[" + BracketedPasteMode + "l" + RequestBracketedPaste = "\x1b[" + BracketedPasteMode + "$p" ) // Synchronized Output Mode is a mode that determines whether output is @@ -125,9 +145,11 @@ const ( // // See: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 const ( - EnableSyncdOutput = "\x1b[?2026h" - DisableSyncdOutput = "\x1b[?2026l" - RequestSyncdOutput = "\x1b[?2026$p" + SyncdOutputMode = "?2026" + + EnableSyncdOutput = "\x1b[" + SyncdOutputMode + "h" + DisableSyncdOutput = "\x1b[" + SyncdOutputMode + "l" + RequestSyncdOutput = "\x1b[" + SyncdOutputMode + "$p" ) // Grapheme Clustering Mode is a mode that determines whether the terminal @@ -137,9 +159,11 @@ const ( // // See: https://github.com/contour-terminal/terminal-unicode-core const ( - EnableGraphemeClustering = "\x1b[?2027h" - DisableGraphemeClustering = "\x1b[?2027l" - RequestGraphemeClustering = "\x1b[?2027$p" + GraphemeClusteringMode = "?2027" + + EnableGraphemeClustering = "\x1b[" + GraphemeClusteringMode + "h" + DisableGraphemeClustering = "\x1b[" + GraphemeClusteringMode + "l" + RequestGraphemeClustering = "\x1b[" + GraphemeClusteringMode + "$p" ) // Win32Input is a mode that determines whether input is processed by the @@ -147,7 +171,9 @@ const ( // // See: https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md const ( - EnableWin32Input = "\x1b[?9001h" - DisableWin32Input = "\x1b[?9001l" - RequestWin32Input = "\x1b[?9001$p" + Win32InputMode = "?9001" + + EnableWin32Input = "\x1b[" + Win32InputMode + "h" + DisableWin32Input = "\x1b[" + Win32InputMode + "l" + RequestWin32Input = "\x1b[" + Win32InputMode + "$p" ) diff --git a/vendor/github.com/charmbracelet/x/ansi/parser.go b/vendor/github.com/charmbracelet/x/ansi/parser.go index 63654c04fc..e1a09df70f 100644 --- a/vendor/github.com/charmbracelet/x/ansi/parser.go +++ b/vendor/github.com/charmbracelet/x/ansi/parser.go @@ -82,13 +82,6 @@ func (p *Parser) clear() { p.Cmd = 0 } -// clearCmd clears the parser command, params len and data len. -func (p *Parser) clearCmd() { - p.Cmd = 0 - p.ParamsLen = 0 - p.DataLen = 0 -} - // StateName returns the name of the current state. func (p *Parser) StateName() string { return parser.StateNames[p.State] diff --git a/vendor/github.com/charmbracelet/x/ansi/parser_sync.go b/vendor/github.com/charmbracelet/x/ansi/parser_sync.go new file mode 100644 index 0000000000..562e806a3a --- /dev/null +++ b/vendor/github.com/charmbracelet/x/ansi/parser_sync.go @@ -0,0 +1,26 @@ +package ansi + +import ( + "sync" + + "github.com/charmbracelet/x/ansi/parser" +) + +var parserPool = sync.Pool{ + New: func() any { + return NewParser(parser.MaxParamsSize, 1024*4) // 4MB data buffer + }, +} + +// GetParser returns a parser from a sync pool. +func GetParser() *Parser { + return parserPool.Get().(*Parser) +} + +// PutParser returns a parser to a sync pool. The parser is reset +// automatically. +func PutParser(p *Parser) { + p.Reset() + p.DataLen = 0 + parserPool.Put(p) +} diff --git a/vendor/github.com/charmbracelet/x/ansi/screen.go b/vendor/github.com/charmbracelet/x/ansi/screen.go index 4909cf07cd..f1fd30c47f 100644 --- a/vendor/github.com/charmbracelet/x/ansi/screen.go +++ b/vendor/github.com/charmbracelet/x/ansi/screen.go @@ -22,8 +22,8 @@ func EraseDisplay(n int) string { // EraseDisplay constants. // These are the possible values for the EraseDisplay function. const ( - EraseDisplayRight = "\x1b[0J" - EraseDisplayLeft = "\x1b[1J" + EraseDisplayBelow = "\x1b[0J" + EraseDisplayAbove = "\x1b[1J" EraseEntireDisplay = "\x1b[2J" ) diff --git a/vendor/github.com/charmbracelet/x/ansi/style.go b/vendor/github.com/charmbracelet/x/ansi/style.go index 96e3c532df..5ab3dd473f 100644 --- a/vendor/github.com/charmbracelet/x/ansi/style.go +++ b/vendor/github.com/charmbracelet/x/ansi/style.go @@ -12,10 +12,10 @@ import ( const ResetStyle = "\x1b[m" // Attr is a SGR (Select Graphic Rendition) style attribute. -type Attr = string +type Attr = int // Style represents an ANSI SGR (Select Graphic Rendition) style. -type Style []Attr +type Style []string // String returns the ANSI SGR (Select Graphic Rendition) style sequence for // the given style. @@ -36,186 +36,357 @@ func (s Style) Styled(str string) string { // Reset appends the reset style attribute to the style. func (s Style) Reset() Style { - return append(s, ResetAttr) + return append(s, resetAttr) } // Bold appends the bold style attribute to the style. func (s Style) Bold() Style { - return append(s, BoldAttr) + return append(s, boldAttr) } // Faint appends the faint style attribute to the style. func (s Style) Faint() Style { - return append(s, FaintAttr) + return append(s, faintAttr) } // Italic appends the italic style attribute to the style. func (s Style) Italic() Style { - return append(s, ItalicAttr) + return append(s, italicAttr) } // Underline appends the underline style attribute to the style. func (s Style) Underline() Style { - return append(s, UnderlineAttr) + return append(s, underlineAttr) +} + +// UnderlineStyle appends the underline style attribute to the style. +func (s Style) UnderlineStyle(u UnderlineStyle) Style { + switch u { + case NoUnderlineStyle: + return s.NoUnderline() + case SingleUnderlineStyle: + return s.Underline() + case DoubleUnderlineStyle: + return append(s, doubleUnderlineStyle) + case CurlyUnderlineStyle: + return append(s, curlyUnderlineStyle) + case DottedUnderlineStyle: + return append(s, dottedUnderlineStyle) + case DashedUnderlineStyle: + return append(s, dashedUnderlineStyle) + } + return s } // DoubleUnderline appends the double underline style attribute to the style. +// This is a convenience method for UnderlineStyle(DoubleUnderlineStyle). func (s Style) DoubleUnderline() Style { - return append(s, DoubleUnderlineAttr) + return s.UnderlineStyle(DoubleUnderlineStyle) } // CurlyUnderline appends the curly underline style attribute to the style. +// This is a convenience method for UnderlineStyle(CurlyUnderlineStyle). func (s Style) CurlyUnderline() Style { - return append(s, CurlyUnderlineAttr) + return s.UnderlineStyle(CurlyUnderlineStyle) } // DottedUnderline appends the dotted underline style attribute to the style. +// This is a convenience method for UnderlineStyle(DottedUnderlineStyle). func (s Style) DottedUnderline() Style { - return append(s, DottedUnderlineAttr) + return s.UnderlineStyle(DottedUnderlineStyle) } // DashedUnderline appends the dashed underline style attribute to the style. +// This is a convenience method for UnderlineStyle(DashedUnderlineStyle). func (s Style) DashedUnderline() Style { - return append(s, DashedUnderlineAttr) + return s.UnderlineStyle(DashedUnderlineStyle) } // SlowBlink appends the slow blink style attribute to the style. func (s Style) SlowBlink() Style { - return append(s, SlowBlinkAttr) + return append(s, slowBlinkAttr) } // RapidBlink appends the rapid blink style attribute to the style. func (s Style) RapidBlink() Style { - return append(s, RapidBlinkAttr) + return append(s, rapidBlinkAttr) } // Reverse appends the reverse style attribute to the style. func (s Style) Reverse() Style { - return append(s, ReverseAttr) + return append(s, reverseAttr) } // Conceal appends the conceal style attribute to the style. func (s Style) Conceal() Style { - return append(s, ConcealAttr) + return append(s, concealAttr) } // Strikethrough appends the strikethrough style attribute to the style. func (s Style) Strikethrough() Style { - return append(s, StrikethroughAttr) + return append(s, strikethroughAttr) } // NoBold appends the no bold style attribute to the style. func (s Style) NoBold() Style { - return append(s, NoBoldAttr) + return append(s, noBoldAttr) } // NormalIntensity appends the normal intensity style attribute to the style. func (s Style) NormalIntensity() Style { - return append(s, NormalIntensityAttr) + return append(s, normalIntensityAttr) } // NoItalic appends the no italic style attribute to the style. func (s Style) NoItalic() Style { - return append(s, NoItalicAttr) + return append(s, noItalicAttr) } // NoUnderline appends the no underline style attribute to the style. func (s Style) NoUnderline() Style { - return append(s, NoUnderlineAttr) + return append(s, noUnderlineAttr) } // NoBlink appends the no blink style attribute to the style. func (s Style) NoBlink() Style { - return append(s, NoBlinkAttr) + return append(s, noBlinkAttr) } // NoReverse appends the no reverse style attribute to the style. func (s Style) NoReverse() Style { - return append(s, NoReverseAttr) + return append(s, noReverseAttr) } // NoConceal appends the no conceal style attribute to the style. func (s Style) NoConceal() Style { - return append(s, NoConcealAttr) + return append(s, noConcealAttr) } // NoStrikethrough appends the no strikethrough style attribute to the style. func (s Style) NoStrikethrough() Style { - return append(s, NoStrikethroughAttr) + return append(s, noStrikethroughAttr) } // DefaultForegroundColor appends the default foreground color style attribute to the style. func (s Style) DefaultForegroundColor() Style { - return append(s, DefaultForegroundColorAttr) + return append(s, defaultForegroundColorAttr) } // DefaultBackgroundColor appends the default background color style attribute to the style. func (s Style) DefaultBackgroundColor() Style { - return append(s, DefaultBackgroundColorAttr) + return append(s, defaultBackgroundColorAttr) } // DefaultUnderlineColor appends the default underline color style attribute to the style. func (s Style) DefaultUnderlineColor() Style { - return append(s, DefaultUnderlineColorAttr) + return append(s, defaultUnderlineColorAttr) } // ForegroundColor appends the foreground color style attribute to the style. func (s Style) ForegroundColor(c Color) Style { - return append(s, ForegroundColorAttr(c)) + return append(s, foregroundColorString(c)) } // BackgroundColor appends the background color style attribute to the style. func (s Style) BackgroundColor(c Color) Style { - return append(s, BackgroundColorAttr(c)) + return append(s, backgroundColorString(c)) } // UnderlineColor appends the underline color style attribute to the style. func (s Style) UnderlineColor(c Color) Style { - return append(s, UnderlineColorAttr(c)) + return append(s, underlineColorString(c)) } +// UnderlineStyle represents an ANSI SGR (Select Graphic Rendition) underline +// style. +type UnderlineStyle = int + +const ( + doubleUnderlineStyle = "4:2" + curlyUnderlineStyle = "4:3" + dottedUnderlineStyle = "4:4" + dashedUnderlineStyle = "4:5" +) + +const ( + // NoUnderlineStyle is the default underline style. + NoUnderlineStyle UnderlineStyle = iota + // SingleUnderlineStyle is a single underline style. + SingleUnderlineStyle + // DoubleUnderlineStyle is a double underline style. + DoubleUnderlineStyle + // CurlyUnderlineStyle is a curly underline style. + CurlyUnderlineStyle + // DottedUnderlineStyle is a dotted underline style. + DottedUnderlineStyle + // DashedUnderlineStyle is a dashed underline style. + DashedUnderlineStyle +) + // SGR (Select Graphic Rendition) style attributes. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters const ( - ResetAttr Attr = "0" - BoldAttr Attr = "1" - FaintAttr Attr = "2" - ItalicAttr Attr = "3" - UnderlineAttr Attr = "4" - DoubleUnderlineAttr Attr = "4:2" - CurlyUnderlineAttr Attr = "4:3" - DottedUnderlineAttr Attr = "4:4" - DashedUnderlineAttr Attr = "4:5" - SlowBlinkAttr Attr = "5" - RapidBlinkAttr Attr = "6" - ReverseAttr Attr = "7" - ConcealAttr Attr = "8" - StrikethroughAttr Attr = "9" - NoBoldAttr Attr = "21" // Some terminals treat this as double underline. - NormalIntensityAttr Attr = "22" - NoItalicAttr Attr = "23" - NoUnderlineAttr Attr = "24" - NoBlinkAttr Attr = "25" - NoReverseAttr Attr = "27" - NoConcealAttr Attr = "28" - NoStrikethroughAttr Attr = "29" - DefaultForegroundColorAttr Attr = "39" - DefaultBackgroundColorAttr Attr = "49" - DefaultUnderlineColorAttr Attr = "59" + ResetAttr Attr = 0 + BoldAttr Attr = 1 + FaintAttr Attr = 2 + ItalicAttr Attr = 3 + UnderlineAttr Attr = 4 + SlowBlinkAttr Attr = 5 + RapidBlinkAttr Attr = 6 + ReverseAttr Attr = 7 + ConcealAttr Attr = 8 + StrikethroughAttr Attr = 9 + NoBoldAttr Attr = 21 // Some terminals treat this as double underline. + NormalIntensityAttr Attr = 22 + NoItalicAttr Attr = 23 + NoUnderlineAttr Attr = 24 + NoBlinkAttr Attr = 25 + NoReverseAttr Attr = 27 + NoConcealAttr Attr = 28 + NoStrikethroughAttr Attr = 29 + BlackForegroundColorAttr Attr = 30 + RedForegroundColorAttr Attr = 31 + GreenForegroundColorAttr Attr = 32 + YellowForegroundColorAttr Attr = 33 + BlueForegroundColorAttr Attr = 34 + MagentaForegroundColorAttr Attr = 35 + CyanForegroundColorAttr Attr = 36 + WhiteForegroundColorAttr Attr = 37 + ExtendedForegroundColorAttr Attr = 38 + DefaultForegroundColorAttr Attr = 39 + BlackBackgroundColorAttr Attr = 40 + RedBackgroundColorAttr Attr = 41 + GreenBackgroundColorAttr Attr = 42 + YellowBackgroundColorAttr Attr = 43 + BlueBackgroundColorAttr Attr = 44 + MagentaBackgroundColorAttr Attr = 45 + CyanBackgroundColorAttr Attr = 46 + WhiteBackgroundColorAttr Attr = 47 + ExtendedBackgroundColorAttr Attr = 48 + DefaultBackgroundColorAttr Attr = 49 + ExtendedUnderlineColorAttr Attr = 58 + DefaultUnderlineColorAttr Attr = 59 + BrightBlackForegroundColorAttr Attr = 90 + BrightRedForegroundColorAttr Attr = 91 + BrightGreenForegroundColorAttr Attr = 92 + BrightYellowForegroundColorAttr Attr = 93 + BrightBlueForegroundColorAttr Attr = 94 + BrightMagentaForegroundColorAttr Attr = 95 + BrightCyanForegroundColorAttr Attr = 96 + BrightWhiteForegroundColorAttr Attr = 97 + BrightBlackBackgroundColorAttr Attr = 100 + BrightRedBackgroundColorAttr Attr = 101 + BrightGreenBackgroundColorAttr Attr = 102 + BrightYellowBackgroundColorAttr Attr = 103 + BrightBlueBackgroundColorAttr Attr = 104 + BrightMagentaBackgroundColorAttr Attr = 105 + BrightCyanBackgroundColorAttr Attr = 106 + BrightWhiteBackgroundColorAttr Attr = 107 + + RGBColorIntroducerAttr Attr = 2 + ExtendedColorIntroducerAttr Attr = 5 ) -// ForegroundColorAttr returns the style SGR attribute for the given foreground -// color. +const ( + resetAttr = "0" + boldAttr = "1" + faintAttr = "2" + italicAttr = "3" + underlineAttr = "4" + slowBlinkAttr = "5" + rapidBlinkAttr = "6" + reverseAttr = "7" + concealAttr = "8" + strikethroughAttr = "9" + noBoldAttr = "21" + normalIntensityAttr = "22" + noItalicAttr = "23" + noUnderlineAttr = "24" + noBlinkAttr = "25" + noReverseAttr = "27" + noConcealAttr = "28" + noStrikethroughAttr = "29" + blackForegroundColorAttr = "30" + redForegroundColorAttr = "31" + greenForegroundColorAttr = "32" + yellowForegroundColorAttr = "33" + blueForegroundColorAttr = "34" + magentaForegroundColorAttr = "35" + cyanForegroundColorAttr = "36" + whiteForegroundColorAttr = "37" + extendedForegroundColorAttr = "38" + defaultForegroundColorAttr = "39" + blackBackgroundColorAttr = "40" + redBackgroundColorAttr = "41" + greenBackgroundColorAttr = "42" + yellowBackgroundColorAttr = "43" + blueBackgroundColorAttr = "44" + magentaBackgroundColorAttr = "45" + cyanBackgroundColorAttr = "46" + whiteBackgroundColorAttr = "47" + extendedBackgroundColorAttr = "48" + defaultBackgroundColorAttr = "49" + extendedUnderlineColorAttr = "58" + defaultUnderlineColorAttr = "59" + brightBlackForegroundColorAttr = "90" + brightRedForegroundColorAttr = "91" + brightGreenForegroundColorAttr = "92" + brightYellowForegroundColorAttr = "93" + brightBlueForegroundColorAttr = "94" + brightMagentaForegroundColorAttr = "95" + brightCyanForegroundColorAttr = "96" + brightWhiteForegroundColorAttr = "97" + brightBlackBackgroundColorAttr = "100" + brightRedBackgroundColorAttr = "101" + brightGreenBackgroundColorAttr = "102" + brightYellowBackgroundColorAttr = "103" + brightBlueBackgroundColorAttr = "104" + brightMagentaBackgroundColorAttr = "105" + brightCyanBackgroundColorAttr = "106" + brightWhiteBackgroundColorAttr = "107" +) + +// foregroundColorString returns the style SGR attribute for the given +// foreground color. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters -func ForegroundColorAttr(c Color) Attr { +func foregroundColorString(c Color) string { switch c := c.(type) { case BasicColor: // 3-bit or 4-bit ANSI foreground // "3" or "9" where n is the color number from 0 to 7 - if c < 8 { - return "3" + string('0'+c) - } else if c < 16 { - return "9" + string('0'+c-8) + switch c { + case Black: + return blackForegroundColorAttr + case Red: + return redForegroundColorAttr + case Green: + return greenForegroundColorAttr + case Yellow: + return yellowForegroundColorAttr + case Blue: + return blueForegroundColorAttr + case Magenta: + return magentaForegroundColorAttr + case Cyan: + return cyanForegroundColorAttr + case White: + return whiteForegroundColorAttr + case BrightBlack: + return brightBlackForegroundColorAttr + case BrightRed: + return brightRedForegroundColorAttr + case BrightGreen: + return brightGreenForegroundColorAttr + case BrightYellow: + return brightYellowForegroundColorAttr + case BrightBlue: + return brightBlueForegroundColorAttr + case BrightMagenta: + return brightMagentaForegroundColorAttr + case BrightCyan: + return brightCyanForegroundColorAttr + case BrightWhite: + return brightWhiteForegroundColorAttr } case ExtendedColor: // 256-color ANSI foreground @@ -230,21 +401,50 @@ func ForegroundColorAttr(c Color) Attr { strconv.FormatUint(uint64(shift(g)), 10) + ";" + strconv.FormatUint(uint64(shift(b)), 10) } - return DefaultForegroundColorAttr + return defaultForegroundColorAttr } -// BackgroundColorAttr returns the style SGR attribute for the given background -// color. +// backgroundColorString returns the style SGR attribute for the given +// background color. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters -func BackgroundColorAttr(c Color) Attr { +func backgroundColorString(c Color) string { switch c := c.(type) { case BasicColor: // 3-bit or 4-bit ANSI foreground // "4" or "10" where n is the color number from 0 to 7 - if c < 8 { - return "4" + string('0'+c) - } else { - return "10" + string('0'+c-8) + switch c { + case Black: + return blackBackgroundColorAttr + case Red: + return redBackgroundColorAttr + case Green: + return greenBackgroundColorAttr + case Yellow: + return yellowBackgroundColorAttr + case Blue: + return blueBackgroundColorAttr + case Magenta: + return magentaBackgroundColorAttr + case Cyan: + return cyanBackgroundColorAttr + case White: + return whiteBackgroundColorAttr + case BrightBlack: + return brightBlackBackgroundColorAttr + case BrightRed: + return brightRedBackgroundColorAttr + case BrightGreen: + return brightGreenBackgroundColorAttr + case BrightYellow: + return brightYellowBackgroundColorAttr + case BrightBlue: + return brightBlueBackgroundColorAttr + case BrightMagenta: + return brightMagentaBackgroundColorAttr + case BrightCyan: + return brightCyanBackgroundColorAttr + case BrightWhite: + return brightWhiteBackgroundColorAttr } case ExtendedColor: // 256-color ANSI foreground @@ -259,13 +459,13 @@ func BackgroundColorAttr(c Color) Attr { strconv.FormatUint(uint64(shift(g)), 10) + ";" + strconv.FormatUint(uint64(shift(b)), 10) } - return DefaultBackgroundColorAttr + return defaultBackgroundColorAttr } -// UnderlineColorAttr returns the style SGR attribute for the given underline +// underlineColorString returns the style SGR attribute for the given underline // color. // See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters -func UnderlineColorAttr(c Color) Attr { +func underlineColorString(c Color) string { switch c := c.(type) { // NOTE: we can't use 3-bit and 4-bit ANSI color codes with underline // color, use 256-color instead. @@ -285,7 +485,7 @@ func UnderlineColorAttr(c Color) Attr { strconv.FormatUint(uint64(shift(g)), 10) + ";" + strconv.FormatUint(uint64(shift(b)), 10) } - return DefaultUnderlineColorAttr + return defaultUnderlineColorAttr } func shift(v uint32) uint32 { diff --git a/vendor/github.com/cloudflare/cloudflare-go/CHANGELOG.md b/vendor/github.com/cloudflare/cloudflare-go/CHANGELOG.md index c208e1b2d2..ee95151596 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/CHANGELOG.md +++ b/vendor/github.com/cloudflare/cloudflare-go/CHANGELOG.md @@ -1,4 +1,19 @@ -## 0.104.0 (Unreleased) +## 0.105.0 (Unreleased) + +## 0.104.0 (September 11th, 2024) + +BREAKING CHANGES: + +* dns: removed deprecated `ZoneID` and `ZoneName` fields ([#2986](https://github.com/cloudflare/cloudflare-go/issues/2986)) + +ENHANCEMENTS: + +* bot_management: add ai_bots_protection to public API ([#2974](https://github.com/cloudflare/cloudflare-go/issues/2974)) + +DEPENDENCIES: + +* deps: bumps golang.org/x/net from 0.28.0 to 0.29.0 ([#3030](https://github.com/cloudflare/cloudflare-go/issues/3030)) +* deps: bumps golang.org/x/time from 0.5.0 to 0.6.0 ([#2816](https://github.com/cloudflare/cloudflare-go/issues/2816)) ## 0.103.0 (August 28th, 2024) diff --git a/vendor/github.com/cloudflare/cloudflare-go/bot_management.go b/vendor/github.com/cloudflare/cloudflare-go/bot_management.go index f77968f459..51205a6aea 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/bot_management.go +++ b/vendor/github.com/cloudflare/cloudflare-go/bot_management.go @@ -20,6 +20,7 @@ type BotManagement struct { SuppressSessionScore *bool `json:"suppress_session_score,omitempty"` AutoUpdateModel *bool `json:"auto_update_model,omitempty"` UsingLatestModel *bool `json:"using_latest_model,omitempty"` + AIBotsProtection *string `json:"ai_bots_protection,omitempty"` } // BotManagementResponse represents the response from the bot_management endpoint. @@ -38,6 +39,7 @@ type UpdateBotManagementParams struct { OptimizeWordpress *bool `json:"optimize_wordpress,omitempty"` SuppressSessionScore *bool `json:"suppress_session_score,omitempty"` AutoUpdateModel *bool `json:"auto_update_model,omitempty"` + AIBotsProtection *string `json:"ai_bots_protection,omitempty"` } // GetBotManagement gets a zone API shield configuration. diff --git a/vendor/github.com/cloudflare/cloudflare-go/dns.go b/vendor/github.com/cloudflare/cloudflare-go/dns.go index 14dbe2d4b3..0c36efd429 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/dns.go +++ b/vendor/github.com/cloudflare/cloudflare-go/dns.go @@ -27,8 +27,6 @@ type DNSRecord struct { Meta interface{} `json:"meta,omitempty"` Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC ID string `json:"id,omitempty"` - ZoneID string `json:"zone_id,omitempty"` - ZoneName string `json:"zone_name,omitempty"` Priority *uint16 `json:"priority,omitempty"` TTL int `json:"ttl,omitempty"` Proxied *bool `json:"proxied,omitempty"` @@ -185,8 +183,6 @@ type CreateDNSRecordParams struct { Meta interface{} `json:"meta,omitempty"` Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC ID string `json:"id,omitempty"` - ZoneID string `json:"zone_id,omitempty"` - ZoneName string `json:"zone_name,omitempty"` Priority *uint16 `json:"priority,omitempty"` TTL int `json:"ttl,omitempty"` Proxied *bool `json:"proxied,omitempty" url:"proxied,omitempty"` diff --git a/vendor/github.com/cloudflare/cloudflare-go/zone.go b/vendor/github.com/cloudflare/cloudflare-go/zone.go index de92880a15..714c0edc8b 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/zone.go +++ b/vendor/github.com/cloudflare/cloudflare-go/zone.go @@ -146,11 +146,12 @@ type ZoneRatePlanResponse struct { // ZoneSetting contains settings for a zone. type ZoneSetting struct { - ID string `json:"id"` - Editable bool `json:"editable"` - ModifiedOn string `json:"modified_on,omitempty"` - Value interface{} `json:"value"` - TimeRemaining int `json:"time_remaining"` + ID string `json:"id"` + Editable bool `json:"editable"` + ModifiedOn string `json:"modified_on,omitempty"` + Value interface{} `json:"value"` + TimeRemaining int `json:"time_remaining"` + NextScheduledScan string `json:"next_scheduled_scan,omitempty"` } // ZoneSettingResponse represents the response from the Zone Setting endpoint. @@ -175,7 +176,6 @@ type ZoneSSLSetting struct { } // ZoneSSLSettingResponse represents the response from the Zone SSL Setting -// endpoint. type ZoneSSLSettingResponse struct { Response Result ZoneSSLSetting `json:"result"` diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/debug.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/debug.go new file mode 100644 index 0000000000..0ec4b12c75 --- /dev/null +++ b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/debug.go @@ -0,0 +1,62 @@ +package md2man + +import ( + "fmt" + "io" + "os" + "strings" + + "github.com/russross/blackfriday/v2" +) + +func fmtListFlags(flags blackfriday.ListType) string { + knownFlags := []struct { + name string + flag blackfriday.ListType + }{ + {"ListTypeOrdered", blackfriday.ListTypeOrdered}, + {"ListTypeDefinition", blackfriday.ListTypeDefinition}, + {"ListTypeTerm", blackfriday.ListTypeTerm}, + {"ListItemContainsBlock", blackfriday.ListItemContainsBlock}, + {"ListItemBeginningOfList", blackfriday.ListItemBeginningOfList}, + {"ListItemEndOfList", blackfriday.ListItemEndOfList}, + } + + var f []string + for _, kf := range knownFlags { + if flags&kf.flag != 0 { + f = append(f, kf.name) + flags &^= kf.flag + } + } + if flags != 0 { + f = append(f, fmt.Sprintf("Unknown(%#x)", flags)) + } + return strings.Join(f, "|") +} + +type debugDecorator struct { + blackfriday.Renderer +} + +func depth(node *blackfriday.Node) int { + d := 0 + for n := node.Parent; n != nil; n = n.Parent { + d++ + } + return d +} + +func (d *debugDecorator) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus { + fmt.Fprintf(os.Stderr, "%s%s %v %v\n", + strings.Repeat(" ", depth(node)), + map[bool]string{true: "+", false: "-"}[entering], + node, + fmtListFlags(node.ListFlags)) + var b strings.Builder + status := d.Renderer.RenderNode(io.MultiWriter(&b, w), node, entering) + if b.Len() > 0 { + fmt.Fprintf(os.Stderr, ">> %q\n", b.String()) + } + return status +} diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go index 42bf32aab0..62d91b77d5 100644 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go +++ b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go @@ -1,16 +1,23 @@ package md2man import ( + "os" + "strconv" + "github.com/russross/blackfriday/v2" ) // Render converts a markdown document into a roff formatted document. func Render(doc []byte) []byte { renderer := NewRoffRenderer() + var r blackfriday.Renderer = renderer + if v, _ := strconv.ParseBool(os.Getenv("MD2MAN_DEBUG")); v { + r = &debugDecorator{Renderer: r} + } return blackfriday.Run(doc, []blackfriday.Option{ - blackfriday.WithRenderer(renderer), + blackfriday.WithRenderer(r), blackfriday.WithExtensions(renderer.GetExtensions()), }...) } diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go index 8a290f1972..9d6c473fdc 100644 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go @@ -14,10 +14,8 @@ import ( // roffRenderer implements the blackfriday.Renderer interface for creating // roff format (manpages) from markdown text type roffRenderer struct { - extensions blackfriday.Extensions listCounters []int firstHeader bool - firstDD bool listDepth int } @@ -43,7 +41,7 @@ const ( quoteTag = "\n.PP\n.RS\n" quoteCloseTag = "\n.RE\n" listTag = "\n.RS\n" - listCloseTag = "\n.RE\n" + listCloseTag = ".RE\n" dtTag = "\n.TP\n" dd2Tag = "\n" tableStart = "\n.TS\nallbox;\n" @@ -56,23 +54,18 @@ const ( // NewRoffRenderer creates a new blackfriday Renderer for generating roff documents // from markdown func NewRoffRenderer() *roffRenderer { // nolint: golint - var extensions blackfriday.Extensions - - extensions |= blackfriday.NoIntraEmphasis - extensions |= blackfriday.Tables - extensions |= blackfriday.FencedCode - extensions |= blackfriday.SpaceHeadings - extensions |= blackfriday.Footnotes - extensions |= blackfriday.Titleblock - extensions |= blackfriday.DefinitionLists - return &roffRenderer{ - extensions: extensions, - } + return &roffRenderer{} } // GetExtensions returns the list of extensions used by this renderer implementation -func (r *roffRenderer) GetExtensions() blackfriday.Extensions { - return r.extensions +func (*roffRenderer) GetExtensions() blackfriday.Extensions { + return blackfriday.NoIntraEmphasis | + blackfriday.Tables | + blackfriday.FencedCode | + blackfriday.SpaceHeadings | + blackfriday.Footnotes | + blackfriday.Titleblock | + blackfriday.DefinitionLists } // RenderHeader handles outputting the header at document start @@ -103,7 +96,23 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering switch node.Type { case blackfriday.Text: - escapeSpecialChars(w, node.Literal) + // Special case: format the NAME section as required for proper whatis parsing. + // Refer to the lexgrog(1) and groff_man(7) manual pages for details. + if node.Parent != nil && + node.Parent.Type == blackfriday.Paragraph && + node.Parent.Prev != nil && + node.Parent.Prev.Type == blackfriday.Heading && + node.Parent.Prev.FirstChild != nil && + bytes.EqualFold(node.Parent.Prev.FirstChild.Literal, []byte("NAME")) { + before, after, found := bytes.Cut(node.Literal, []byte(" - ")) + escapeSpecialChars(w, before) + if found { + out(w, ` \- `) + escapeSpecialChars(w, after) + } + } else { + escapeSpecialChars(w, node.Literal) + } case blackfriday.Softbreak: out(w, crTag) case blackfriday.Hardbreak: @@ -141,14 +150,25 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering case blackfriday.Document: break case blackfriday.Paragraph: - // roff .PP markers break lists - if r.listDepth > 0 { - return blackfriday.GoToNext - } if entering { - out(w, paraTag) + if r.listDepth > 0 { + // roff .PP markers break lists + if node.Prev != nil { // continued paragraph + if node.Prev.Type == blackfriday.List && node.Prev.ListFlags&blackfriday.ListTypeDefinition == 0 { + out(w, ".IP\n") + } else { + out(w, crTag) + } + } + } else if node.Prev != nil && node.Prev.Type == blackfriday.Heading { + out(w, crTag) + } else { + out(w, paraTag) + } } else { - out(w, crTag) + if node.Next == nil || node.Next.Type != blackfriday.List { + out(w, crTag) + } } case blackfriday.BlockQuote: if entering { @@ -211,6 +231,10 @@ func (r *roffRenderer) handleHeading(w io.Writer, node *blackfriday.Node, enteri func (r *roffRenderer) handleList(w io.Writer, node *blackfriday.Node, entering bool) { openTag := listTag closeTag := listCloseTag + if (entering && r.listDepth == 0) || (!entering && r.listDepth == 1) { + openTag = crTag + closeTag = "" + } if node.ListFlags&blackfriday.ListTypeDefinition != 0 { // tags for definition lists handled within Item node openTag = "" @@ -239,23 +263,25 @@ func (r *roffRenderer) handleItem(w io.Writer, node *blackfriday.Node, entering } else if node.ListFlags&blackfriday.ListTypeTerm != 0 { // DT (definition term): line just before DD (see below). out(w, dtTag) - r.firstDD = true } else if node.ListFlags&blackfriday.ListTypeDefinition != 0 { // DD (definition description): line that starts with ": ". // // We have to distinguish between the first DD and the // subsequent ones, as there should be no vertical // whitespace between the DT and the first DD. - if r.firstDD { - r.firstDD = false - } else { - out(w, dd2Tag) + if node.Prev != nil && node.Prev.ListFlags&(blackfriday.ListTypeTerm|blackfriday.ListTypeDefinition) == blackfriday.ListTypeDefinition { + if node.Prev.Type == blackfriday.Item && + node.Prev.LastChild != nil && + node.Prev.LastChild.Type == blackfriday.List && + node.Prev.LastChild.ListFlags&blackfriday.ListTypeDefinition == 0 { + out(w, ".IP\n") + } else { + out(w, dd2Tag) + } } } else { out(w, ".IP \\(bu 2\n") } - } else { - out(w, "\n") } } diff --git a/vendor/github.com/dgraph-io/ristretto/.gitignore b/vendor/github.com/dgraph-io/ristretto/.gitignore new file mode 100644 index 0000000000..64bd913847 --- /dev/null +++ b/vendor/github.com/dgraph-io/ristretto/.gitignore @@ -0,0 +1,3 @@ +# IDE +.idea +.vscode \ No newline at end of file diff --git a/vendor/github.com/dgraph-io/ristretto/cache.go b/vendor/github.com/dgraph-io/ristretto/cache.go index 398ee14135..7a40b0e754 100644 --- a/vendor/github.com/dgraph-io/ristretto/cache.go +++ b/vendor/github.com/dgraph-io/ristretto/cache.go @@ -72,7 +72,7 @@ type Cache[K Key, V any] struct { // stop is used to stop the processItems goroutine. stop chan struct{} // indicates whether cache is closed. - isClosed bool + isClosed atomic.Bool // cost calculates cost from a value. cost func(value V) int64 // ignoreInternalCost dictates whether to ignore the cost of internally storing @@ -221,7 +221,7 @@ func NewCache[K Key, V any](config *Config[K, V]) (*Cache[K, V], error) { // Wait blocks until all buffered writes have been applied. This ensures a call to Set() // will be visible to future calls to Get(). func (c *Cache[K, V]) Wait() { - if c == nil || c.isClosed { + if c == nil || c.isClosed.Load() { return } wg := &sync.WaitGroup{} @@ -234,7 +234,7 @@ func (c *Cache[K, V]) Wait() { // value was found or not. The value can be nil and the boolean can be true at // the same time. Get will not return expired items. func (c *Cache[K, V]) Get(key K) (V, bool) { - if c == nil || c.isClosed { + if c == nil || c.isClosed.Load() { return zeroValue[V](), false } keyHash, conflictHash := c.keyToHash(key) @@ -267,7 +267,7 @@ func (c *Cache[K, V]) Set(key K, value V, cost int64) bool { // expires, which is identical to calling Set. A negative value is a no-op and the value // is discarded. func (c *Cache[K, V]) SetWithTTL(key K, value V, cost int64, ttl time.Duration) bool { - if c == nil || c.isClosed { + if c == nil || c.isClosed.Load() { return false } @@ -316,7 +316,7 @@ func (c *Cache[K, V]) SetWithTTL(key K, value V, cost int64, ttl time.Duration) // Del deletes the key-value item from the cache if it exists. func (c *Cache[K, V]) Del(key K) { - if c == nil || c.isClosed { + if c == nil || c.isClosed.Load() { return } keyHash, conflictHash := c.keyToHash(key) @@ -363,7 +363,7 @@ func (c *Cache[K, V]) GetTTL(key K) (time.Duration, bool) { // Close stops all goroutines and closes all channels. func (c *Cache[K, V]) Close() { - if c == nil || c.isClosed { + if c == nil || c.isClosed.Load() { return } c.Clear() @@ -374,14 +374,14 @@ func (c *Cache[K, V]) Close() { close(c.setBuf) c.cachePolicy.Close() c.cleanupTicker.Stop() - c.isClosed = true + c.isClosed.Store(true) } // Clear empties the hashmap and zeroes all cachePolicy counters. Note that this is // not an atomic operation (but that shouldn't be a problem as it's assumed that // Set/Get calls won't be occurring until after this). func (c *Cache[K, V]) Clear() { - if c == nil || c.isClosed { + if c == nil || c.isClosed.Load() { return } // Block until processItems goroutine is returned. diff --git a/vendor/github.com/dgraph-io/ristretto/store.go b/vendor/github.com/dgraph-io/ristretto/store.go index 3a53d593fc..e2ca800c17 100644 --- a/vendor/github.com/dgraph-io/ristretto/store.go +++ b/vendor/github.com/dgraph-io/ristretto/store.go @@ -111,6 +111,7 @@ func (sm *shardedMap[V]) Clear(onEvict func(item *Item[V])) { for i := uint64(0); i < numShards; i++ { sm.shards[i].Clear(onEvict) } + sm.expiryMap.clear() } type lockedMap[V any] struct { diff --git a/vendor/github.com/dgraph-io/ristretto/ttl.go b/vendor/github.com/dgraph-io/ristretto/ttl.go index b71c1d80d2..08e77c1697 100644 --- a/vendor/github.com/dgraph-io/ristretto/ttl.go +++ b/vendor/github.com/dgraph-io/ristretto/ttl.go @@ -42,12 +42,14 @@ type bucket map[uint64]uint64 // expirationMap is a map of bucket number to the corresponding bucket. type expirationMap[V any] struct { sync.RWMutex - buckets map[int64]bucket + buckets map[int64]bucket + lastCleanedBucketNum int64 } func newExpirationMap[V any]() *expirationMap[V] { return &expirationMap[V]{ - buckets: make(map[int64]bucket), + buckets: make(map[int64]bucket), + lastCleanedBucketNum: cleanupBucket(time.Now()), } } @@ -87,6 +89,11 @@ func (m *expirationMap[_]) update(key, conflict uint64, oldExpTime, newExpTime t delete(oldBucket, key) } + // Items that don't expire don't need to be in the expiration map. + if newExpTime.IsZero() { + return + } + newBucketNum := storageBucket(newExpTime) newBucket, ok := m.buckets[newBucketNum] if !ok { @@ -121,29 +128,50 @@ func (m *expirationMap[V]) cleanup(store store[V], policy policy[V], onEvict fun m.Lock() now := time.Now() - bucketNum := cleanupBucket(now) - keys := m.buckets[bucketNum] - delete(m.buckets, bucketNum) + currentBucketNum := cleanupBucket(now) + // Clean up all buckets up to and including currentBucketNum, starting from + // (but not including) the last one that was cleaned up + var buckets []bucket + for bucketNum := m.lastCleanedBucketNum + 1; bucketNum <= currentBucketNum; bucketNum++ { + buckets = append(buckets, m.buckets[bucketNum]) + delete(m.buckets, bucketNum) + } + m.lastCleanedBucketNum = currentBucketNum m.Unlock() - for key, conflict := range keys { - expr := store.Expiration(key) - // Sanity check. Verify that the store agrees that this key is expired. - if expr.After(now) { - continue + for _, keys := range buckets { + for key, conflict := range keys { + expr := store.Expiration(key) + // Sanity check. Verify that the store agrees that this key is expired. + if expr.After(now) { + continue + } + + cost := policy.Cost(key) + policy.Del(key) + _, value := store.Del(key, conflict) + + if onEvict != nil { + onEvict(&Item[V]{Key: key, + Conflict: conflict, + Value: value, + Cost: cost, + Expiration: expr, + }) + } } + } +} - cost := policy.Cost(key) - policy.Del(key) - _, value := store.Del(key, conflict) - - if onEvict != nil { - onEvict(&Item[V]{Key: key, - Conflict: conflict, - Value: value, - Cost: cost, - Expiration: expr, - }) - } +// clear clears the expirationMap, the caller is responsible for properly +// evicting the referenced items +func (m *expirationMap[V]) clear() { + if m == nil { + return } + + m.Lock() + m.buckets = make(map[int64]bucket) + m.lastCleanedBucketNum = cleanupBucket(time.Now()) + m.Unlock() } diff --git a/vendor/github.com/dgraph-io/ristretto/z/allocator.go b/vendor/github.com/dgraph-io/ristretto/z/allocator.go index eae0f83449..dc272f68fc 100644 --- a/vendor/github.com/dgraph-io/ristretto/z/allocator.go +++ b/vendor/github.com/dgraph-io/ristretto/z/allocator.go @@ -56,9 +56,7 @@ func init() { allocs = make(map[uint64]*Allocator) // Set up a unique Ref per process. - rand.Seed(time.Now().UnixNano()) - allocRef = uint64(rand.Int63n(1<<16)) << 48 //nolint:gosec // cryptographic precision not needed - + allocRef = uint64(rand.Int63n(1<<16)) << 48 calculatedLog2 = make([]int, 1025) for i := 1; i <= 1024; i++ { calculatedLog2[i] = int(math.Log2(float64(i))) diff --git a/vendor/github.com/dgraph-io/ristretto/z/mmap_js.go b/vendor/github.com/dgraph-io/ristretto/z/mmap_js.go new file mode 100644 index 0000000000..d15b562960 --- /dev/null +++ b/vendor/github.com/dgraph-io/ristretto/z/mmap_js.go @@ -0,0 +1,40 @@ +//go:build js + +/* + * Copyright 2023 Dgraph Labs, Inc. and Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package z + +import ( + "os" + "syscall" +) + +func mmap(fd *os.File, writeable bool, size int64) ([]byte, error) { + return nil, syscall.ENOSYS +} + +func munmap(b []byte) error { + return syscall.ENOSYS +} + +func madvise(b []byte, readahead bool) error { + return syscall.ENOSYS +} + +func msync(b []byte) error { + return syscall.ENOSYS +} diff --git a/vendor/github.com/dgraph-io/ristretto/z/mmap_linux.go b/vendor/github.com/dgraph-io/ristretto/z/mmap_linux.go index 331330cff9..1d68f8fe82 100644 --- a/vendor/github.com/dgraph-io/ristretto/z/mmap_linux.go +++ b/vendor/github.com/dgraph-io/ristretto/z/mmap_linux.go @@ -1,3 +1,6 @@ +//go:build !js +// +build !js + /* * Copyright 2020 Dgraph Labs, Inc. and Contributors * diff --git a/vendor/github.com/dgraph-io/ristretto/z/mmap_unix.go b/vendor/github.com/dgraph-io/ristretto/z/mmap_unix.go index 629449f9d3..13f2bb0c60 100644 --- a/vendor/github.com/dgraph-io/ristretto/z/mmap_unix.go +++ b/vendor/github.com/dgraph-io/ristretto/z/mmap_unix.go @@ -1,5 +1,5 @@ -//go:build !windows && !darwin && !plan9 && !linux && !wasip1 -// +build !windows,!darwin,!plan9,!linux,!wasip1 +//go:build !windows && !darwin && !plan9 && !linux && !wasip1 && !js +// +build !windows,!darwin,!plan9,!linux,!wasip1,!js /* * Copyright 2019 Dgraph Labs, Inc. and Contributors diff --git a/vendor/github.com/dgraph-io/ristretto/z/mremap_nosize.go b/vendor/github.com/dgraph-io/ristretto/z/mremap_nosize.go index d31009a8b8..c052bebba8 100644 --- a/vendor/github.com/dgraph-io/ristretto/z/mremap_nosize.go +++ b/vendor/github.com/dgraph-io/ristretto/z/mremap_nosize.go @@ -1,6 +1,7 @@ -//go:build (arm64 || arm) && linux +//go:build (arm64 || arm) && linux && !js // +build arm64 arm // +build linux +// +build !js /* * Copyright 2020 Dgraph Labs, Inc. and Contributors diff --git a/vendor/github.com/dgraph-io/ristretto/z/mremap_size.go b/vendor/github.com/dgraph-io/ristretto/z/mremap_size.go index 35ff3ef177..958587d73f 100644 --- a/vendor/github.com/dgraph-io/ristretto/z/mremap_size.go +++ b/vendor/github.com/dgraph-io/ristretto/z/mremap_size.go @@ -1,5 +1,5 @@ -//go:build linux && !arm64 && !arm -// +build linux,!arm64,!arm +//go:build linux && !arm64 && !arm && !js +// +build linux,!arm64,!arm,!js /* * Copyright 2020 Dgraph Labs, Inc. and Contributors diff --git a/vendor/github.com/dop251/goja/parser/regexp.go b/vendor/github.com/dop251/goja/parser/regexp.go index 0ea9b9d745..f455d0da29 100644 --- a/vendor/github.com/dop251/goja/parser/regexp.go +++ b/vendor/github.com/dop251/goja/parser/regexp.go @@ -194,6 +194,10 @@ func (self *_RegExp_parser) scanGroup() { case '[': self.scanBracket() case '.': + if self.dotAll { + self.pass() + break + } self.writeString(Re2Dot) self.read() default: diff --git a/vendor/github.com/getsentry/sentry-go/CHANGELOG.md b/vendor/github.com/getsentry/sentry-go/CHANGELOG.md index 046f49c466..dce9a3ff97 100644 --- a/vendor/github.com/getsentry/sentry-go/CHANGELOG.md +++ b/vendor/github.com/getsentry/sentry-go/CHANGELOG.md @@ -1,5 +1,47 @@ # Changelog +## 0.29.0 + +The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.29.0. + +### Breaking Changes + +- Remove the `sentrymartini` integration ([#861](https://github.com/getsentry/sentry-go/pull/861)) +- The `WrapResponseWriter` has been moved from the `sentryhttp` package to the `internal/httputils` package. If you've imported it previosuly, you'll need to copy the implementation in your project. ([#871](https://github.com/getsentry/sentry-go/pull/871)) + +### Features + +- Add new convenience methods to continue a trace and propagate tracing headers for error-only use cases. ([#862](https://github.com/getsentry/sentry-go/pull/862)) + + If you are not using one of our integrations, you can manually continue an incoming trace by using `sentry.ContinueTrace()` by providing the `sentry-trace` and `baggage` header received from a downstream SDK. + + ```go + hub := sentry.CurrentHub() + sentry.ContinueTrace(hub, r.Header.Get(sentry.SentryTraceHeader), r.Header.Get(sentry.SentryBaggageHeader)), + ``` + + You can use `hub.GetTraceparent()` and `hub.GetBaggage()` to fetch the necessary header values for outgoing HTTP requests. + + ```go + hub := sentry.GetHubFromContext(ctx) + req, _ := http.NewRequest("GET", "http://localhost:3000", nil) + req.Header.Add(sentry.SentryTraceHeader, hub.GetTraceparent()) + req.Header.Add(sentry.SentryBaggageHeader, hub.GetBaggage()) + ``` + +### Bug Fixes + +- Initialize `HTTPTransport.limit` if `nil` ([#844](https://github.com/getsentry/sentry-go/pull/844)) +- Fix `sentry.StartTransaction()` returning a transaction with an outdated context on existing transactions ([#854](https://github.com/getsentry/sentry-go/pull/854)) +- Treat `Proxy-Authorization` as a sensitive header ([#859](https://github.com/getsentry/sentry-go/pull/859)) +- Add support for the `http.Hijacker` interface to the `sentrynegroni` package ([#871](https://github.com/getsentry/sentry-go/pull/871)) +- Go version >= 1.23: Use value from `http.Request.Pattern` for HTTP transaction names when using `sentryhttp` & `sentrynegroni` ([#875](https://github.com/getsentry/sentry-go/pull/875)) +- Go version >= 1.21: Fix closure functions name grouping ([#877](https://github.com/getsentry/sentry-go/pull/877)) + +### Misc + +- Collect `span` origins ([#849](https://github.com/getsentry/sentry-go/pull/849)) + ## 0.28.1 The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.28.1. diff --git a/vendor/github.com/getsentry/sentry-go/README.md b/vendor/github.com/getsentry/sentry-go/README.md index 73cbdbc637..3b67fb45a5 100644 --- a/vendor/github.com/getsentry/sentry-go/README.md +++ b/vendor/github.com/getsentry/sentry-go/README.md @@ -77,7 +77,6 @@ checkout the official documentation: - [fasthttp](https://docs.sentry.io/platforms/go/guides/fasthttp/) - [gin](https://docs.sentry.io/platforms/go/guides/gin/) - [iris](https://docs.sentry.io/platforms/go/guides/iris/) - - [martini](https://docs.sentry.io/platforms/go/guides/martini/) - [negroni](https://docs.sentry.io/platforms/go/guides/negroni/) ## Resources diff --git a/vendor/github.com/getsentry/sentry-go/client.go b/vendor/github.com/getsentry/sentry-go/client.go index f5069b7167..b5b11b31dc 100644 --- a/vendor/github.com/getsentry/sentry-go/client.go +++ b/vendor/github.com/getsentry/sentry-go/client.go @@ -90,7 +90,7 @@ type EventProcessor func(event *Event, hint *EventHint) *Event // ApplyToEvent changes an event based on external data and/or // an event hint. type EventModifier interface { - ApplyToEvent(event *Event, hint *EventHint) *Event + ApplyToEvent(event *Event, hint *EventHint, client *Client) *Event } var globalEventProcessors []EventProcessor @@ -685,7 +685,7 @@ func (client *Client) prepareEvent(event *Event, hint *EventHint, scope EventMod } if scope != nil { - event = scope.ApplyToEvent(event, hint) + event = scope.ApplyToEvent(event, hint, client) if event == nil { return nil } diff --git a/vendor/github.com/getsentry/sentry-go/dynamic_sampling_context.go b/vendor/github.com/getsentry/sentry-go/dynamic_sampling_context.go index 365072607a..6eec95ba15 100644 --- a/vendor/github.com/getsentry/sentry-go/dynamic_sampling_context.go +++ b/vendor/github.com/getsentry/sentry-go/dynamic_sampling_context.go @@ -39,8 +39,6 @@ func DynamicSamplingContextFromHeader(header []byte) (DynamicSamplingContext, er } func DynamicSamplingContextFromTransaction(span *Span) DynamicSamplingContext { - entries := map[string]string{} - hub := hubFromContext(span.Context()) scope := hub.Scope() client := hub.Client() @@ -52,6 +50,8 @@ func DynamicSamplingContextFromTransaction(span *Span) DynamicSamplingContext { } } + entries := make(map[string]string) + if traceID := span.TraceID.String(); traceID != "" { entries["trace_id"] = traceID } @@ -78,20 +78,9 @@ func DynamicSamplingContextFromTransaction(span *Span) DynamicSamplingContext { } } - if userSegment := scope.user.Segment; userSegment != "" { - entries["user_segment"] = userSegment - } - - if span.Sampled.Bool() { - entries["sampled"] = "true" - } else { - entries["sampled"] = "false" - } + entries["sampled"] = strconv.FormatBool(span.Sampled.Bool()) - return DynamicSamplingContext{ - Entries: entries, - Frozen: true, - } + return DynamicSamplingContext{Entries: entries, Frozen: true} } func (d DynamicSamplingContext) HasEntries() bool { @@ -121,3 +110,43 @@ func (d DynamicSamplingContext) String() string { return "" } + +// Constructs a new DynamicSamplingContext using a scope and client. Accessing +// fields on the scope are not thread safe, and this function should only be +// called within scope methods. +func DynamicSamplingContextFromScope(scope *Scope, client *Client) DynamicSamplingContext { + entries := map[string]string{} + + if client == nil || scope == nil { + return DynamicSamplingContext{ + Entries: entries, + Frozen: false, + } + } + + propagationContext := scope.propagationContext + + if traceID := propagationContext.TraceID.String(); traceID != "" { + entries["trace_id"] = traceID + } + if sampleRate := client.options.TracesSampleRate; sampleRate != 0 { + entries["sample_rate"] = strconv.FormatFloat(sampleRate, 'f', -1, 64) + } + + if dsn := client.dsn; dsn != nil { + if publicKey := dsn.publicKey; publicKey != "" { + entries["public_key"] = publicKey + } + } + if release := client.options.Release; release != "" { + entries["release"] = release + } + if environment := client.options.Environment; environment != "" { + entries["environment"] = environment + } + + return DynamicSamplingContext{ + Entries: entries, + Frozen: true, + } +} diff --git a/vendor/github.com/getsentry/sentry-go/hub.go b/vendor/github.com/getsentry/sentry-go/hub.go index 6af1d5afa2..c99b6d70d1 100644 --- a/vendor/github.com/getsentry/sentry-go/hub.go +++ b/vendor/github.com/getsentry/sentry-go/hub.go @@ -2,6 +2,7 @@ package sentry import ( "context" + "fmt" "sync" "time" ) @@ -365,6 +366,34 @@ func (hub *Hub) Flush(timeout time.Duration) bool { return client.Flush(timeout) } +// GetTraceparent returns the current Sentry traceparent string, to be used as a HTTP header value +// or HTML meta tag value. +// This function is context aware, as in it either returns the traceparent based +// on the current span, or the scope's propagation context. +func (hub *Hub) GetTraceparent() string { + scope := hub.Scope() + + if scope.span != nil { + return scope.span.ToSentryTrace() + } + + return fmt.Sprintf("%s-%s", scope.propagationContext.TraceID, scope.propagationContext.SpanID) +} + +// GetBaggage returns the current Sentry baggage string, to be used as a HTTP header value +// or HTML meta tag value. +// This function is context aware, as in it either returns the baggage based +// on the current span or the scope's propagation context. +func (hub *Hub) GetBaggage() string { + scope := hub.Scope() + + if scope.span != nil { + return scope.span.ToBaggage() + } + + return scope.propagationContext.DynamicSamplingContext.String() +} + // HasHubOnContext checks whether Hub instance is bound to a given Context struct. func HasHubOnContext(ctx context.Context) bool { _, ok := ctx.Value(HubContextKey).(*Hub) diff --git a/vendor/github.com/getsentry/sentry-go/interfaces.go b/vendor/github.com/getsentry/sentry-go/interfaces.go index 35686a02c9..cacb254368 100644 --- a/vendor/github.com/getsentry/sentry-go/interfaces.go +++ b/vendor/github.com/getsentry/sentry-go/interfaces.go @@ -166,10 +166,11 @@ type Request struct { } var sensitiveHeaders = map[string]struct{}{ - "Authorization": {}, - "Cookie": {}, - "X-Forwarded-For": {}, - "X-Real-Ip": {}, + "Authorization": {}, + "Proxy-Authorization": {}, + "Cookie": {}, + "X-Forwarded-For": {}, + "X-Real-Ip": {}, } // NewRequest returns a new Sentry Request from the given http.Request. diff --git a/vendor/github.com/getsentry/sentry-go/propagation_context.go b/vendor/github.com/getsentry/sentry-go/propagation_context.go new file mode 100644 index 0000000000..7a0766a8ad --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/propagation_context.go @@ -0,0 +1,90 @@ +package sentry + +import ( + "crypto/rand" + "encoding/json" +) + +type PropagationContext struct { + TraceID TraceID `json:"trace_id"` + SpanID SpanID `json:"span_id"` + ParentSpanID SpanID `json:"parent_span_id"` + DynamicSamplingContext DynamicSamplingContext `json:"-"` +} + +func (p PropagationContext) MarshalJSON() ([]byte, error) { + type propagationContext PropagationContext + var parentSpanID string + if p.ParentSpanID != zeroSpanID { + parentSpanID = p.ParentSpanID.String() + } + return json.Marshal(struct { + *propagationContext + ParentSpanID string `json:"parent_span_id,omitempty"` + }{ + propagationContext: (*propagationContext)(&p), + ParentSpanID: parentSpanID, + }) +} + +func (p PropagationContext) Map() map[string]interface{} { + m := map[string]interface{}{ + "trace_id": p.TraceID, + "span_id": p.SpanID, + } + + if p.ParentSpanID != zeroSpanID { + m["parent_span_id"] = p.ParentSpanID + } + + return m +} + +func NewPropagationContext() PropagationContext { + p := PropagationContext{} + + if _, err := rand.Read(p.TraceID[:]); err != nil { + panic(err) + } + + if _, err := rand.Read(p.SpanID[:]); err != nil { + panic(err) + } + + return p +} + +func PropagationContextFromHeaders(trace, baggage string) (PropagationContext, error) { + p := NewPropagationContext() + + if _, err := rand.Read(p.SpanID[:]); err != nil { + panic(err) + } + + hasTrace := false + if trace != "" { + if tpc, valid := ParseTraceParentContext([]byte(trace)); valid { + hasTrace = true + p.TraceID = tpc.TraceID + p.ParentSpanID = tpc.ParentSpanID + } + } + + if baggage != "" { + dsc, err := DynamicSamplingContextFromHeader([]byte(baggage)) + if err != nil { + return PropagationContext{}, err + } + p.DynamicSamplingContext = dsc + } + + // In case a sentry-trace header is present but there are no sentry-related + // values in the baggage, create an empty, frozen DynamicSamplingContext. + if hasTrace && !p.DynamicSamplingContext.HasEntries() { + p.DynamicSamplingContext = DynamicSamplingContext{ + Frozen: true, + } + } + + return p, nil +} diff --git a/vendor/github.com/getsentry/sentry-go/scope.go b/vendor/github.com/getsentry/sentry-go/scope.go index 374010b67e..48621c94fc 100644 --- a/vendor/github.com/getsentry/sentry-go/scope.go +++ b/vendor/github.com/getsentry/sentry-go/scope.go @@ -43,20 +43,22 @@ type Scope struct { Overflow() bool } eventProcessors []EventProcessor + + propagationContext PropagationContext + span *Span } // NewScope creates a new Scope. func NewScope() *Scope { - scope := Scope{ - breadcrumbs: make([]*Breadcrumb, 0), - attachments: make([]*Attachment, 0), - tags: make(map[string]string), - contexts: make(map[string]Context), - extra: make(map[string]interface{}), - fingerprint: make([]string, 0), + return &Scope{ + breadcrumbs: make([]*Breadcrumb, 0), + attachments: make([]*Attachment, 0), + tags: make(map[string]string), + contexts: make(map[string]Context), + extra: make(map[string]interface{}), + fingerprint: make([]string, 0), + propagationContext: NewPropagationContext(), } - - return &scope } // AddBreadcrumb adds new breadcrumb to the current scope @@ -292,6 +294,22 @@ func (scope *Scope) SetLevel(level Level) { scope.level = level } +// SetPropagationContext sets the propagation context for the current scope. +func (scope *Scope) SetPropagationContext(propagationContext PropagationContext) { + scope.mu.Lock() + defer scope.mu.Unlock() + + scope.propagationContext = propagationContext +} + +// SetSpan sets a span for the current scope. +func (scope *Scope) SetSpan(span *Span) { + scope.mu.Lock() + defer scope.mu.Unlock() + + scope.span = span +} + // Clone returns a copy of the current scope with all data copied over. func (scope *Scope) Clone() *Scope { scope.mu.RLock() @@ -318,6 +336,8 @@ func (scope *Scope) Clone() *Scope { clone.request = scope.request clone.requestBody = scope.requestBody clone.eventProcessors = scope.eventProcessors + clone.propagationContext = scope.propagationContext + clone.span = scope.span return clone } @@ -335,7 +355,7 @@ func (scope *Scope) AddEventProcessor(processor EventProcessor) { } // ApplyToEvent takes the data from the current scope and attaches it to the event. -func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event { +func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint, client *Client) *Event { scope.mu.RLock() defer scope.mu.RUnlock() @@ -363,15 +383,6 @@ func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event { } for key, value := range scope.contexts { - if key == "trace" && event.Type == transactionType { - // Do not override trace context of - // transactions, otherwise it breaks the - // transaction event representation. - // For error events, the trace context is used - // to link errors and traces/spans in Sentry. - continue - } - // Ensure we are not overwriting event fields if _, ok := event.Contexts[key]; !ok { event.Contexts[key] = cloneContext(value) @@ -379,6 +390,27 @@ func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event { } } + if event.Contexts == nil { + event.Contexts = make(map[string]Context) + } + + if scope.span != nil { + event.Contexts["trace"] = scope.span.traceContext().Map() + + transaction := scope.span.GetTransaction() + if transaction != nil { + event.sdkMetaData.dsc = DynamicSamplingContextFromTransaction(transaction) + } + } else { + event.Contexts["trace"] = scope.propagationContext.Map() + + dsc := scope.propagationContext.DynamicSamplingContext + if !dsc.HasEntries() && client != nil { + dsc = DynamicSamplingContextFromScope(scope, client) + } + event.sdkMetaData.dsc = dsc + } + if len(scope.extra) > 0 { if event.Extra == nil { event.Extra = make(map[string]interface{}, len(scope.extra)) diff --git a/vendor/github.com/getsentry/sentry-go/sentry.go b/vendor/github.com/getsentry/sentry-go/sentry.go index c8246de0e1..0fca64e263 100644 --- a/vendor/github.com/getsentry/sentry-go/sentry.go +++ b/vendor/github.com/getsentry/sentry-go/sentry.go @@ -6,7 +6,7 @@ import ( ) // The version of the SDK. -const SDKVersion = "0.28.1" +const SDKVersion = "0.29.0" // apiVersion is the minimum version of the Sentry API compatible with the // sentry-go SDK. diff --git a/vendor/github.com/getsentry/sentry-go/stacktrace.go b/vendor/github.com/getsentry/sentry-go/stacktrace.go index 2f8933ea91..3b372bcff1 100644 --- a/vendor/github.com/getsentry/sentry-go/stacktrace.go +++ b/vendor/github.com/getsentry/sentry-go/stacktrace.go @@ -307,6 +307,9 @@ func createFrames(frames []runtime.Frame) []Frame { } } + // Fix issues grouping errors with the new fully qualified function names + // introduced from Go 1.21 + result = cleanupFunctionNamePrefix(result) return result } diff --git a/vendor/github.com/getsentry/sentry-go/stacktrace_below_go1.21.go b/vendor/github.com/getsentry/sentry-go/stacktrace_below_go1.21.go new file mode 100644 index 0000000000..35a42e4dd0 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/stacktrace_below_go1.21.go @@ -0,0 +1,7 @@ +//go:build !go1.21 + +package sentry + +func cleanupFunctionNamePrefix(f []Frame) []Frame { + return f +} diff --git a/vendor/github.com/getsentry/sentry-go/stacktrace_go1.21.go b/vendor/github.com/getsentry/sentry-go/stacktrace_go1.21.go new file mode 100644 index 0000000000..45147c8505 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/stacktrace_go1.21.go @@ -0,0 +1,25 @@ +//go:build go1.21 + +package sentry + +import "strings" + +// Walk backwards through the results and for the current function name +// remove it's parent function's prefix, leaving only it's actual name. This +// fixes issues grouping errors with the new fully qualified function names +// introduced from Go 1.21. + +func cleanupFunctionNamePrefix(f []Frame) []Frame { + for i := len(f) - 1; i > 0; i-- { + name := f[i].Function + parentName := f[i-1].Function + "." + + if !strings.HasPrefix(name, parentName) { + continue + } + + f[i].Function = name[len(parentName):] + } + + return f +} diff --git a/vendor/github.com/getsentry/sentry-go/tracing.go b/vendor/github.com/getsentry/sentry-go/tracing.go index 1bb53d0de9..0f5ade2e84 100644 --- a/vendor/github.com/getsentry/sentry-go/tracing.go +++ b/vendor/github.com/getsentry/sentry-go/tracing.go @@ -18,6 +18,20 @@ const ( SentryBaggageHeader = "baggage" ) +// SpanOrigin indicates what created a trace or a span. See: https://develop.sentry.dev/sdk/performance/trace-origin/ +type SpanOrigin string + +const ( + SpanOriginManual = "manual" + SpanOriginEcho = "auto.http.echo" + SpanOriginFastHTTP = "auto.http.fasthttp" + SpanOriginFiber = "auto.http.fiber" + SpanOriginGin = "auto.http.gin" + SpanOriginStdLib = "auto.http.stdlib" + SpanOriginIris = "auto.http.iris" + SpanOriginNegroni = "auto.http.negroni" +) + // A Span is the building block of a Sentry transaction. Spans build up a tree // structure of timed operations. The span tree makes up a transaction event // that is sent to Sentry when the root span is finished. @@ -37,6 +51,7 @@ type Span struct { //nolint: maligned // prefer readability over optimal memory Data map[string]interface{} `json:"data,omitempty"` Sampled Sampled `json:"-"` Source TransactionSource `json:"-"` + Origin SpanOrigin `json:"origin,omitempty"` // mu protects concurrent writes to map fields mu sync.RWMutex @@ -113,11 +128,19 @@ func StartSpan(ctx context.Context, operation string, options ...SpanOption) *Sp parent: parent, } + _, err := rand.Read(span.SpanID[:]) + if err != nil { + panic(err) + } + if hasParent { span.TraceID = parent.TraceID + span.ParentSpanID = parent.SpanID + span.Origin = parent.Origin } else { // Only set the Source if this is a transaction span.Source = SourceCustom + span.Origin = SpanOriginManual // Implementation note: // @@ -154,13 +177,6 @@ func StartSpan(ctx context.Context, operation string, options ...SpanOption) *Sp panic(err) } } - _, err := rand.Read(span.SpanID[:]) - if err != nil { - panic(err) - } - if hasParent { - span.ParentSpanID = parent.SpanID - } // Apply options to override defaults. for _, option := range options { @@ -176,11 +192,11 @@ func StartSpan(ctx context.Context, operation string, options ...SpanOption) *Sp span.recorder.record(&span) - hub := hubFromContext(ctx) - - // Update scope so that all events include a trace context, allowing - // Sentry to correlate errors to transactions/spans. - hub.Scope().SetContext("trace", span.traceContext().Map()) + clientOptions := span.clientOptions() + if clientOptions.EnableTracing { + hub := hubFromContext(ctx) + hub.Scope().SetSpan(&span) + } // Start profiling only if it's a sampled root transaction. if span.IsTransaction() && span.Sampled.Bool() { @@ -308,17 +324,21 @@ func (s *Span) ToSentryTrace() string { // Use this function to propagate the DynamicSamplingContext to a downstream SDK, // either as the value of the "baggage" HTTP header, or as an html "baggage" meta tag. func (s *Span) ToBaggage() string { - if containingTransaction := s.GetTransaction(); containingTransaction != nil { - // In case there is currently no frozen DynamicSamplingContext attached to the transaction, - // create one from the properties of the transaction. - if !s.dynamicSamplingContext.IsFrozen() { - // This will return a frozen DynamicSamplingContext. - s.dynamicSamplingContext = DynamicSamplingContextFromTransaction(containingTransaction) - } + t := s.GetTransaction() + if t == nil { + return "" + } - return containingTransaction.dynamicSamplingContext.String() + // In case there is currently no frozen DynamicSamplingContext attached to the transaction, + // create one from the properties of the transaction. + if !s.dynamicSamplingContext.IsFrozen() { + // This will return a frozen DynamicSamplingContext. + if dsc := DynamicSamplingContextFromTransaction(t); dsc.HasEntries() { + t.dynamicSamplingContext = dsc + } } - return "" + + return t.dynamicSamplingContext.String() } // SetDynamicSamplingContext sets the given dynamic sampling context on the @@ -534,11 +554,10 @@ func (s *Span) toEvent() *Event { s.dynamicSamplingContext = DynamicSamplingContextFromTransaction(s) } - contexts := map[string]Context{} + contexts := make(map[string]Context, len(s.contexts)) for k, v := range s.contexts { contexts[k] = cloneContext(v) } - contexts["trace"] = s.traceContext().Map() // Make sure that the transaction source is valid transactionSource := s.Source @@ -870,6 +889,25 @@ func WithSpanSampled(sampled Sampled) SpanOption { } } +// WithSpanOrigin sets the origin of the span. +func WithSpanOrigin(origin SpanOrigin) SpanOption { + return func(s *Span) { + s.Origin = origin + } +} + +// Continue a trace based on traceparent and bagge values. +// If the SDK is configured with tracing enabled, +// this function returns populated SpanOption. +// In any other cases, it populates the propagation context on the scope. +func ContinueTrace(hub *Hub, traceparent, baggage string) SpanOption { + scope := hub.Scope() + propagationContext, _ := PropagationContextFromHeaders(traceparent, baggage) + scope.SetPropagationContext(propagationContext) + + return ContinueFromHeaders(traceparent, baggage) +} + // ContinueFromRequest returns a span option that updates the span to continue // an existing trace. If it cannot detect an existing trace in the request, the // span will be left unchanged. @@ -939,6 +977,7 @@ func SpanFromContext(ctx context.Context) *Span { func StartTransaction(ctx context.Context, name string, options ...SpanOption) *Span { currentTransaction, exists := ctx.Value(spanContextKey{}).(*Span) if exists { + currentTransaction.ctx = ctx return currentTransaction } diff --git a/vendor/github.com/getsentry/sentry-go/transport.go b/vendor/github.com/getsentry/sentry-go/transport.go index 20f69941f5..02fc1d4f18 100644 --- a/vendor/github.com/getsentry/sentry-go/transport.go +++ b/vendor/github.com/getsentry/sentry-go/transport.go @@ -357,7 +357,6 @@ func NewHTTPTransport() *HTTPTransport { transport := HTTPTransport{ BufferSize: defaultBufferSize, Timeout: defaultTimeout, - limits: make(ratelimit.Map), } return &transport } @@ -550,9 +549,14 @@ func (t *HTTPTransport) worker() { } Logger.Printf("Sending %s failed with the following error: %s", eventType, string(b)) } + t.mu.Lock() + if t.limits == nil { + t.limits = make(ratelimit.Map) + } t.limits.Merge(ratelimit.FromResponse(response)) t.mu.Unlock() + // Drain body up to a limit and close it, allowing the // transport to reuse TCP connections. _, _ = io.CopyN(io.Discard, response.Body, maxDrainResponseBytes) @@ -690,6 +694,10 @@ func (t *HTTPSyncTransport) SendEventWithContext(ctx context.Context, event *Eve } t.mu.Lock() + if t.limits == nil { + t.limits = make(ratelimit.Map) + } + t.limits.Merge(ratelimit.FromResponse(response)) t.mu.Unlock() diff --git a/vendor/github.com/go-resty/resty/v2/BUILD.bazel b/vendor/github.com/go-resty/resty/v2/BUILD.bazel index e41515b771..7248abc506 100644 --- a/vendor/github.com/go-resty/resty/v2/BUILD.bazel +++ b/vendor/github.com/go-resty/resty/v2/BUILD.bazel @@ -1,5 +1,5 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") load("@bazel_gazelle//:def.bzl", "gazelle") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") # gazelle:prefix github.com/go-resty/resty/v2 # gazelle:go_naming_convention import_alias @@ -17,17 +17,19 @@ go_library( "resty.go", "retry.go", "trace.go", - "transport_js.go", - "transport_other.go", "transport.go", "transport112.go", + "transport_js.go", + "transport_other.go", "util.go", "util_curl.go", - "shellescape/shellescape.go" ], importpath = "github.com/go-resty/resty/v2", visibility = ["//visibility:public"], - deps = ["@org_golang_x_net//publicsuffix:go_default_library"], + deps = [ + "//shellescape", + "@org_golang_x_net//publicsuffix:go_default_library", + ], ) go_test( @@ -36,6 +38,7 @@ go_test( "client_test.go", "context_test.go", "example_test.go", + "middleware_test.go", "request_test.go", "resty_test.go", "retry_test.go", @@ -43,7 +46,10 @@ go_test( ], data = glob([".testdata/*"]), embed = [":resty"], - deps = ["@org_golang_x_net//proxy:go_default_library"], + deps = [ + "@org_golang_x_net//proxy:go_default_library", + "@org_golang_x_time//rate:go_default_library", + ], ) alias( diff --git a/vendor/github.com/go-resty/resty/v2/README.md b/vendor/github.com/go-resty/resty/v2/README.md index 2d3542b5aa..c02ae0c458 100644 --- a/vendor/github.com/go-resty/resty/v2/README.md +++ b/vendor/github.com/go-resty/resty/v2/README.md @@ -4,16 +4,12 @@

Features section describes in detail about Resty capabilities

-

Build Status Code Coverage Go Report Card Release Version GoDoc License Mentioned in Awesome Go

-

-

-

Resty Communication Channels

-

Chat on Gitter - Resty Community Twitter @go_resty

+

Build Status Code Coverage Go Report Card Release Version GoDoc License Mentioned in Awesome Go

## News - * v2.14.0 [released](https://github.com/go-resty/resty/releases/tag/v2.14.0) and tagged on Aug 04, 2024. + * v2.15.1 [released](https://github.com/go-resty/resty/releases/tag/v2.15.1) and tagged on Sep 18, 2024. * v2.0.0 [released](https://github.com/go-resty/resty/releases/tag/v2.0.0) and tagged on Jul 16, 2019. * v1.12.0 [released](https://github.com/go-resty/resty/releases/tag/v1.12.0) and tagged on Feb 27, 2019. * v1.0 released and tagged on Sep 25, 2017. - Resty's first version was released on Sep 15, 2015 then it grew gradually as a very handy and helpful library. Its been a two years since first release. I'm very thankful to Resty users and its [contributors](https://github.com/go-resty/resty/graphs/contributors). @@ -62,9 +58,10 @@ * goroutine concurrent safe * Resty Client trace, see [Client.EnableTrace](https://pkg.go.dev/github.com/go-resty/resty/v2#Client.EnableTrace) and [Request.EnableTrace](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.EnableTrace) * Since v2.4.0, trace info contains a `RequestAttempt` value, and the `Request` object contains an `Attempt` attribute + * Supports on-demand CURL command generation, see [Client.EnableGenerateCurlOnDebug](https://pkg.go.dev/github.com/go-resty/resty/v2#Client.EnableGenerateCurlOnDebug), [Request.EnableGenerateCurlOnDebug](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.EnableGenerateCurlOnDebug). It requires debug mode to be enabled. * Debug mode - clean and informative logging presentation * Gzip - Go does it automatically also resty has fallback handling too - * Works fine with `HTTP/2` and `HTTP/1.1` + * Works fine with `HTTP/2` and `HTTP/1.1`, also `HTTP/3` can be used with Resty, see this [comment](https://github.com/go-resty/resty/issues/846#issuecomment-2329696110) * [Bazel support](#bazel-support) * Easily mock Resty for testing, [for e.g.](#mocking-http-requests-using-httpmock-library) * Well tested client library @@ -86,7 +83,7 @@ #### Supported Go Versions -Recommended to use `go1.16` and above. +Recommended to use `go1.20` and above. Initially Resty started supporting `go modules` since `v1.10.0` release. @@ -101,8 +98,6 @@ Starting Resty v2 and higher versions, it fully embraces [go modules](https://gi Resty author also published following projects for Go Community. - * [aah framework](https://aahframework.org) - A secure, flexible, rapid Go web framework. - * [THUMBAI](https://thumbai.app) - Go Mod Repository, Go Vanity Service and Simple Proxy Server. * [go-model](https://github.com/jeevatkm/go-model) - Robust & Easy to use model mapper and utility methods for Go `struct`. @@ -110,7 +105,7 @@ Resty author also published following projects for Go Community. ```bash # Go Modules -require github.com/go-resty/resty/v2 v2.11.0 +require github.com/go-resty/resty/v2 v2.15.1 ``` ## Usage @@ -131,11 +126,6 @@ client := resty.New() resp, err := client.R(). EnableTrace(). Get("https://httpbin.org/get") -curlCmdExecuted := resp.Request.GenerateCurlCommand() - - -// Explore curl command -fmt.Println("Curl Command:\n ", curlCmdExecuted+"\n") // Explore response object fmt.Println("Response Info:") @@ -165,9 +155,6 @@ fmt.Println(" RequestAttempt:", ti.RequestAttempt) fmt.Println(" RemoteAddr :", ti.RemoteAddr.String()) /* Output -Curl Command: - curl -X GET -H 'User-Agent: go-resty/2.12.0 (https://github.com/go-resty/resty)' https://httpbin.org/get - Response Info: Error : Status Code: 200 @@ -566,6 +553,30 @@ client.OnError(func(req *resty.Request, err error) { }) ``` +#### Generate CURL Command +>Refer: [curl_cmd_test.go](https://github.com/go-resty/resty/blob/v2/curl_cmd_test.go) + +```go +// Create a Resty Client +client := resty.New() + +resp, err := client.R(). + SetDebug(true). + EnableGenerateCurlOnDebug(). // CURL command generated when debug mode enabled with this option + SetBody(map[string]string{"name": "Alex"}). + Post("https://httpbin.org/post") + +curlCmdExecuted := resp.Request.GenerateCurlCommand() + +// Explore curl command +fmt.Println("Curl Command:\n ", curlCmdExecuted+"\n") + +/* Output +Curl Command: + curl -X POST -H 'Content-Type: application/json' -H 'User-Agent: go-resty/2.14.0 (https://github.com/go-resty/resty)' -d '{"name":"Alex"}' https://httpbin.org/post +*/ +``` + #### Redirect Policy Resty provides few ready to use redirect policy(s) also it supports multiple policies together. diff --git a/vendor/github.com/go-resty/resty/v2/WORKSPACE b/vendor/github.com/go-resty/resty/v2/WORKSPACE index 9ef03e95a4..504de14582 100644 --- a/vendor/github.com/go-resty/resty/v2/WORKSPACE +++ b/vendor/github.com/go-resty/resty/v2/WORKSPACE @@ -4,10 +4,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", - sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b", + sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip", ], ) @@ -24,7 +24,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() -go_register_toolchains(version = "1.16") +go_register_toolchains(version = "1.19") load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") diff --git a/vendor/github.com/go-resty/resty/v2/client.go b/vendor/github.com/go-resty/resty/v2/client.go index aeb550778f..a40bbe4bd4 100644 --- a/vendor/github.com/go-resty/resty/v2/client.go +++ b/vendor/github.com/go-resty/resty/v2/client.go @@ -92,11 +92,11 @@ type ( SuccessHook func(*Client, *Response) ) -// Client struct is used to create Resty client with client level settings, -// these settings are applicable to all the request raised from the client. +// Client struct is used to create a Resty client with client-level settings, +// these settings apply to all the requests raised from the client. // -// Resty also provides an options to override most of the client settings -// at request level. +// Resty also provides an option to override most of the client settings +// at [Request] level. type Client struct { BaseURL string HostURL string // Deprecated: use BaseURL instead. To be removed in v3.0.0 release. @@ -128,6 +128,7 @@ type Client struct { // HeaderAuthorizationKey is used to set/access Request Authorization header // value when `SetAuthToken` option is used. HeaderAuthorizationKey string + ResponseBodyLimit int jsonEscapeHTML bool setContentLength bool @@ -153,6 +154,7 @@ type Client struct { invalidHooks []ErrorHook panicHooks []ErrorHook rateLimiter RateLimiter + generateCurlOnDebug bool } // User type is to hold an username and password information @@ -164,8 +166,8 @@ type User struct { // Client methods //___________________________________ -// SetHostURL method is to set Host URL in the client instance. It will be used with request -// raised from this client with relative URL +// SetHostURL method sets the Host URL in the client instance. It will be used with a request +// raised from this client with a relative URL // // // Setting HTTP address // client.SetHostURL("http://myjeeva.com") @@ -173,22 +175,20 @@ type User struct { // // Setting HTTPS address // client.SetHostURL("https://myjeeva.com") // -// Deprecated: use SetBaseURL instead. To be removed in v3.0.0 release. +// Deprecated: use [Client.SetBaseURL] instead. To be removed in the v3.0.0 release. func (c *Client) SetHostURL(url string) *Client { c.SetBaseURL(url) return c } -// SetBaseURL method is to set Base URL in the client instance. It will be used with request -// raised from this client with relative URL +// SetBaseURL method sets the Base URL in the client instance. It will be used with a request +// raised from this client with a relative URL // // // Setting HTTP address // client.SetBaseURL("http://myjeeva.com") // // // Setting HTTPS address // client.SetBaseURL("https://myjeeva.com") -// -// Since v2.7.0 func (c *Client) SetBaseURL(url string) *Client { c.BaseURL = strings.TrimRight(url, "/") c.HostURL = c.BaseURL @@ -196,10 +196,10 @@ func (c *Client) SetBaseURL(url string) *Client { } // SetHeader method sets a single header field and its value in the client instance. -// These headers will be applied to all requests raised from this client instance. -// Also it can be overridden at request level header options. +// These headers will be applied to all requests from this client instance. +// Also, it can be overridden by request-level header options. // -// See `Request.SetHeader` or `Request.SetHeaders`. +// See [Request.SetHeader] or [Request.SetHeaders]. // // For Example: To set `Content-Type` and `Accept` as `application/json` // @@ -211,11 +211,11 @@ func (c *Client) SetHeader(header, value string) *Client { return c } -// SetHeaders method sets multiple headers field and its values at one go in the client instance. -// These headers will be applied to all requests raised from this client instance. Also it can be +// SetHeaders method sets multiple header fields and their values at one go in the client instance. +// These headers will be applied to all requests from this client instance. Also, it can be // overridden at request level headers options. // -// See `Request.SetHeaders` or `Request.SetHeader`. +// See [Request.SetHeaders] or [Request.SetHeader]. // // For Example: To set `Content-Type` and `Accept` as `application/json` // @@ -230,25 +230,21 @@ func (c *Client) SetHeaders(headers map[string]string) *Client { return c } -// SetHeaderVerbatim method is to set a single header field and its value verbatim in the current request. +// SetHeaderVerbatim method sets a single header field and its value verbatim in the current request. // // For Example: To set `all_lowercase` and `UPPERCASE` as `available`. // -// client.R(). +// client. // SetHeaderVerbatim("all_lowercase", "available"). // SetHeaderVerbatim("UPPERCASE", "available") -// -// Also you can override header value, which was set at client instance level. -// -// Since v2.6.0 func (c *Client) SetHeaderVerbatim(header, value string) *Client { c.Header[header] = []string{value} return c } -// SetCookieJar method sets custom http.CookieJar in the resty client. Its way to override default. +// SetCookieJar method sets custom [http.CookieJar] in the resty client. It's a way to override the default. // -// For Example: sometimes we don't want to save cookies in api contacting, we can remove the default +// For Example, sometimes we don't want to save cookies in API mode so that we can remove the default // CookieJar in resty client. // // client.SetCookieJar(nil) @@ -257,8 +253,8 @@ func (c *Client) SetCookieJar(jar http.CookieJar) *Client { return c } -// SetCookie method appends a single cookie in the client instance. -// These cookies will be added to all the request raised from this client instance. +// SetCookie method appends a single cookie to the client instance. +// These cookies will be added to all the requests from this client instance. // // client.SetCookie(&http.Cookie{ // Name:"go-resty", @@ -270,7 +266,7 @@ func (c *Client) SetCookie(hc *http.Cookie) *Client { } // SetCookies method sets an array of cookies in the client instance. -// These cookies will be added to all the request raised from this client instance. +// These cookies will be added to all the requests from this client instance. // // cookies := []*http.Cookie{ // &http.Cookie{ @@ -290,14 +286,15 @@ func (c *Client) SetCookies(cs []*http.Cookie) *Client { return c } -// SetQueryParam method sets single parameter and its value in the client instance. -// It will be formed as query string for the request. +// SetQueryParam method sets a single parameter and its value in the client instance. +// It will be formed as a query string for the request. +// +// For Example: `search=kitchen%20papers&size=large` // -// For Example: `search=kitchen%20papers&size=large` -// in the URL after `?` mark. These query params will be added to all the request raised from -// this client instance. Also it can be overridden at request level Query Param options. +// In the URL after the `?` mark. These query params will be added to all the requests raised from +// this client instance. Also, it can be overridden at the request level. // -// See `Request.SetQueryParam` or `Request.SetQueryParams`. +// See [Request.SetQueryParam] or [Request.SetQueryParams]. // // client. // SetQueryParam("search", "kitchen papers"). @@ -308,13 +305,14 @@ func (c *Client) SetQueryParam(param, value string) *Client { } // SetQueryParams method sets multiple parameters and their values at one go in the client instance. -// It will be formed as query string for the request. +// It will be formed as a query string for the request. +// +// For Example: `search=kitchen%20papers&size=large` // -// For Example: `search=kitchen%20papers&size=large` -// in the URL after `?` mark. These query params will be added to all the request raised from this -// client instance. Also it can be overridden at request level Query Param options. +// In the URL after the `?` mark. These query params will be added to all the requests raised from this +// client instance. Also, it can be overridden at the request level. // -// See `Request.SetQueryParams` or `Request.SetQueryParam`. +// See [Request.SetQueryParams] or [Request.SetQueryParam]. // // client.SetQueryParams(map[string]string{ // "search": "kitchen papers", @@ -328,11 +326,11 @@ func (c *Client) SetQueryParams(params map[string]string) *Client { } // SetFormData method sets Form parameters and their values in the client instance. -// It's applicable only HTTP method `POST` and `PUT` and request content type would be set as -// `application/x-www-form-urlencoded`. These form data will be added to all the request raised from -// this client instance. Also it can be overridden at request level form data. +// It applies only to HTTP methods `POST` and `PUT`, and the request content type would be set as +// `application/x-www-form-urlencoded`. These form data will be added to all the requests raised from +// this client instance. Also, it can be overridden at the request level. // -// See `Request.SetFormData`. +// See [Request.SetFormData]. // // client.SetFormData(map[string]string{ // "access_token": "BC594900-518B-4F7E-AC75-BD37F019E08F", @@ -353,17 +351,17 @@ func (c *Client) SetFormData(data map[string]string) *Client { // // client.SetBasicAuth("go-resty", "welcome") // -// This basic auth information gets added to all the request raised from this client instance. -// Also it can be overridden or set one at the request level is supported. +// This basic auth information is added to all requests from this client instance. +// It can also be overridden at the request level. // -// See `Request.SetBasicAuth`. +// See [Request.SetBasicAuth]. func (c *Client) SetBasicAuth(username, password string) *Client { c.UserInfo = &User{Username: username, Password: password} return c } // SetAuthToken method sets the auth token of the `Authorization` header for all HTTP requests. -// The default auth scheme is `Bearer`, it can be customized with the method `SetAuthScheme`. For Example: +// The default auth scheme is `Bearer`; it can be customized with the method [Client.SetAuthScheme]. For Example: // // Authorization: // @@ -372,9 +370,9 @@ func (c *Client) SetBasicAuth(username, password string) *Client { // client.SetAuthToken("BC594900518B4F7EAC75BD37F019E08FBC594900518B4F7EAC75BD37F019E08F") // // This auth token gets added to all the requests raised from this client instance. -// Also it can be overridden or set one at the request level is supported. +// Also, it can be overridden at the request level. // -// See `Request.SetAuthToken`. +// See [Request.SetAuthToken]. func (c *Client) SetAuthToken(token string) *Client { c.Token = token return c @@ -389,15 +387,14 @@ func (c *Client) SetAuthToken(token string) *Client { // client.SetAuthScheme("OAuth") // // This auth scheme gets added to all the requests raised from this client instance. -// Also it can be overridden or set one at the request level is supported. +// Also, it can be overridden at the request level. // -// Information about auth schemes can be found in RFC7235 which is linked to below -// along with the page containing the currently defined official authentication schemes: +// Information about auth schemes can be found in [RFC 7235], IANA [HTTP Auth schemes]. // -// https://tools.ietf.org/html/rfc7235 -// https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes +// See [Request.SetAuthToken]. // -// See `Request.SetAuthToken`. +// [RFC 7235]: https://tools.ietf.org/html/rfc7235 +// [HTTP Auth schemes]: https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes func (c *Client) SetAuthScheme(scheme string) *Client { c.AuthScheme = scheme return c @@ -410,11 +407,11 @@ func (c *Client) SetAuthScheme(scheme string) *Client { // // client.SetDigestAuth("Mufasa", "Circle Of Life") // -// Information about Digest Access Authentication can be found in RFC7616: +// Information about Digest Access Authentication can be found in [RFC 7616]. // -// https://datatracker.ietf.org/doc/html/rfc7616 +// See [Request.SetDigestAuth]. // -// See `Request.SetDigestAuth`. +// [RFC 7616]: https://datatracker.ietf.org/doc/html/rfc7616 func (c *Client) SetDigestAuth(username, password string) *Client { oldTransport := c.httpClient.Transport c.OnBeforeRequest(func(c *Client, _ *Request) error { @@ -431,7 +428,7 @@ func (c *Client) SetDigestAuth(username, password string) *Client { return c } -// R method creates a new request instance, its used for Get, Post, Put, Delete, Patch, Head, Options, etc. +// R method creates a new request instance; it's used for Get, Post, Put, Delete, Patch, Head, Options, etc. func (c *Client) R() *Request { r := &Request{ QueryParam: url.Values{}, @@ -442,30 +439,31 @@ func (c *Client) R() *Request { RawPathParams: map[string]string{}, Debug: c.Debug, - client: c, - multipartFiles: []*File{}, - multipartFields: []*MultipartField{}, - jsonEscapeHTML: c.jsonEscapeHTML, - log: c.log, + client: c, + multipartFiles: []*File{}, + multipartFields: []*MultipartField{}, + jsonEscapeHTML: c.jsonEscapeHTML, + log: c.log, + responseBodyLimit: c.ResponseBodyLimit, + generateCurlOnDebug: c.generateCurlOnDebug, } return r } -// NewRequest is an alias for method `R()`. Creates a new request instance, its used for -// Get, Post, Put, Delete, Patch, Head, Options, etc. +// NewRequest method is an alias for method `R()`. func (c *Client) NewRequest() *Request { return c.R() } -// OnBeforeRequest method appends a request middleware into the before request chain. -// The user defined middlewares get applied before the default Resty request middlewares. +// OnBeforeRequest method appends a request middleware to the before request chain. +// The user-defined middlewares are applied before the default Resty request middlewares. // After all middlewares have been applied, the request is sent from Resty to the host server. // // client.OnBeforeRequest(func(c *resty.Client, r *resty.Request) error { -// // Now you have access to Client and Request instance +// // Now you have access to the Client and Request instance // // manipulate it as per your need // -// return nil // if its success otherwise return error +// return nil // if its successful otherwise return error // }) func (c *Client) OnBeforeRequest(m RequestMiddleware) *Client { c.udBeforeRequestLock.Lock() @@ -476,15 +474,15 @@ func (c *Client) OnBeforeRequest(m RequestMiddleware) *Client { return c } -// OnAfterResponse method appends response middleware into the after response chain. -// Once we receive response from host server, default Resty response middleware -// gets applied and then user assigned response middlewares applied. +// OnAfterResponse method appends response middleware to the after-response chain. +// Once we receive a response from the host server, the default Resty response middleware +// gets applied, and then the user-assigned response middleware is applied. // // client.OnAfterResponse(func(c *resty.Client, r *resty.Response) error { -// // Now you have access to Client and Response instance +// // Now you have access to the Client and Response instance // // manipulate it as per your need // -// return nil // if its success otherwise return error +// return nil // if its successful otherwise return error // }) func (c *Client) OnAfterResponse(m ResponseMiddleware) *Client { c.afterResponseLock.Lock() @@ -497,7 +495,7 @@ func (c *Client) OnAfterResponse(m ResponseMiddleware) *Client { // OnError method adds a callback that will be run whenever a request execution fails. // This is called after all retries have been attempted (if any). -// If there was a response from the server, the error will be wrapped in *ResponseError +// If there was a response from the server, the error will be wrapped in [ResponseError] // which has the last response received from the server. // // client.OnError(func(req *resty.Request, err error) { @@ -507,8 +505,8 @@ func (c *Client) OnAfterResponse(m ResponseMiddleware) *Client { // // Log the error, increment a metric, etc... // }) // -// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one -// set will be invoked for each call to Request.Execute() that completes. +// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic] +// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes. func (c *Client) OnError(h ErrorHook) *Client { c.errorHooks = append(c.errorHooks, h) return c @@ -517,10 +515,8 @@ func (c *Client) OnError(h ErrorHook) *Client { // OnSuccess method adds a callback that will be run whenever a request execution // succeeds. This is called after all retries have been attempted (if any). // -// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one -// set will be invoked for each call to Request.Execute() that completes. -// -// Since v2.8.0 +// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic] +// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes. func (c *Client) OnSuccess(h SuccessHook) *Client { c.successHooks = append(c.successHooks, h) return c @@ -529,10 +525,8 @@ func (c *Client) OnSuccess(h SuccessHook) *Client { // OnInvalid method adds a callback that will be run whenever a request execution // fails before it starts because the request is invalid. // -// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one -// set will be invoked for each call to Request.Execute() that completes. -// -// Since v2.8.0 +// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic] +// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes. func (c *Client) OnInvalid(h ErrorHook) *Client { c.invalidHooks = append(c.invalidHooks, h) return c @@ -541,21 +535,20 @@ func (c *Client) OnInvalid(h ErrorHook) *Client { // OnPanic method adds a callback that will be run whenever a request execution // panics. // -// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one -// set will be invoked for each call to Request.Execute() that completes. -// If an OnSuccess, OnError, or OnInvalid callback panics, then the exactly -// one rule can be violated. +// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic] +// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes. // -// Since v2.8.0 +// If an [Client.OnSuccess], [Client.OnError], or [Client.OnInvalid] callback panics, +// then exactly one rule can be violated. func (c *Client) OnPanic(h ErrorHook) *Client { c.panicHooks = append(c.panicHooks, h) return c } -// SetPreRequestHook method sets the given pre-request function into resty client. +// SetPreRequestHook method sets the given pre-request function into a resty client. // It is called right before the request is fired. // -// Note: Only one pre-request hook can be registered. Use `client.OnBeforeRequest` for multiple. +// NOTE: Only one pre-request hook can be registered. Use [Client.OnBeforeRequest] for multiple. func (c *Client) SetPreRequestHook(h PreRequestHook) *Client { if c.preReqHook != nil { c.log.Warnf("Overwriting an existing pre-request hook: %s", functionName(h)) @@ -564,19 +557,23 @@ func (c *Client) SetPreRequestHook(h PreRequestHook) *Client { return c } -// SetDebug method enables the debug mode on Resty client. Client logs details of every request and response. -// For `Request` it logs information such as HTTP verb, Relative URL path, Host, Headers, Body if it has one. -// For `Response` it logs information such as Status, Response Time, Headers, Body if it has one. +// SetDebug method enables the debug mode on the Resty client. The client logs details +// of every request and response. // // client.SetDebug(true) // -// Also it can be enabled at request level for particular request, see `Request.SetDebug`. +// Also, it can be enabled at the request level for a particular request; see [Request.SetDebug]. +// - For [Request], it logs information such as HTTP verb, Relative URL path, +// Host, Headers, and Body if it has one. +// - For [Response], it logs information such as Status, Response Time, Headers, +// and Body if it has one. func (c *Client) SetDebug(d bool) *Client { c.Debug = d return c } -// SetDebugBodyLimit sets the maximum size for which the response and request body will be logged in debug mode. +// SetDebugBodyLimit sets the maximum size in bytes for which the response and +// request body will be logged in debug mode. // // client.SetDebugBodyLimit(1000000) func (c *Client) SetDebugBodyLimit(sl int64) *Client { @@ -584,8 +581,8 @@ func (c *Client) SetDebugBodyLimit(sl int64) *Client { return c } -// OnRequestLog method used to set request log callback into Resty. Registered callback gets -// called before the resty actually logs the information. +// OnRequestLog method sets the request log callback to Resty. Registered callback gets +// called before the resty logs the information. func (c *Client) OnRequestLog(rl RequestLogCallback) *Client { if c.requestLog != nil { c.log.Warnf("Overwriting an existing on-request-log callback from=%s to=%s", @@ -595,8 +592,8 @@ func (c *Client) OnRequestLog(rl RequestLogCallback) *Client { return c } -// OnResponseLog method used to set response log callback into Resty. Registered callback gets -// called before the resty actually logs the information. +// OnResponseLog method sets the response log callback to Resty. Registered callback gets +// called before the resty logs the information. func (c *Client) OnResponseLog(rl ResponseLogCallback) *Client { if c.responseLog != nil { c.log.Warnf("Overwriting an existing on-response-log callback from=%s to=%s", @@ -606,9 +603,9 @@ func (c *Client) OnResponseLog(rl ResponseLogCallback) *Client { return c } -// SetDisableWarn method disables the warning message on Resty client. +// SetDisableWarn method disables the warning log message on the Resty client. // -// For Example: Resty warns the user when BasicAuth used on non-TLS mode. +// For example, Resty warns users when BasicAuth is used in non-TLS mode. // // client.SetDisableWarn(true) func (c *Client) SetDisableWarn(d bool) *Client { @@ -616,9 +613,9 @@ func (c *Client) SetDisableWarn(d bool) *Client { return c } -// SetAllowGetMethodPayload method allows the GET method with payload on Resty client. +// SetAllowGetMethodPayload method allows the GET method with payload on the Resty client. // -// For Example: Resty allows the user sends request with a payload on HTTP GET method. +// For example, Resty allows the user to send a request with a payload using the HTTP GET method. // // client.SetAllowGetMethodPayload(true) func (c *Client) SetAllowGetMethodPayload(a bool) *Client { @@ -628,24 +625,24 @@ func (c *Client) SetAllowGetMethodPayload(a bool) *Client { // SetLogger method sets given writer for logging Resty request and response details. // -// Compliant to interface `resty.Logger`. +// Compliant to interface [resty.Logger] func (c *Client) SetLogger(l Logger) *Client { c.log = l return c } // SetContentLength method enables the HTTP header `Content-Length` value for every request. -// By default Resty won't set `Content-Length`. +// By default, Resty won't set `Content-Length`. // // client.SetContentLength(true) // -// Also you have an option to enable for particular request. See `Request.SetContentLength` +// Also, you have the option to enable a particular request. See [Request.SetContentLength] func (c *Client) SetContentLength(l bool) *Client { c.setContentLength = l return c } -// SetTimeout method sets timeout for request raised from client. +// SetTimeout method sets the timeout for a request raised by the client. // // client.SetTimeout(time.Duration(1 * time.Minute)) func (c *Client) SetTimeout(timeout time.Duration) *Client { @@ -653,9 +650,9 @@ func (c *Client) SetTimeout(timeout time.Duration) *Client { return c } -// SetError method is to register the global or client common `Error` object into Resty. -// It is used for automatic unmarshalling if response status code is greater than 399 and -// content type either JSON or XML. Can be pointer or non-pointer. +// SetError method registers the global or client common `Error` object into Resty. +// It is used for automatic unmarshalling if the response status code is greater than 399 and +// content type is JSON or XML. It can be a pointer or a non-pointer. // // client.SetError(&Error{}) // // OR @@ -665,8 +662,8 @@ func (c *Client) SetError(err interface{}) *Client { return c } -// SetRedirectPolicy method sets the client redirect policy. Resty provides ready to use -// redirect policies. Wanna create one for yourself refer to `redirect.go`. +// SetRedirectPolicy method sets the redirect policy for the client. Resty provides ready-to-use +// redirect policies. Wanna create one for yourself, refer to `redirect.go`. // // client.SetRedirectPolicy(FlexibleRedirectPolicy(20)) // @@ -699,7 +696,7 @@ func (c *Client) SetRetryCount(count int) *Client { return c } -// SetRetryWaitTime method sets default wait time to sleep before retrying +// SetRetryWaitTime method sets the default wait time for sleep before retrying // request. // // Default is 100 milliseconds. @@ -708,7 +705,7 @@ func (c *Client) SetRetryWaitTime(waitTime time.Duration) *Client { return c } -// SetRetryMaxWaitTime method sets max wait time to sleep before retrying +// SetRetryMaxWaitTime method sets the max wait time for sleep before retrying // request. // // Default is 2 seconds. @@ -717,7 +714,7 @@ func (c *Client) SetRetryMaxWaitTime(maxWaitTime time.Duration) *Client { return c } -// SetRetryAfter sets callback to calculate wait time between retries. +// SetRetryAfter sets a callback to calculate the wait time between retries. // Default (nil) implies exponential backoff with jitter func (c *Client) SetRetryAfter(callback RetryAfterFunc) *Client { c.RetryAfter = callback @@ -725,56 +722,46 @@ func (c *Client) SetRetryAfter(callback RetryAfterFunc) *Client { } // SetJSONMarshaler method sets the JSON marshaler function to marshal the request body. -// By default, Resty uses `encoding/json` package to marshal the request body. -// -// Since v2.8.0 +// By default, Resty uses [encoding/json] package to marshal the request body. func (c *Client) SetJSONMarshaler(marshaler func(v interface{}) ([]byte, error)) *Client { c.JSONMarshal = marshaler return c } // SetJSONUnmarshaler method sets the JSON unmarshaler function to unmarshal the response body. -// By default, Resty uses `encoding/json` package to unmarshal the response body. -// -// Since v2.8.0 +// By default, Resty uses [encoding/json] package to unmarshal the response body. func (c *Client) SetJSONUnmarshaler(unmarshaler func(data []byte, v interface{}) error) *Client { c.JSONUnmarshal = unmarshaler return c } // SetXMLMarshaler method sets the XML marshaler function to marshal the request body. -// By default, Resty uses `encoding/xml` package to marshal the request body. -// -// Since v2.8.0 +// By default, Resty uses [encoding/xml] package to marshal the request body. func (c *Client) SetXMLMarshaler(marshaler func(v interface{}) ([]byte, error)) *Client { c.XMLMarshal = marshaler return c } // SetXMLUnmarshaler method sets the XML unmarshaler function to unmarshal the response body. -// By default, Resty uses `encoding/xml` package to unmarshal the response body. -// -// Since v2.8.0 +// By default, Resty uses [encoding/xml] package to unmarshal the response body. func (c *Client) SetXMLUnmarshaler(unmarshaler func(data []byte, v interface{}) error) *Client { c.XMLUnmarshal = unmarshaler return c } -// AddRetryCondition method adds a retry condition function to array of functions +// AddRetryCondition method adds a retry condition function to an array of functions // that are checked to determine if the request is retried. The request will -// retry if any of the functions return true and error is nil. +// retry if any functions return true and the error is nil. // -// Note: These retry conditions are applied on all Request made using this Client. -// For Request specific retry conditions check *Request.AddRetryCondition +// NOTE: These retry conditions are applied on all requests made using this Client. +// For [Request] specific retry conditions, check [Request.AddRetryCondition] func (c *Client) AddRetryCondition(condition RetryConditionFunc) *Client { c.RetryConditions = append(c.RetryConditions, condition) return c } // AddRetryAfterErrorCondition adds the basic condition of retrying after encountering -// an error from the http response -// -// Since v2.6.0 +// an error from the HTTP response func (c *Client) AddRetryAfterErrorCondition() *Client { c.AddRetryCondition(func(response *Response, err error) bool { return response.IsError() @@ -784,33 +771,29 @@ func (c *Client) AddRetryAfterErrorCondition() *Client { // AddRetryHook adds a side-effecting retry hook to an array of hooks // that will be executed on each retry. -// -// Since v2.6.0 func (c *Client) AddRetryHook(hook OnRetryFunc) *Client { c.RetryHooks = append(c.RetryHooks, hook) return c } // SetRetryResetReaders method enables the Resty client to seek the start of all -// file readers given as multipart files, if the given object implements `io.ReadSeeker`. -// -// Since ... +// file readers are given as multipart files if the object implements [io.ReadSeeker]. func (c *Client) SetRetryResetReaders(b bool) *Client { c.RetryResetReaders = b return c } -// SetTLSClientConfig method sets TLSClientConfig for underling client Transport. +// SetTLSClientConfig method sets TLSClientConfig for underlying client Transport. // // For Example: // -// // One can set custom root-certificate. Refer: http://golang.org/pkg/crypto/tls/#example_Dial +// // One can set a custom root certificate. Refer: http://golang.org/pkg/crypto/tls/#example_Dial // client.SetTLSClientConfig(&tls.Config{ RootCAs: roots }) // // // or One can disable security check (https) // client.SetTLSClientConfig(&tls.Config{ InsecureSkipVerify: true }) // -// Note: This method overwrites existing `TLSClientConfig`. +// NOTE: This method overwrites existing [http.Transport.TLSClientConfig] func (c *Client) SetTLSClientConfig(config *tls.Config) *Client { transport, err := c.Transport() if err != nil { @@ -821,13 +804,11 @@ func (c *Client) SetTLSClientConfig(config *tls.Config) *Client { return c } -// SetProxy method sets the Proxy URL and Port for Resty client. +// SetProxy method sets the Proxy URL and Port for the Resty client. // // client.SetProxy("http://proxyserver:8888") // -// OR Without this `SetProxy` method, you could also set Proxy via environment variable. -// -// Refer to godoc `http.ProxyFromEnvironment`. +// OR you could also set Proxy via environment variable, refer to [http.ProxyFromEnvironment] func (c *Client) SetProxy(proxyURL string) *Client { transport, err := c.Transport() if err != nil { @@ -846,7 +827,7 @@ func (c *Client) SetProxy(proxyURL string) *Client { return c } -// RemoveProxy method removes the proxy configuration from Resty client +// RemoveProxy method removes the proxy configuration from the Resty client // // client.RemoveProxy() func (c *Client) RemoveProxy() *Client { @@ -860,7 +841,7 @@ func (c *Client) RemoveProxy() *Client { return c } -// SetCertificates method helps to set client certificates into Resty conveniently. +// SetCertificates method helps to conveniently set client certificates into Resty. func (c *Client) SetCertificates(certs ...tls.Certificate) *Client { config, err := c.tlsConfig() if err != nil { @@ -871,7 +852,7 @@ func (c *Client) SetCertificates(certs ...tls.Certificate) *Client { return c } -// SetRootCertificate method helps to add one or more root certificates into Resty client +// SetRootCertificate method helps to add one or more root certificates into the Resty client // // client.SetRootCertificate("/path/to/root/pemFile.pem") func (c *Client) SetRootCertificate(pemFilePath string) *Client { @@ -880,40 +861,66 @@ func (c *Client) SetRootCertificate(pemFilePath string) *Client { c.log.Errorf("%v", err) return c } + c.handleCAs("root", rootPemData) + return c +} - config, err := c.tlsConfig() +// SetRootCertificateFromString method helps to add one or more root certificates +// into the Resty client +// +// client.SetRootCertificateFromString("pem certs content") +func (c *Client) SetRootCertificateFromString(pemCerts string) *Client { + c.handleCAs("root", []byte(pemCerts)) + return c +} + +// SetClientRootCertificate method helps to add one or more client's root +// certificates into the Resty client +// +// client.SetClientRootCertificate("/path/to/root/pemFile.pem") +func (c *Client) SetClientRootCertificate(pemFilePath string) *Client { + rootPemData, err := os.ReadFile(pemFilePath) if err != nil { c.log.Errorf("%v", err) return c } - if config.RootCAs == nil { - config.RootCAs = x509.NewCertPool() - } - - config.RootCAs.AppendCertsFromPEM(rootPemData) + c.handleCAs("client", rootPemData) return c } -// SetRootCertificateFromString method helps to add one or more root certificates into Resty client +// SetClientRootCertificateFromString method helps to add one or more clients +// root certificates into the Resty client // -// client.SetRootCertificateFromString("pem file content") -func (c *Client) SetRootCertificateFromString(pemContent string) *Client { +// client.SetClientRootCertificateFromString("pem certs content") +func (c *Client) SetClientRootCertificateFromString(pemCerts string) *Client { + c.handleCAs("client", []byte(pemCerts)) + return c +} + +func (c *Client) handleCAs(scope string, permCerts []byte) { config, err := c.tlsConfig() if err != nil { c.log.Errorf("%v", err) - return c - } - if config.RootCAs == nil { - config.RootCAs = x509.NewCertPool() + return } - config.RootCAs.AppendCertsFromPEM([]byte(pemContent)) - return c + switch scope { + case "root": + if config.RootCAs == nil { + config.RootCAs = x509.NewCertPool() + } + config.RootCAs.AppendCertsFromPEM(permCerts) + case "client": + if config.ClientCAs == nil { + config.ClientCAs = x509.NewCertPool() + } + config.ClientCAs.AppendCertsFromPEM(permCerts) + } } -// SetOutputDirectory method sets output directory for saving HTTP response into file. -// If the output directory not exists then resty creates one. This setting is optional one, -// if you're planning using absolute path in `Request.SetOutput` and can used together. +// SetOutputDirectory method sets the output directory for saving HTTP responses in a file. +// Resty creates one if the output directory does not exist. This setting is optional, +// if you plan to use the absolute path in [Request.SetOutput] and can used together. // // client.SetOutputDirectory("/save/http/response/here") func (c *Client) SetOutputDirectory(dirPath string) *Client { @@ -921,24 +928,15 @@ func (c *Client) SetOutputDirectory(dirPath string) *Client { return c } -// SetRateLimiter sets an optional `RateLimiter`. If set the rate limiter will control -// all requests made with this client. -// -// Since v2.9.0 +// SetRateLimiter sets an optional [RateLimiter]. If set, the rate limiter will control +// all requests were made by this client. func (c *Client) SetRateLimiter(rl RateLimiter) *Client { c.rateLimiter = rl return c } -// SetTransport method sets custom `*http.Transport` or any `http.RoundTripper` -// compatible interface implementation in the resty client. -// -// Note: -// -// - If transport is not type of `*http.Transport` then you may not be able to -// take advantage of some of the Resty client settings. -// -// - It overwrites the Resty client transport instance and it's configurations. +// SetTransport method sets custom [http.Transport] or any [http.RoundTripper] +// compatible interface implementation in the Resty client. // // transport := &http.Transport{ // // something like Proxying to httptest.Server, etc... @@ -946,8 +944,12 @@ func (c *Client) SetRateLimiter(rl RateLimiter) *Client { // return url.Parse(server.URL) // }, // } -// // client.SetTransport(transport) +// +// NOTE: +// - If transport is not the type of `*http.Transport`, then you may not be able to +// take advantage of some of the Resty client settings. +// - It overwrites the Resty client transport instance and its configurations. func (c *Client) SetTransport(transport http.RoundTripper) *Client { if transport != nil { c.httpClient.Transport = transport @@ -955,7 +957,7 @@ func (c *Client) SetTransport(transport http.RoundTripper) *Client { return c } -// SetScheme method sets custom scheme in the Resty client. It's way to override default. +// SetScheme method sets a custom scheme for the Resty client. It's a way to override the default. // // client.SetScheme("http") func (c *Client) SetScheme(scheme string) *Client { @@ -965,25 +967,26 @@ func (c *Client) SetScheme(scheme string) *Client { return c } -// SetCloseConnection method sets variable `Close` in http request struct with the given +// SetCloseConnection method sets variable `Close` in HTTP request struct with the given // value. More info: https://golang.org/src/net/http/request.go func (c *Client) SetCloseConnection(close bool) *Client { c.closeConnection = close return c } -// SetDoNotParseResponse method instructs `Resty` not to parse the response body automatically. -// Resty exposes the raw response body as `io.ReadCloser`. Also do not forget to close the body, -// otherwise you might get into connection leaks, no connection reuse. +// SetDoNotParseResponse method instructs Resty not to parse the response body automatically. +// Resty exposes the raw response body as [io.ReadCloser]. If you use it, do not +// forget to close the body, otherwise, you might get into connection leaks, and connection +// reuse may not happen. // -// Note: Response middlewares are not applicable, if you use this option. Basically you have -// taken over the control of response parsing from `Resty`. -func (c *Client) SetDoNotParseResponse(parse bool) *Client { - c.notParseResponse = parse +// NOTE: [Response] middlewares are not executed using this option. You have +// taken over the control of response parsing from Resty. +func (c *Client) SetDoNotParseResponse(notParse bool) *Client { + c.notParseResponse = notParse return c } -// SetPathParam method sets single URL path key-value pair in the +// SetPathParam method sets a single URL path key-value pair in the // Resty client instance. // // client.SetPathParam("userId", "sample@sample.com") @@ -993,10 +996,10 @@ func (c *Client) SetDoNotParseResponse(parse bool) *Client { // Composed URL - /v1/users/sample@sample.com/details // // It replaces the value of the key while composing the request URL. -// The value will be escaped using `url.PathEscape` function. +// The value will be escaped using [url.PathEscape] function. // -// Also it can be overridden at request level Path Params options, -// see `Request.SetPathParam` or `Request.SetPathParams`. +// It can be overridden at the request level, +// see [Request.SetPathParam] or [Request.SetPathParams] func (c *Client) SetPathParam(param, value string) *Client { c.PathParams[param] = value return c @@ -1016,10 +1019,10 @@ func (c *Client) SetPathParam(param, value string) *Client { // Composed URL - /v1/users/sample@sample.com/100002/groups%2Fdevelopers/details // // It replaces the value of the key while composing the request URL. -// The values will be escaped using `url.PathEscape` function. +// The values will be escaped using [url.PathEscape] function. // -// Also it can be overridden at request level Path Params options, -// see `Request.SetPathParam` or `Request.SetPathParams`. +// It can be overridden at the request level, +// see [Request.SetPathParam] or [Request.SetPathParams] func (c *Client) SetPathParams(params map[string]string) *Client { for p, v := range params { c.SetPathParam(p, v) @@ -1027,7 +1030,7 @@ func (c *Client) SetPathParams(params map[string]string) *Client { return c } -// SetRawPathParam method sets single URL path key-value pair in the +// SetRawPathParam method sets a single URL path key-value pair in the // Resty client instance. // // client.SetPathParam("userId", "sample@sample.com") @@ -1045,10 +1048,8 @@ func (c *Client) SetPathParams(params map[string]string) *Client { // It replaces the value of the key while composing the request URL. // The value will be used as it is and will not be escaped. // -// Also it can be overridden at request level Path Params options, -// see `Request.SetPathParam` or `Request.SetPathParams`. -// -// Since v2.8.0 +// It can be overridden at the request level, +// see [Request.SetRawPathParam] or [Request.SetRawPathParams] func (c *Client) SetRawPathParam(param, value string) *Client { c.RawPathParams[param] = value return c @@ -1070,10 +1071,8 @@ func (c *Client) SetRawPathParam(param, value string) *Client { // It replaces the value of the key while composing the request URL. // The values will be used as they are and will not be escaped. // -// Also it can be overridden at request level Path Params options, -// see `Request.SetPathParam` or `Request.SetPathParams`. -// -// Since v2.8.0 +// It can be overridden at the request level, +// see [Request.SetRawPathParam] or [Request.SetRawPathParams] func (c *Client) SetRawPathParams(params map[string]string) *Client { for p, v := range params { c.SetRawPathParam(p, v) @@ -1081,16 +1080,35 @@ func (c *Client) SetRawPathParams(params map[string]string) *Client { return c } -// SetJSONEscapeHTML method is to enable/disable the HTML escape on JSON marshal. +// SetJSONEscapeHTML method enables or disables the HTML escape on JSON marshal. +// By default, escape HTML is false. // -// Note: This option only applicable to standard JSON Marshaller. +// NOTE: This option only applies to the standard JSON Marshaller used by Resty. +// +// It can be overridden at the request level, see [Client.SetJSONEscapeHTML] func (c *Client) SetJSONEscapeHTML(b bool) *Client { c.jsonEscapeHTML = b return c } +// SetResponseBodyLimit method sets a maximum body size limit in bytes on response, +// avoid reading too much data to memory. +// +// Client will return [resty.ErrResponseBodyTooLarge] if the body size of the body +// in the uncompressed response is larger than the limit. +// Body size limit will not be enforced in the following cases: +// - ResponseBodyLimit <= 0, which is the default behavior. +// - [Request.SetOutput] is called to save response data to the file. +// - "DoNotParseResponse" is set for client or request. +// +// It can be overridden at the request level; see [Request.SetResponseBodyLimit] +func (c *Client) SetResponseBodyLimit(v int) *Client { + c.ResponseBodyLimit = v + return c +} + // EnableTrace method enables the Resty client trace for the requests fired from -// the client using `httptrace.ClientTrace` and provides insights. +// the client using [httptrace.ClientTrace] and provides insights. // // client := resty.New().EnableTrace() // @@ -1098,42 +1116,53 @@ func (c *Client) SetJSONEscapeHTML(b bool) *Client { // fmt.Println("Error:", err) // fmt.Println("Trace Info:", resp.Request.TraceInfo()) // -// Also `Request.EnableTrace` available too to get trace info for single request. -// -// Since v2.0.0 +// The method [Request.EnableTrace] is also available to get trace info for a single request. func (c *Client) EnableTrace() *Client { c.trace = true return c } -// DisableTrace method disables the Resty client trace. Refer to `Client.EnableTrace`. -// -// Since v2.0.0 +// DisableTrace method disables the Resty client trace. Refer to [Client.EnableTrace]. func (c *Client) DisableTrace() *Client { c.trace = false return c } -// IsProxySet method returns the true is proxy is set from resty client otherwise -// false. By default proxy is set from environment, refer to `http.ProxyFromEnvironment`. +// EnableGenerateCurlOnDebug method enables the generation of CURL commands in the debug log. +// It works in conjunction with debug mode. +// +// NOTE: Use with care. +// - Potential to leak sensitive data from [Request] and [Response] in the debug log. +// - Beware of memory usage since the request body is reread. +func (c *Client) EnableGenerateCurlOnDebug() *Client { + c.generateCurlOnDebug = true + return c +} + +// DisableGenerateCurlOnDebug method disables the option set by [Client.EnableGenerateCurlOnDebug]. +func (c *Client) DisableGenerateCurlOnDebug() *Client { + c.generateCurlOnDebug = false + return c +} + +// IsProxySet method returns the true is proxy is set from the Resty client; otherwise +// false. By default, the proxy is set from the environment variable; refer to [http.ProxyFromEnvironment]. func (c *Client) IsProxySet() bool { return c.proxyURL != nil } -// GetClient method returns the current `http.Client` used by the resty client. +// GetClient method returns the underlying [http.Client] used by the Resty. func (c *Client) GetClient() *http.Client { return c.httpClient } // Clone returns a clone of the original client. // -// Be careful when using this function: -// - Interface values are not deeply cloned. Thus, both the original and the clone will use the -// same value. -// - This function is not safe for concurrent use. You should only use this when you are sure that -// the client is not being used by any other goroutine. -// -// Since v2.12.0 +// NOTE: Use with care: +// - Interface values are not deeply cloned. Thus, both the original and the +// clone will use the same value. +// - This function is not safe for concurrent use. You should only use this method +// when you are sure that any other goroutine is not using the client. func (c *Client) Clone() *Client { // dereference the pointer and copy the value cc := *c @@ -1144,10 +1173,6 @@ func (c *Client) Clone() *Client { return &cc } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Client Unexported methods -//_______________________________________________________________________ - func (c *Client) executeBefore(req *Request) error { // Lock the user-defined pre-request hooks. c.udBeforeRequestLock.RLock() @@ -1202,8 +1227,8 @@ func (c *Client) executeBefore(req *Request) error { return nil } -// Executes method executes the given `Request` object and returns response -// error. +// Executes method executes the given `Request` object and returns +// response or error. func (c *Client) execute(req *Request) (*Response, error) { if err := c.executeBefore(req); err != nil { return nil, err @@ -1218,8 +1243,12 @@ func (c *Client) execute(req *Request) (*Response, error) { } if err != nil || req.notParseResponse || c.notParseResponse { + logErr := responseLogger(c, response) response.setReceivedAt() - return response, err + if err != nil { + return response, errors.Join(err, logErr) + } + return response, wrapNoRetryErr(logErr) } if !req.isSaveResponse { @@ -1231,6 +1260,7 @@ func (c *Client) execute(req *Request) (*Response, error) { if _, ok := body.(*gzip.Reader); !ok { body, err = gzip.NewReader(body) if err != nil { + err = errors.Join(err, responseLogger(c, response)) response.setReceivedAt() return response, err } @@ -1238,7 +1268,8 @@ func (c *Client) execute(req *Request) (*Response, error) { } } - if response.body, err = io.ReadAll(body); err != nil { + if response.body, err = readAllWithLimit(body, req.responseBodyLimit); err != nil { + err = errors.Join(err, responseLogger(c, response)) response.setReceivedAt() return response, err } @@ -1249,6 +1280,11 @@ func (c *Client) execute(req *Request) (*Response, error) { response.setReceivedAt() // after we read the body // Apply Response middleware + err = responseLogger(c, response) + if err != nil { + return response, wrapNoRetryErr(err) + } + for _, f := range c.afterResponse { if err = f(c, response); err != nil { break @@ -1258,6 +1294,39 @@ func (c *Client) execute(req *Request) (*Response, error) { return response, wrapNoRetryErr(err) } +var ErrResponseBodyTooLarge = errors.New("resty: response body too large") + +// https://github.com/golang/go/issues/51115 +// [io.LimitedReader] can only return [io.EOF] +func readAllWithLimit(r io.Reader, maxSize int) ([]byte, error) { + if maxSize <= 0 { + return io.ReadAll(r) + } + + var buf [512]byte // make buf stack allocated + result := make([]byte, 0, 512) + total := 0 + for { + n, err := r.Read(buf[:]) + total += n + if total > maxSize { + return nil, ErrResponseBodyTooLarge + } + + if err != nil { + if err == io.EOF { + result = append(result, buf[:n]...) + break + } + return nil, err + } + + result = append(result, buf[:n]...) + } + + return result, nil +} + // getting TLS client config if not exists then create one func (c *Client) tlsConfig() (*tls.Config, error) { transport, err := c.Transport() @@ -1270,10 +1339,10 @@ func (c *Client) tlsConfig() (*tls.Config, error) { return transport.TLSClientConfig, nil } -// Transport method returns `*http.Transport` currently in use or error -// in case currently used `transport` is not a `*http.Transport`. +// Transport method returns [http.Transport] currently in use or error +// in case the currently used `transport` is not a [http.Transport]. // -// Since v2.8.0 become exported method. +// Since v2.8.0 has become exported method. func (c *Client) Transport() (*http.Transport, error) { if transport, ok := c.httpClient.Transport.(*http.Transport); ok { return transport, nil @@ -1287,7 +1356,7 @@ func (c *Client) outputLogTo(w io.Writer) *Client { return c } -// ResponseError is a wrapper for including the server response with an error. +// ResponseError is a wrapper that includes the server response with an error. // Neither the err nor the response should be nil. type ResponseError struct { Response *Response @@ -1303,7 +1372,7 @@ func (e *ResponseError) Unwrap() error { } // Helper to run errorHooks hooks. -// It wraps the error in a ResponseError if the resp is not nil +// It wraps the error in a [ResponseError] if the resp is not nil // so hooks can access it. func (c *Client) onErrorHooks(req *Request, resp *Response, err error) { if err != nil { @@ -1338,14 +1407,14 @@ func (c *Client) onInvalidHooks(req *Request, err error) { // File struct and its methods //_______________________________________________________________________ -// File struct represent file information for multipart request +// File struct represents file information for multipart request type File struct { Name string ParamName string io.Reader } -// String returns string value of current file details +// String method returns the string value of current file details func (f *File) String() string { return fmt.Sprintf("ParamName: %v; FileName: %v", f.ParamName, f.Name) } @@ -1354,7 +1423,7 @@ func (f *File) String() string { // MultipartField struct //_______________________________________________________________________ -// MultipartField struct represent custom data part for multipart request +// MultipartField struct represents the custom data part for a multipart request type MultipartField struct { Param string FileName string @@ -1362,10 +1431,6 @@ type MultipartField struct { io.Reader } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Unexported package methods -//_______________________________________________________________________ - func createClient(hc *http.Client) *Client { if hc.Transport == nil { hc.Transport = createTransport(nil) @@ -1411,7 +1476,6 @@ func createClient(hc *http.Client) *Client { // default after response middlewares c.afterResponse = []ResponseMiddleware{ - responseLogger, parseResponseBody, saveResponseIntoFile, } diff --git a/vendor/github.com/go-resty/resty/v2/middleware.go b/vendor/github.com/go-resty/resty/v2/middleware.go index 41e6561f22..84f0fdea04 100644 --- a/vendor/github.com/go-resty/resty/v2/middleware.go +++ b/vendor/github.com/go-resty/resty/v2/middleware.go @@ -308,7 +308,7 @@ func addCredentials(c *Client, r *Request) error { } func createCurlCmd(c *Client, r *Request) (err error) { - if r.trace { + if r.Debug && r.generateCurlOnDebug { if r.resultCurlCmd == nil { r.resultCurlCmd = new(string) } @@ -338,10 +338,14 @@ func requestLogger(c *Client, r *Request) error { } } - reqLog := "\n==============================================================================\n" + - "~~~ REQUEST(curl) ~~~\n" + - fmt.Sprintf("CURL:\n %v\n", buildCurlRequest(r.RawRequest, r.client.httpClient.Jar)) + - "~~~ REQUEST ~~~\n" + + reqLog := "\n==============================================================================\n" + + if r.Debug && r.generateCurlOnDebug { + reqLog += "~~~ REQUEST(CURL) ~~~\n" + + fmt.Sprintf(" %v\n", *r.resultCurlCmd) + } + + reqLog += "~~~ REQUEST ~~~\n" + fmt.Sprintf("%s %s %s\n", r.Method, rr.URL.RequestURI(), rr.Proto) + fmt.Sprintf("HOST : %s\n", rr.URL.Host) + fmt.Sprintf("HEADERS:\n%s\n", composeHeaders(c, r, rl.Header)) + @@ -429,6 +433,13 @@ func handleMultipart(c *Client, r *Request) error { r.bodyBuf = acquireBuffer() w := multipart.NewWriter(r.bodyBuf) + // Set boundary if not set by user + if r.multipartBoundary != "" { + if err := w.SetBoundary(r.multipartBoundary); err != nil { + return err + } + } + for k, v := range c.FormData { for _, iv := range v { if err := w.WriteField(k, iv); err != nil { diff --git a/vendor/github.com/go-resty/resty/v2/redirect.go b/vendor/github.com/go-resty/resty/v2/redirect.go index 19bd587df9..bb016e2771 100644 --- a/vendor/github.com/go-resty/resty/v2/redirect.go +++ b/vendor/github.com/go-resty/resty/v2/redirect.go @@ -13,22 +13,22 @@ import ( ) var ( - // Since v2.8.0 ErrAutoRedirectDisabled = errors.New("auto redirect is disabled") ) type ( - // RedirectPolicy to regulate the redirects in the resty client. - // Objects implementing the RedirectPolicy interface can be registered as + // RedirectPolicy to regulate the redirects in the Resty client. + // Objects implementing the [RedirectPolicy] interface can be registered as // - // Apply function should return nil to continue the redirect journey, otherwise + // Apply function should return nil to continue the redirect journey; otherwise // return error to stop the redirect. RedirectPolicy interface { Apply(req *http.Request, via []*http.Request) error } - // The RedirectPolicyFunc type is an adapter to allow the use of ordinary functions as RedirectPolicy. - // If f is a function with the appropriate signature, RedirectPolicyFunc(f) is a RedirectPolicy object that calls f. + // The [RedirectPolicyFunc] type is an adapter to allow the use of ordinary + // functions as [RedirectPolicy]. If `f` is a function with the appropriate + // signature, RedirectPolicyFunc(f) is a RedirectPolicy object that calls `f`. RedirectPolicyFunc func(*http.Request, []*http.Request) error ) @@ -37,7 +37,7 @@ func (f RedirectPolicyFunc) Apply(req *http.Request, via []*http.Request) error return f(req, via) } -// NoRedirectPolicy is used to disable redirects in the HTTP client +// NoRedirectPolicy is used to disable redirects in the Resty client // // resty.SetRedirectPolicy(NoRedirectPolicy()) func NoRedirectPolicy() RedirectPolicy { @@ -46,7 +46,7 @@ func NoRedirectPolicy() RedirectPolicy { }) } -// FlexibleRedirectPolicy is convenient method to create No of redirect policy for HTTP client. +// FlexibleRedirectPolicy method is convenient for creating several redirect policies for Resty clients. // // resty.SetRedirectPolicy(FlexibleRedirectPolicy(20)) func FlexibleRedirectPolicy(noOfRedirect int) RedirectPolicy { @@ -59,8 +59,8 @@ func FlexibleRedirectPolicy(noOfRedirect int) RedirectPolicy { }) } -// DomainCheckRedirectPolicy is convenient method to define domain name redirect rule in resty client. -// Redirect is allowed for only mentioned host in the policy. +// DomainCheckRedirectPolicy method is convenient for defining domain name redirect rules in Resty clients. +// Redirect is allowed only for the host mentioned in the policy. // // resty.SetRedirectPolicy(DomainCheckRedirectPolicy("host1.com", "host2.org", "host3.net")) func DomainCheckRedirectPolicy(hostnames ...string) RedirectPolicy { @@ -80,10 +80,6 @@ func DomainCheckRedirectPolicy(hostnames ...string) RedirectPolicy { return fn } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Package Unexported methods -//_______________________________________________________________________ - func getHostname(host string) (hostname string) { if strings.Index(host, ":") > 0 { host, _, _ = net.SplitHostPort(host) @@ -92,10 +88,11 @@ func getHostname(host string) (hostname string) { return } -// By default Golang will not redirect request headers -// after go throwing various discussion comments from thread +// By default, Golang will not redirect request headers. +// After reading through the various discussion comments from the thread - // https://github.com/golang/go/issues/4800 -// Resty will add all the headers during a redirect for the same host +// Resty will add all the headers during a redirect for the same host and +// adds library user-agent if the Host is different. func checkHostAndAddHeaders(cur *http.Request, pre *http.Request) { curHostname := getHostname(cur.URL.Host) preHostname := getHostname(pre.URL.Host) diff --git a/vendor/github.com/go-resty/resty/v2/request.go b/vendor/github.com/go-resty/resty/v2/request.go index 336925d5f0..183407152b 100644 --- a/vendor/github.com/go-resty/resty/v2/request.go +++ b/vendor/github.com/go-resty/resty/v2/request.go @@ -23,9 +23,9 @@ import ( // Request struct and methods //_______________________________________________________________________ -// Request struct is used to compose and fire individual request from -// resty client. Request provides an options to override client level -// settings and also an options for the request composition. +// Request struct is used to compose and fire individual requests from +// Resty client. The [Request] provides an option to override client-level +// settings and also an option for the request composition. type Request struct { URL string Method string @@ -49,8 +49,6 @@ type Request struct { // Attempt is to represent the request attempt made during a Resty // request execution flow, including retry count. - // - // Since v2.4.0 Attempt int isMultiPart bool @@ -69,31 +67,36 @@ type Request struct { bodyBuf *bytes.Buffer clientTrace *clientTrace log Logger + multipartBoundary string multipartFiles []*File multipartFields []*MultipartField retryConditions []RetryConditionFunc + responseBodyLimit int + generateCurlOnDebug bool } -// Generate curl command for the request. +// GenerateCurlCommand method generates the CURL command for the request. func (r *Request) GenerateCurlCommand() string { + if !(r.Debug && r.generateCurlOnDebug) { + return "" + } + if r.resultCurlCmd != nil { return *r.resultCurlCmd - } else { - if r.RawRequest == nil { - r.client.executeBefore(r) // mock with r.Get("/") - } - if r.resultCurlCmd == nil { - r.resultCurlCmd = new(string) - } - if *r.resultCurlCmd == "" { - *r.resultCurlCmd = buildCurlRequest(r.RawRequest, r.client.httpClient.Jar) - } - return *r.resultCurlCmd } + + if r.RawRequest == nil { + r.client.executeBefore(r) // mock with r.Get("/") + } + if r.resultCurlCmd == nil { + r.resultCurlCmd = new(string) + } + *r.resultCurlCmd = buildCurlRequest(r.RawRequest, r.client.httpClient.Jar) + return *r.resultCurlCmd } -// Context method returns the Context if its already set in request -// otherwise it creates new one using `context.Background()`. +// Context method returns the Context if it is already set in the [Request] +// otherwise, it creates a new one using [context.Background]. func (r *Request) Context() context.Context { if r.ctx == nil { return context.Background() @@ -101,16 +104,16 @@ func (r *Request) Context() context.Context { return r.ctx } -// SetContext method sets the context.Context for current Request. It allows -// to interrupt the request execution if ctx.Done() channel is closed. -// See https://blog.golang.org/context article and the "context" package +// SetContext method sets the [context.Context] for current [Request]. It allows +// to interrupt the request execution if `ctx.Done()` channel is closed. +// See https://blog.golang.org/context article and the package [context] // documentation. func (r *Request) SetContext(ctx context.Context) *Request { r.ctx = ctx return r } -// SetHeader method is to set a single header field and its value in the current request. +// SetHeader method sets a single header field and its value in the current request. // // For Example: To set `Content-Type` and `Accept` as `application/json`. // @@ -118,13 +121,13 @@ func (r *Request) SetContext(ctx context.Context) *Request { // SetHeader("Content-Type", "application/json"). // SetHeader("Accept", "application/json") // -// Also you can override header value, which was set at client instance level. +// It overrides the header value set at the client instance level. func (r *Request) SetHeader(header, value string) *Request { r.Header.Set(header, value) return r } -// SetHeaders method sets multiple headers field and its values at one go in the current request. +// SetHeaders method sets multiple header fields and their values at one go in the current request. // // For Example: To set `Content-Type` and `Accept` as `application/json` // @@ -134,7 +137,7 @@ func (r *Request) SetHeader(header, value string) *Request { // "Accept": "application/json", // }) // -// Also you can override header value, which was set at client instance level. +// It overrides the header value set at the client instance level. func (r *Request) SetHeaders(headers map[string]string) *Request { for h, v := range headers { r.SetHeader(h, v) @@ -142,7 +145,7 @@ func (r *Request) SetHeaders(headers map[string]string) *Request { return r } -// SetHeaderMultiValues sets multiple headers fields and its values is list of strings at one go in the current request. +// SetHeaderMultiValues sets multiple header fields and their values as a list of strings in the current request. // // For Example: To set `Accept` as `text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8` // @@ -151,7 +154,7 @@ func (r *Request) SetHeaders(headers map[string]string) *Request { // "Accept": []string{"text/html", "application/xhtml+xml", "application/xml;q=0.9", "image/webp", "*/*;q=0.8"}, // }) // -// Also you can override header value, which was set at client instance level. +// It overrides the header value set at the client instance level. func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request { for key, values := range headers { r.SetHeader(key, strings.Join(values, ", ")) @@ -159,7 +162,7 @@ func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request { return r } -// SetHeaderVerbatim method is to set a single header field and its value verbatim in the current request. +// SetHeaderVerbatim method sets a single header field and its value verbatim in the current request. // // For Example: To set `all_lowercase` and `UPPERCASE` as `available`. // @@ -167,33 +170,31 @@ func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request { // SetHeaderVerbatim("all_lowercase", "available"). // SetHeaderVerbatim("UPPERCASE", "available") // -// Also you can override header value, which was set at client instance level. -// -// Since v2.6.0 +// It overrides the header value set at the client instance level. func (r *Request) SetHeaderVerbatim(header, value string) *Request { r.Header[header] = []string{value} return r } -// SetQueryParam method sets single parameter and its value in the current request. -// It will be formed as query string for the request. +// SetQueryParam method sets a single parameter and its value in the current request. +// It will be formed as a query string for the request. // -// For Example: `search=kitchen%20papers&size=large` in the URL after `?` mark. +// For Example: `search=kitchen%20papers&size=large` in the URL after the `?` mark. // // client.R(). // SetQueryParam("search", "kitchen papers"). // SetQueryParam("size", "large") // -// Also you can override query params value, which was set at client instance level. +// It overrides the query parameter value set at the client instance level. func (r *Request) SetQueryParam(param, value string) *Request { r.QueryParam.Set(param, value) return r } -// SetQueryParams method sets multiple parameters and its values at one go in the current request. -// It will be formed as query string for the request. +// SetQueryParams method sets multiple parameters and their values at one go in the current request. +// It will be formed as a query string for the request. // -// For Example: `search=kitchen%20papers&size=large` in the URL after `?` mark. +// For Example: `search=kitchen%20papers&size=large` in the URL after the `?` mark. // // client.R(). // SetQueryParams(map[string]string{ @@ -201,7 +202,7 @@ func (r *Request) SetQueryParam(param, value string) *Request { // "size": "large", // }) // -// Also you can override query params value, which was set at client instance level. +// It overrides the query parameter value set at the client instance level. func (r *Request) SetQueryParams(params map[string]string) *Request { for p, v := range params { r.SetQueryParam(p, v) @@ -210,17 +211,17 @@ func (r *Request) SetQueryParams(params map[string]string) *Request { } // SetQueryParamsFromValues method appends multiple parameters with multi-value -// (`url.Values`) at one go in the current request. It will be formed as +// ([url.Values]) at one go in the current request. It will be formed as // query string for the request. // -// For Example: `status=pending&status=approved&status=open` in the URL after `?` mark. +// For Example: `status=pending&status=approved&status=open` in the URL after the `?` mark. // // client.R(). // SetQueryParamsFromValues(url.Values{ // "status": []string{"pending", "approved", "open"}, // }) // -// Also you can override query params value, which was set at client instance level. +// It overrides the query parameter value set at the client instance level. func (r *Request) SetQueryParamsFromValues(params url.Values) *Request { for p, v := range params { for _, pv := range v { @@ -230,12 +231,12 @@ func (r *Request) SetQueryParamsFromValues(params url.Values) *Request { return r } -// SetQueryString method provides ability to use string as an input to set URL query string for the request. -// -// Using String as an input +// SetQueryString method provides the ability to use string as an input to set URL query string for the request. // // client.R(). // SetQueryString("productId=232&template=fresh-sample&cat=resty&source=google&kw=buy a lot more") +// +// It overrides the query parameter value set at the client instance level. func (r *Request) SetQueryString(query string) *Request { params, err := url.ParseQuery(strings.TrimSpace(query)) if err == nil { @@ -250,9 +251,9 @@ func (r *Request) SetQueryString(query string) *Request { return r } -// SetFormData method sets Form parameters and their values in the current request. -// It's applicable only HTTP method `POST` and `PUT` and requests content type would be set as -// `application/x-www-form-urlencoded`. +// SetFormData method sets Form parameters and their values for the current request. +// It applies only to HTTP methods `POST` and `PUT`, and by default requests +// content type would be set as `application/x-www-form-urlencoded`. // // client.R(). // SetFormData(map[string]string{ @@ -260,7 +261,7 @@ func (r *Request) SetQueryString(query string) *Request { // "user_id": "3455454545", // }) // -// Also you can override form data value, which was set at client instance level. +// It overrides the form data value set at the client instance level. func (r *Request) SetFormData(data map[string]string) *Request { for k, v := range data { r.FormData.Set(k, v) @@ -269,14 +270,14 @@ func (r *Request) SetFormData(data map[string]string) *Request { } // SetFormDataFromValues method appends multiple form parameters with multi-value -// (`url.Values`) at one go in the current request. +// ([url.Values]) at one go in the current request. // // client.R(). // SetFormDataFromValues(url.Values{ // "search_criteria": []string{"book", "glass", "pencil"}, // }) // -// Also you can override form data value, which was set at client instance level. +// It overrides the form data value set at the client instance level. func (r *Request) SetFormDataFromValues(data url.Values) *Request { for k, v := range data { for _, kv := range v { @@ -286,14 +287,17 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request { return r } -// SetBody method sets the request body for the request. It supports various realtime needs as easy. -// We can say its quite handy or powerful. Supported request body data types is `string`, -// `[]byte`, `struct`, `map`, `slice` and `io.Reader`. Body value can be pointer or non-pointer. -// Automatic marshalling for JSON and XML content type, if it is `struct`, `map`, or `slice`. +// SetBody method sets the request body for the request. It supports various practical needs as easy. +// It's quite handy and powerful. Supported request body data types are `string`, +// `[]byte`, `struct`, `map`, `slice` and [io.Reader]. +// +// Body value can be pointer or non-pointer. Automatic marshalling for JSON and XML content type, if it is `struct`, `map`, or `slice`. +// +// NOTE: [io.Reader] is processed in bufferless mode while sending a request. // -// Note: `io.Reader` is processed as bufferless mode while sending request. +// For Example: // -// For Example: Struct as a body input, based on content type, it will be marshalled. +// `struct` gets marshaled based on the request header `Content-Type`. // // client.R(). // SetBody(User{ @@ -301,7 +305,7 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request { // Password: "welcome2resty", // }) // -// Map as a body input, based on content type, it will be marshalled. +// 'map` gets marshaled based on the request header `Content-Type`. // // client.R(). // SetBody(map[string]interface{}{ @@ -316,7 +320,7 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request { // }, // }) // -// String as a body input. Suitable for any need as a string input. +// `string` as a body input. Suitable for any need as a string input. // // client.R(). // SetBody(`{ @@ -324,27 +328,41 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request { // "password": "admin" // }`) // -// []byte as a body input. Suitable for raw request such as file upload, serialize & deserialize, etc. +// `[]byte` as a body input. Suitable for raw requests such as file upload, serialize & deserialize, etc. // // client.R(). // SetBody([]byte("This is my raw request, sent as-is")) +// +// and so on. func (r *Request) SetBody(body interface{}) *Request { r.Body = body return r } -// SetResult method is to register the response `Result` object for automatic unmarshalling for the request, -// if response status code is between 200 and 299 and content type either JSON or XML. +// SetResult method is to register the response `Result` object for automatic +// unmarshalling of the HTTP response if the response status code is +// between 200 and 299, and the content type is JSON or XML. +// +// Note: [Request.SetResult] input can be a pointer or non-pointer. +// +// The pointer with handle // -// Note: Result object can be pointer or non-pointer. +// authToken := &AuthToken{} +// client.R().SetResult(authToken) +// +// // Can be accessed via - +// fmt.Println(authToken) OR fmt.Println(response.Result().(*AuthToken)) +// +// OR - +// +// The pointer without handle or non-pointer // // client.R().SetResult(&AuthToken{}) // // OR // client.R().SetResult(AuthToken{}) // -// Accessing a result value from response instance. -// -// response.Result().(*AuthToken) +// // Can be accessed via - +// fmt.Println(response.Result().(*AuthToken)) func (r *Request) SetResult(res interface{}) *Request { if res != nil { r.Result = getPointer(res) @@ -353,23 +371,25 @@ func (r *Request) SetResult(res interface{}) *Request { } // SetError method is to register the request `Error` object for automatic unmarshalling for the request, -// if response status code is greater than 399 and content type either JSON or XML. +// if the response status code is greater than 399 and the content type is either JSON or XML. // -// Note: Error object can be pointer or non-pointer. +// NOTE: [Request.SetError] input can be a pointer or non-pointer. // // client.R().SetError(&AuthError{}) // // OR // client.R().SetError(AuthError{}) // -// Accessing a error value from response instance. +// Accessing an error value from response instance. // // response.Error().(*AuthError) +// +// If this request Error object is nil, Resty will use the client-level error object Type if it is set. func (r *Request) SetError(err interface{}) *Request { r.Error = getPointer(err) return r } -// SetFile method is to set single file field name and its path for multipart upload. +// SetFile method sets a single file field name and its path for multipart upload. // // client.R(). // SetFile("my_file", "/Users/jeeva/Gas Bill - Sep.pdf") @@ -379,7 +399,7 @@ func (r *Request) SetFile(param, filePath string) *Request { return r } -// SetFiles method is to set multiple file field name and its path for multipart upload. +// SetFiles method sets multiple file field names and their paths for multipart uploads. // // client.R(). // SetFiles(map[string]string{ @@ -395,7 +415,7 @@ func (r *Request) SetFiles(files map[string]string) *Request { return r } -// SetFileReader method is to set single file using io.Reader for multipart upload. +// SetFileReader method is to set a file using [io.Reader] for multipart upload. // // client.R(). // SetFileReader("profile_img", "my-profile-img.png", bytes.NewReader(profileImgBytes)). @@ -410,7 +430,8 @@ func (r *Request) SetFileReader(param, fileName string, reader io.Reader) *Reque return r } -// SetMultipartFormData method allows simple form data to be attached to the request as `multipart:form-data` +// SetMultipartFormData method allows simple form data to be attached to the request +// as `multipart:form-data` func (r *Request) SetMultipartFormData(data map[string]string) *Request { for k, v := range data { r = r.SetMultipartField(k, "", "", strings.NewReader(v)) @@ -419,7 +440,7 @@ func (r *Request) SetMultipartFormData(data map[string]string) *Request { return r } -// SetMultipartField method is to set custom data using io.Reader for multipart upload. +// SetMultipartField method sets custom data with Content-Type using [io.Reader] for multipart upload. func (r *Request) SetMultipartField(param, fileName, contentType string, reader io.Reader) *Request { r.isMultiPart = true r.multipartFields = append(r.multipartFields, &MultipartField{ @@ -431,7 +452,7 @@ func (r *Request) SetMultipartField(param, fileName, contentType string, reader return r } -// SetMultipartFields method is to set multiple data fields using io.Reader for multipart upload. +// SetMultipartFields method sets multiple data fields using [io.Reader] for multipart upload. // // For Example: // @@ -449,7 +470,7 @@ func (r *Request) SetMultipartField(param, fileName, contentType string, reader // Reader: strings.NewReader(`{"input": {"name": "Uploaded document 2", "_filename" : ["file2.txt"]}}`), // }) // -// If you have slice already, then simply call- +// If you have a `slice` of fields already, then call- // // client.R().SetMultipartFields(fields...) func (r *Request) SetMultipartFields(fields ...*MultipartField) *Request { @@ -458,13 +479,21 @@ func (r *Request) SetMultipartFields(fields ...*MultipartField) *Request { return r } -// SetContentLength method sets the HTTP header `Content-Length` value for current request. -// By default Resty won't set `Content-Length`. Also you have an option to enable for every -// request. +// SetMultipartBoundary method sets the custom multipart boundary for the multipart request. +// Typically, the `mime/multipart` package generates a random multipart boundary if not provided. +func (r *Request) SetMultipartBoundary(boundary string) *Request { + r.multipartBoundary = boundary + return r +} + +// SetContentLength method sets the current request's HTTP header `Content-Length` value. +// By default, Resty won't set `Content-Length`. // -// See `Client.SetContentLength` +// See [Client.SetContentLength] // // client.R().SetContentLength(true) +// +// It overrides the value set at the client instance level. func (r *Request) SetContentLength(l bool) *Request { r.setContentLength = l return r @@ -480,7 +509,7 @@ func (r *Request) SetContentLength(l bool) *Request { // // client.R().SetBasicAuth("go-resty", "welcome") // -// This method overrides the credentials set by method `Client.SetBasicAuth`. +// It overrides the credentials set by method [Client.SetBasicAuth]. func (r *Request) SetBasicAuth(username, password string) *Request { r.UserInfo = &User{Username: username, Password: password} return r @@ -494,13 +523,15 @@ func (r *Request) SetBasicAuth(username, password string) *Request { // // client.R().SetAuthToken("BC594900518B4F7EAC75BD37F019E08FBC594900518B4F7EAC75BD37F019E08F") // -// This method overrides the Auth token set by method `Client.SetAuthToken`. +// It overrides the Auth token set by method [Client.SetAuthToken]. func (r *Request) SetAuthToken(token string) *Request { r.Token = token return r } -// SetAuthScheme method sets the auth token scheme type in the HTTP request. For Example: +// SetAuthScheme method sets the auth token scheme type in the HTTP request. +// +// Example Header value structure: // // Authorization: // @@ -508,33 +539,33 @@ func (r *Request) SetAuthToken(token string) *Request { // // client.R().SetAuthScheme("OAuth") // -// This auth header scheme gets added to all the request raised from this client instance. -// Also it can be overridden or set one at the request level is supported. +// // The outcome will be - +// Authorization: OAuth // -// Information about Auth schemes can be found in RFC7235 which is linked to below along with the page containing -// the currently defined official authentication schemes: +// Information about Auth schemes can be found in [RFC 7235], IANA [HTTP Auth schemes] // -// https://tools.ietf.org/html/rfc7235 -// https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes +// It overrides the `Authorization` scheme set by method [Client.SetAuthScheme]. // -// This method overrides the Authorization scheme set by method `Client.SetAuthScheme`. +// [RFC 7235]: https://tools.ietf.org/html/rfc7235 +// [HTTP Auth schemes]: https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes func (r *Request) SetAuthScheme(scheme string) *Request { r.AuthScheme = scheme return r } -// SetDigestAuth method sets the Digest Access auth scheme for the HTTP request. If a server responds with 401 and sends -// a Digest challenge in the WWW-Authenticate Header, the request will be resent with the appropriate Authorization Header. +// SetDigestAuth method sets the Digest Access auth scheme for the HTTP request. +// If a server responds with 401 and sends a Digest challenge in the WWW-Authenticate Header, +// the request will be resent with the appropriate Authorization Header. // // For Example: To set the Digest scheme with username "Mufasa" and password "Circle Of Life" // // client.R().SetDigestAuth("Mufasa", "Circle Of Life") // -// Information about Digest Access Authentication can be found in RFC7616: +// Information about Digest Access Authentication can be found in [RFC 7616] // -// https://datatracker.ietf.org/doc/html/rfc7616 +// It overrides the digest username and password set by method [Client.SetDigestAuth]. // -// This method overrides the username and password set by method `Client.SetDigestAuth`. +// [RFC 7616]: https://datatracker.ietf.org/doc/html/rfc7616 func (r *Request) SetDigestAuth(username, password string) *Request { oldTransport := r.client.httpClient.Transport r.client.OnBeforeRequest(func(c *Client, _ *Request) error { @@ -552,16 +583,19 @@ func (r *Request) SetDigestAuth(username, password string) *Request { return r } -// SetOutput method sets the output file for current HTTP request. Current HTTP response will be -// saved into given file. It is similar to `curl -o` flag. Absolute path or relative path can be used. -// If is it relative path then output file goes under the output directory, as mentioned -// in the `Client.SetOutputDirectory`. +// SetOutput method sets the output file for the current HTTP request. The current +// HTTP response will be saved in the given file. It is similar to the `curl -o` flag. +// +// Absolute path or relative path can be used. +// +// If it is a relative path, then the output file goes under the output directory, as mentioned +// in the [Client.SetOutputDirectory]. // // client.R(). // SetOutput("/Users/jeeva/Downloads/ReplyWithHeader-v5.1-beta.zip"). // Get("http://bit.ly/1LouEKr") // -// Note: In this scenario `Response.Body` might be nil. +// NOTE: In this scenario [Response.Body] might be nil. func (r *Request) SetOutput(file string) *Request { r.outputFile = file r.isSaveResponse = true @@ -579,18 +613,35 @@ func (r *Request) SetSRV(srv *SRVRecord) *Request { return r } -// SetDoNotParseResponse method instructs `Resty` not to parse the response body automatically. -// Resty exposes the raw response body as `io.ReadCloser`. Also do not forget to close the body, -// otherwise you might get into connection leaks, no connection reuse. +// SetDoNotParseResponse method instructs Resty not to parse the response body automatically. +// Resty exposes the raw response body as [io.ReadCloser]. If you use it, do not +// forget to close the body, otherwise, you might get into connection leaks, and connection +// reuse may not happen. // -// Note: Response middlewares are not applicable, if you use this option. Basically you have -// taken over the control of response parsing from `Resty`. +// NOTE: [Response] middlewares are not executed using this option. You have +// taken over the control of response parsing from Resty. func (r *Request) SetDoNotParseResponse(parse bool) *Request { r.notParseResponse = parse return r } -// SetPathParam method sets single URL path key-value pair in the +// SetResponseBodyLimit method sets a maximum body size limit in bytes on response, +// avoid reading too much data to memory. +// +// Client will return [resty.ErrResponseBodyTooLarge] if the body size of the body +// in the uncompressed response is larger than the limit. +// Body size limit will not be enforced in the following cases: +// - ResponseBodyLimit <= 0, which is the default behavior. +// - [Request.SetOutput] is called to save response data to the file. +// - "DoNotParseResponse" is set for client or request. +// +// It overrides the value set at the client instance level. see [Client.SetResponseBodyLimit] +func (r *Request) SetResponseBodyLimit(v int) *Request { + r.responseBodyLimit = v + return r +} + +// SetPathParam method sets a single URL path key-value pair in the // Resty current request instance. // // client.R().SetPathParam("userId", "sample@sample.com") @@ -606,10 +657,9 @@ func (r *Request) SetDoNotParseResponse(parse bool) *Request { // Composed URL - /v1/users/groups%2Fdevelopers/details // // It replaces the value of the key while composing the request URL. -// The values will be escaped using `url.PathEscape` function. +// The values will be escaped using function [url.PathEscape]. // -// Also you can override Path Params value, which was set at client instance -// level. +// It overrides the path parameter set at the client instance level. func (r *Request) SetPathParam(param, value string) *Request { r.PathParams[param] = value return r @@ -628,11 +678,10 @@ func (r *Request) SetPathParam(param, value string) *Request { // URL - /v1/users/{userId}/{subAccountId}/{path}/details // Composed URL - /v1/users/sample@sample.com/100002/groups%2Fdevelopers/details // -// It replaces the value of the key while composing request URL. -// The value will be used as it is and will not be escaped. +// It replaces the value of the key while composing the request URL. +// The values will be escaped using function [url.PathEscape]. // -// Also you can override Path Params value, which was set at client instance -// level. +// It overrides the path parameter set at the client instance level. func (r *Request) SetPathParams(params map[string]string) *Request { for p, v := range params { r.SetPathParam(p, v) @@ -640,7 +689,7 @@ func (r *Request) SetPathParams(params map[string]string) *Request { return r } -// SetRawPathParam method sets single URL path key-value pair in the +// SetRawPathParam method sets a single URL path key-value pair in the // Resty current request instance. // // client.R().SetPathParam("userId", "sample@sample.com") @@ -656,12 +705,9 @@ func (r *Request) SetPathParams(params map[string]string) *Request { // Composed URL - /v1/users/groups/developers/details // // It replaces the value of the key while composing the request URL. -// The value will be used as it is and will not be escaped. +// The value will be used as-is and has not been escaped. // -// Also you can override Path Params value, which was set at client instance -// level. -// -// Since v2.8.0 +// It overrides the raw path parameter set at the client instance level. func (r *Request) SetRawPathParam(param, value string) *Request { r.RawPathParams[param] = value return r @@ -680,13 +726,10 @@ func (r *Request) SetRawPathParam(param, value string) *Request { // URL - /v1/users/{userId}/{subAccountId}/{path}/details // Composed URL - /v1/users/sample@sample.com/100002/groups/developers/details // -// It replaces the value of the key while composing request URL. -// The values will be used as they are and will not be escaped. -// -// Also you can override Path Params value, which was set at client instance -// level. +// It replaces the value of the key while composing the request URL. +// The value will be used as-is and has not been escaped. // -// Since v2.8.0 +// It overrides the raw path parameter set at the client instance level. func (r *Request) SetRawPathParams(params map[string]string) *Request { for p, v := range params { r.SetRawPathParam(p, v) @@ -695,23 +738,29 @@ func (r *Request) SetRawPathParams(params map[string]string) *Request { } // ExpectContentType method allows to provide fallback `Content-Type` for automatic unmarshalling -// when `Content-Type` response header is unavailable. +// when the `Content-Type` response header is unavailable. func (r *Request) ExpectContentType(contentType string) *Request { r.fallbackContentType = contentType return r } -// ForceContentType method provides a strong sense of response `Content-Type` for automatic unmarshalling. -// Resty gives this a higher priority than the `Content-Type` response header. This means that if both -// `Request.ForceContentType` is set and the response `Content-Type` is available, `ForceContentType` will win. +// ForceContentType method provides a strong sense of response `Content-Type` for +// automatic unmarshalling. Resty gives this a higher priority than the `Content-Type` +// response header. +// +// This means that if both [Request.ForceContentType] is set and +// the response `Content-Type` is available, `ForceContentType` will win. func (r *Request) ForceContentType(contentType string) *Request { r.forceContentType = contentType return r } -// SetJSONEscapeHTML method is to enable/disable the HTML escape on JSON marshal. +// SetJSONEscapeHTML method enables or disables the HTML escape on JSON marshal. +// By default, escape HTML is false. // -// Note: This option only applicable to standard JSON Marshaller. +// NOTE: This option only applies to the standard JSON Marshaller used by Resty. +// +// It overrides the value set at the client instance level, see [Client.SetJSONEscapeHTML] func (r *Request) SetJSONEscapeHTML(b bool) *Request { r.jsonEscapeHTML = b return r @@ -724,9 +773,7 @@ func (r *Request) SetJSONEscapeHTML(b bool) *Request { // Value:"This is cookie value", // }) // -// Note: Method appends the Cookie value into existing Cookie if already existing. -// -// Since v2.1.0 +// NOTE: Method appends the Cookie value into existing Cookie even if its already existing. func (r *Request) SetCookie(hc *http.Cookie) *Request { r.Cookies = append(r.Cookies, hc) return r @@ -748,9 +795,7 @@ func (r *Request) SetCookie(hc *http.Cookie) *Request { // // Setting a cookies into resty's current request // client.R().SetCookies(cookies) // -// Note: Method appends the Cookie value into existing Cookie if already existing. -// -// Since v2.1.0 +// NOTE: Method appends the Cookie value into existing Cookie even if its already existing. func (r *Request) SetCookies(rs []*http.Cookie) *Request { r.Cookies = append(r.Cookies, rs...) return r @@ -759,30 +804,35 @@ func (r *Request) SetCookies(rs []*http.Cookie) *Request { // SetLogger method sets given writer for logging Resty request and response details. // By default, requests and responses inherit their logger from the client. // -// Compliant to interface `resty.Logger`. +// Compliant to interface [resty.Logger]. +// +// It overrides the logger value set at the client instance level. func (r *Request) SetLogger(l Logger) *Request { r.log = l return r } -// SetDebug method enables the debug mode on current request Resty request, It logs +// SetDebug method enables the debug mode on the current request. It logs // the details current request and response. -// For `Request` it logs information such as HTTP verb, Relative URL path, Host, Headers, Body if it has one. -// For `Response` it logs information such as Status, Response Time, Headers, Body if it has one. // -// client.R().SetDebug(true) +// client.SetDebug(true) +// +// Also, it can be enabled at the request level for a particular request; see [Request.SetDebug]. +// - For [Request], it logs information such as HTTP verb, Relative URL path, +// Host, Headers, and Body if it has one. +// - For [Response], it logs information such as Status, Response Time, Headers, +// and Body if it has one. func (r *Request) SetDebug(d bool) *Request { r.Debug = d return r } // AddRetryCondition method adds a retry condition function to the request's -// array of functions that are checked to determine if the request is retried. -// The request will retry if any of the functions return true and error is nil. +// array of functions is checked to determine if the request can be retried. +// The request will retry if any functions return true and the error is nil. // -// Note: These retry conditions are checked before all retry conditions of the client. -// -// Since v2.7.0 +// NOTE: The request level retry conditions are checked before all retry +// conditions from the client instance. func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request { r.retryConditions = append(r.retryConditions, condition) return r @@ -793,7 +843,7 @@ func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request { //_______________________________________________________________________ // EnableTrace method enables trace for the current request -// using `httptrace.ClientTrace` and provides insights. +// using [httptrace.ClientTrace] and provides insights. // // client := resty.New() // @@ -801,19 +851,33 @@ func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request { // fmt.Println("Error:", err) // fmt.Println("Trace Info:", resp.Request.TraceInfo()) // -// See `Client.EnableTrace` available too to get trace info for all requests. -// -// Since v2.0.0 +// See [Client.EnableTrace] is also available to get trace info for all requests. func (r *Request) EnableTrace() *Request { r.trace = true return r } -// TraceInfo method returns the trace info for the request. -// If either the Client or Request EnableTrace function has not been called -// prior to the request being made, an empty TraceInfo object will be returned. +// EnableGenerateCurlOnDebug method enables the generation of CURL commands in the debug log. +// It works in conjunction with debug mode. It overrides the options set by the [Client]. // -// Since v2.0.0 +// NOTE: Use with care. +// - Potential to leak sensitive data from [Request] and [Response] in the debug log. +// - Beware of memory usage since the request body is reread. +func (r *Request) EnableGenerateCurlOnDebug() *Request { + r.generateCurlOnDebug = true + return r +} + +// DisableGenerateCurlOnDebug method disables the option set by [Request.EnableGenerateCurlOnDebug]. +// It overrides the options set by the [Client]. +func (r *Request) DisableGenerateCurlOnDebug() *Request { + r.generateCurlOnDebug = false + return r +} + +// TraceInfo method returns the trace info for the request. +// If either the [Client.EnableTrace] or [Request.EnableTrace] function has not been called +// before the request is made, an empty [resty.TraceInfo] object is returned. func (r *Request) TraceInfo() TraceInfo { ct := r.clientTrace @@ -902,7 +966,7 @@ func (r *Request) Patch(url string) (*Response, error) { } // Send method performs the HTTP request using the method and URL already defined -// for current `Request`. +// for current [Request]. // // req := client.R() // req.Method = resty.MethodGet @@ -912,8 +976,8 @@ func (r *Request) Send() (*Response, error) { return r.Execute(r.Method, r.URL) } -// Execute method performs the HTTP request with given HTTP method and URL -// for current `Request`. +// Execute method performs the HTTP request with the given HTTP method and URL +// for current [Request]. // // resp, err := client.R().Execute(resty.MethodGet, "http://httpbin.org/get") func (r *Request) Execute(method, url string) (*Response, error) { @@ -997,10 +1061,6 @@ type SRVRecord struct { Domain string } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Request Unexported methods -//_______________________________________________________________________ - func (r *Request) fmtBodyString(sl int64) (body string) { body = "***** NO CONTENT *****" if !isPayloadSupported(r.Method, r.client.AllowGetMethodPayload) { diff --git a/vendor/github.com/go-resty/resty/v2/response.go b/vendor/github.com/go-resty/resty/v2/response.go index 58a8e8169d..f52b5c61ff 100644 --- a/vendor/github.com/go-resty/resty/v2/response.go +++ b/vendor/github.com/go-resty/resty/v2/response.go @@ -17,7 +17,7 @@ import ( // Response struct and methods //_______________________________________________________________________ -// Response struct holds response values of executed request. +// Response struct holds response values of executed requests. type Response struct { Request *Request RawResponse *http.Response @@ -27,9 +27,10 @@ type Response struct { receivedAt time.Time } -// Body method returns HTTP response as []byte array for the executed request. +// Body method returns the HTTP response as `[]byte` slice for the executed request. // -// Note: `Response.Body` might be nil, if `Request.SetOutput` is used. +// NOTE: [Response.Body] might be nil if [Request.SetOutput] is used. +// Also see [Request.SetDoNotParseResponse], [Client.SetDoNotParseResponse] func (r *Response) Body() []byte { if r.RawResponse == nil { return []byte{} @@ -37,13 +38,11 @@ func (r *Response) Body() []byte { return r.body } -// SetBody method is to set Response body in byte slice. Typically, -// its helpful for test cases. +// SetBody method sets [Response] body in byte slice. Typically, +// It is helpful for test cases. // // resp.SetBody([]byte("This is test body content")) // resp.SetBody(nil) -// -// Since v2.10.0 func (r *Response) SetBody(b []byte) *Response { r.body = b return r @@ -78,11 +77,15 @@ func (r *Response) Proto() string { } // Result method returns the response value as an object if it has one +// +// See [Request.SetResult] func (r *Response) Result() interface{} { return r.Request.Result } // Error method returns the error object if it has one +// +// See [Request.SetError], [Client.SetError] func (r *Response) Error() interface{} { return r.Request.Error } @@ -95,7 +98,7 @@ func (r *Response) Header() http.Header { return r.RawResponse.Header } -// Cookies method to access all the response cookies +// Cookies method to returns all the response cookies func (r *Response) Cookies() []*http.Cookie { if r.RawResponse == nil { return make([]*http.Cookie, 0) @@ -103,7 +106,8 @@ func (r *Response) Cookies() []*http.Cookie { return r.RawResponse.Cookies() } -// String method returns the body of the server response as String. +// String method returns the body of the HTTP response as a `string`. +// It returns an empty string if it is nil or the body is zero length. func (r *Response) String() string { if len(r.body) == 0 { return "" @@ -111,10 +115,11 @@ func (r *Response) String() string { return strings.TrimSpace(string(r.body)) } -// Time method returns the time of HTTP response time that from request we sent and received a request. +// Time method returns the duration of HTTP response time from the request we sent +// and received a request. // -// See `Response.ReceivedAt` to know when client received response and see `Response.Request.Time` to know -// when client sent a request. +// See [Response.ReceivedAt] to know when the client received a response and see +// `Response.Request.Time` to know when the client sent a request. func (r *Response) Time() time.Duration { if r.Request.clientTrace != nil { return r.Request.TraceInfo().TotalTime @@ -122,23 +127,25 @@ func (r *Response) Time() time.Duration { return r.receivedAt.Sub(r.Request.Time) } -// ReceivedAt method returns when response got received from server for the request. +// ReceivedAt method returns the time we received a response from the server for the request. func (r *Response) ReceivedAt() time.Time { return r.receivedAt } -// Size method returns the HTTP response size in bytes. Ya, you can relay on HTTP `Content-Length` header, -// however it won't be good for chucked transfer/compressed response. Since Resty calculates response size -// at the client end. You will get actual size of the http response. +// Size method returns the HTTP response size in bytes. Yeah, you can rely on HTTP `Content-Length` +// header, however it won't be available for chucked transfer/compressed response. +// Since Resty captures response size details when processing the response body +// when possible. So that users get the actual size of response bytes. func (r *Response) Size() int64 { return r.size } -// RawBody method exposes the HTTP raw response body. Use this method in-conjunction with `SetDoNotParseResponse` -// option otherwise you get an error as `read err: http: read on closed response body`. +// RawBody method exposes the HTTP raw response body. Use this method in conjunction with +// [Client.SetDoNotParseResponse] or [Request.SetDoNotParseResponse] +// option; otherwise, you get an error as `read err: http: read on closed response body.` // // Do not forget to close the body, otherwise you might get into connection leaks, no connection reuse. -// Basically you have taken over the control of response parsing from `Resty`. +// You have taken over the control of response parsing from Resty. func (r *Response) RawBody() io.ReadCloser { if r.RawResponse == nil { return nil @@ -156,10 +163,6 @@ func (r *Response) IsError() bool { return r.StatusCode() > 399 } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Response Unexported methods -//_______________________________________________________________________ - func (r *Response) setReceivedAt() { r.receivedAt = time.Now() if r.Request.clientTrace != nil { @@ -168,6 +171,9 @@ func (r *Response) setReceivedAt() { } func (r *Response) fmtBodyString(sl int64) string { + if r.Request.client.notParseResponse || r.Request.notParseResponse { + return "***** DO NOT PARSE RESPONSE - Enabled *****" + } if len(r.body) > 0 { if int64(len(r.body)) > sl { return fmt.Sprintf("***** RESPONSE TOO LARGE (size - %d) *****", len(r.body)) diff --git a/vendor/github.com/go-resty/resty/v2/resty.go b/vendor/github.com/go-resty/resty/v2/resty.go index 7458af76c0..243df6e91c 100644 --- a/vendor/github.com/go-resty/resty/v2/resty.go +++ b/vendor/github.com/go-resty/resty/v2/resty.go @@ -14,7 +14,7 @@ import ( ) // Version # of resty -const Version = "2.14.0" +const Version = "2.15.1" // New method creates a new Resty client. func New() *Client { @@ -24,12 +24,12 @@ func New() *Client { }) } -// NewWithClient method creates a new Resty client with given `http.Client`. +// NewWithClient method creates a new Resty client with given [http.Client]. func NewWithClient(hc *http.Client) *Client { return createClient(hc) } -// NewWithLocalAddr method creates a new Resty client with given Local Address +// NewWithLocalAddr method creates a new Resty client with the given Local Address. // to dial from. func NewWithLocalAddr(localAddr net.Addr) *Client { cookieJar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List}) diff --git a/vendor/github.com/go-resty/resty/v2/retry.go b/vendor/github.com/go-resty/resty/v2/retry.go index 932a266dc6..416107e4bb 100644 --- a/vendor/github.com/go-resty/resty/v2/retry.go +++ b/vendor/github.com/go-resty/resty/v2/retry.go @@ -23,7 +23,7 @@ type ( // Option is to create convenient retry options like wait time, max retries, etc. Option func(*Options) - // RetryConditionFunc type is for retry condition function + // RetryConditionFunc type is for the retry condition function // input: non-nil Response OR request execution error RetryConditionFunc func(*Response, error) bool @@ -33,8 +33,8 @@ type ( // RetryAfterFunc returns time to wait before retry // For example, it can parse HTTP Retry-After header // https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - // Non-nil error is returned if it is found that request is not retryable - // (0, nil) is a special result means 'use default algorithm' + // Non-nil error is returned if it is found that the request is not retryable + // (0, nil) is a special result that means 'use default algorithm' RetryAfterFunc func(*Client, *Response) (time.Duration, error) // Options struct is used to hold retry settings. @@ -69,7 +69,7 @@ func MaxWaitTime(value time.Duration) Option { } } -// RetryConditions sets the conditions that will be checked for retry. +// RetryConditions sets the conditions that will be checked for retry func RetryConditions(conditions []RetryConditionFunc) Option { return func(o *Options) { o.retryConditions = conditions @@ -84,7 +84,7 @@ func RetryHooks(hooks []OnRetryFunc) Option { } // ResetMultipartReaders sets a boolean value which will lead the start being seeked out -// on all multipart file readers, if they implement io.ReadSeeker +// on all multipart file readers if they implement [io.ReadSeeker] func ResetMultipartReaders(value bool) Option { return func(o *Options) { o.resetReaders = value @@ -202,7 +202,7 @@ func sleepDuration(resp *Response, min, max time.Duration, attempt int) (time.Du } // Return capped exponential backoff with jitter -// http://www.awsarchitectureblog.com/2015/03/backoff.html +// https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ func jitterBackoff(min, max time.Duration, attempt int) time.Duration { base := float64(min) capLevel := float64(max) diff --git a/vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel b/vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel new file mode 100644 index 0000000000..fe829e3970 --- /dev/null +++ b/vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "shellescape", + srcs = ["shellescape.go"], + importpath = "github.com/go-resty/resty/v2/shellescape", + visibility = ["//visibility:public"], +) + +alias( + name = "go_default_library", + actual = ":shellescape", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go b/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go index 5e6a379906..1e835cb3b7 100644 --- a/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go +++ b/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go @@ -1,5 +1,11 @@ +// Copyright (c) 2015-present Jeevanandam M (jeeva@myjeeva.com) +// 2024 Ahuigo (https://github.com/ahuigo) +// All rights reserved. +// resty source code and usage is governed by a MIT style +// license that can be found in the LICENSE file. + /* -Package shellescape provides the shellescape.Quote to escape arbitrary +Package shellescape provides the methods to escape arbitrary strings for a safe use as command line arguments in the most common POSIX shells. @@ -19,8 +25,8 @@ func init() { pattern = regexp.MustCompile(`[^\w@%+=:,./-]`) } -// Quote returns a shell-escaped version of the string s. The returned value -// is a string that can safely be used as one token in a shell command line. +// Quote method returns a shell-escaped version of the string. The returned value +// can safely be used as one token in a shell command line. func Quote(s string) string { if len(s) == 0 { return "''" diff --git a/vendor/github.com/go-resty/resty/v2/trace.go b/vendor/github.com/go-resty/resty/v2/trace.go index 7798a395d9..226bfbffcb 100644 --- a/vendor/github.com/go-resty/resty/v2/trace.go +++ b/vendor/github.com/go-resty/resty/v2/trace.go @@ -16,32 +16,30 @@ import ( // TraceInfo struct //_______________________________________________________________________ -// TraceInfo struct is used provide request trace info such as DNS lookup +// TraceInfo struct is used to provide request trace info such as DNS lookup // duration, Connection obtain duration, Server processing duration, etc. -// -// Since v2.0.0 type TraceInfo struct { - // DNSLookup is a duration that transport took to perform + // DNSLookup is the duration that transport took to perform // DNS lookup. DNSLookup time.Duration - // ConnTime is a duration that took to obtain a successful connection. + // ConnTime is the duration it took to obtain a successful connection. ConnTime time.Duration - // TCPConnTime is a duration that took to obtain the TCP connection. + // TCPConnTime is the duration it took to obtain the TCP connection. TCPConnTime time.Duration - // TLSHandshake is a duration that TLS handshake took place. + // TLSHandshake is the duration of the TLS handshake. TLSHandshake time.Duration - // ServerTime is a duration that server took to respond first byte. + // ServerTime is the server's duration for responding to the first byte. ServerTime time.Duration - // ResponseTime is a duration since first response byte from server to + // ResponseTime is the duration since the first response byte from the server to // request completion. ResponseTime time.Duration - // TotalTime is a duration that total request took end-to-end. + // TotalTime is the duration of the total time request taken end-to-end. TotalTime time.Duration // IsConnReused is whether this connection has been previously @@ -52,7 +50,7 @@ type TraceInfo struct { // idle pool. IsConnWasIdle bool - // ConnIdleTime is a duration how long the connection was previously + // ConnIdleTime is the duration how long the connection that was previously // idle, if IsConnWasIdle is true. ConnIdleTime time.Duration @@ -68,9 +66,9 @@ type TraceInfo struct { // ClientTrace struct and its methods //_______________________________________________________________________ -// tracer struct maps the `httptrace.ClientTrace` hooks into Fields -// with same naming for easy understanding. Plus additional insights -// Request. +// clientTrace struct maps the [httptrace.ClientTrace] hooks into Fields +// with the same naming for easy understanding. Plus additional insights +// [Request]. type clientTrace struct { getConn time.Time dnsStart time.Time @@ -84,10 +82,6 @@ type clientTrace struct { gotConnInfo httptrace.GotConnInfo } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Trace unexported methods -//_______________________________________________________________________ - func (t *clientTrace) createContext(ctx context.Context) context.Context { return httptrace.WithClientTrace( ctx, diff --git a/vendor/github.com/go-resty/resty/v2/util.go b/vendor/github.com/go-resty/resty/v2/util.go index 7bbba912d1..812dce3d41 100644 --- a/vendor/github.com/go-resty/resty/v2/util.go +++ b/vendor/github.com/go-resty/resty/v2/util.go @@ -145,10 +145,6 @@ type ResponseLog struct { Body string } -//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -// Package Unexported methods -//_______________________________________________________________________ - // way to disable the HTML escape as opt-in func jsonMarshal(c *Client, r *Request, d interface{}) (*bytes.Buffer, error) { if !r.jsonEscapeHTML || !c.jsonEscapeHTML { diff --git a/vendor/github.com/go-resty/resty/v2/util_curl.go b/vendor/github.com/go-resty/resty/v2/util_curl.go index e50c3b3a69..2bd91270a6 100644 --- a/vendor/github.com/go-resty/resty/v2/util_curl.go +++ b/vendor/github.com/go-resty/resty/v2/util_curl.go @@ -14,6 +14,7 @@ import ( func buildCurlRequest(req *http.Request, httpCookiejar http.CookieJar) (curl string) { // 1. Generate curl raw headers + curl = "curl -X " + req.Method + " " // req.Host + req.URL.Path + "?" + req.URL.RawQuery + " " + req.Proto + " " headers := dumpCurlHeaders(req) @@ -22,6 +23,7 @@ func buildCurlRequest(req *http.Request, httpCookiejar http.CookieJar) (curl str } // 2. Generate curl cookies + // TODO validate this block of code, I think its not required since cookie captured via Headers if cookieJar, ok := httpCookiejar.(*cookiejar.Jar); ok { cookies := cookieJar.Cookies(req.URL) if len(cookies) > 0 { diff --git a/vendor/github.com/google/pprof/profile/profile.go b/vendor/github.com/google/pprof/profile/profile.go index 0983656c20..f47a243903 100644 --- a/vendor/github.com/google/pprof/profile/profile.go +++ b/vendor/github.com/google/pprof/profile/profile.go @@ -849,7 +849,7 @@ func (p *Profile) HasFileLines() bool { // Unsymbolizable returns true if a mapping points to a binary for which // locations can't be symbolized in principle, at least now. Examples are -// "[vdso]", [vsyscall]" and some others, see the code. +// "[vdso]", "[vsyscall]" and some others, see the code. func (m *Mapping) Unsymbolizable() bool { name := filepath.Base(m.File) return strings.HasPrefix(name, "[") || strings.HasPrefix(name, "linux-vdso") || strings.HasPrefix(m.File, "/dev/dri/") || m.File == "//anon" diff --git a/vendor/github.com/pion/ice/v2/agent.go b/vendor/github.com/pion/ice/v2/agent.go index 82ee75bc38..c2718fc67d 100644 --- a/vendor/github.com/pion/ice/v2/agent.go +++ b/vendor/github.com/pion/ice/v2/agent.go @@ -1055,16 +1055,16 @@ func (a *Agent) invalidatePendingBindingRequests(filterTime time.Time) { // Assert that the passed TransactionID is in our pendingBindingRequests and returns the destination // If the bindingRequest was valid remove it from our pending cache -func (a *Agent) handleInboundBindingSuccess(id [stun.TransactionIDSize]byte) (bool, *bindingRequest) { +func (a *Agent) handleInboundBindingSuccess(id [stun.TransactionIDSize]byte) (bool, *bindingRequest, time.Duration) { a.invalidatePendingBindingRequests(time.Now()) for i := range a.pendingBindingRequests { if a.pendingBindingRequests[i].transactionID == id { validBindingRequest := a.pendingBindingRequests[i] a.pendingBindingRequests = append(a.pendingBindingRequests[:i], a.pendingBindingRequests[i+1:]...) - return true, &validBindingRequest + return true, &validBindingRequest, time.Since(validBindingRequest.timestamp) } } - return false, nil + return false, nil, 0 } // handleInbound processes STUN traffic from a remote candidate diff --git a/vendor/github.com/pion/ice/v2/agent_stats.go b/vendor/github.com/pion/ice/v2/agent_stats.go index b9ad7187e0..4366beeb08 100644 --- a/vendor/github.com/pion/ice/v2/agent_stats.go +++ b/vendor/github.com/pion/ice/v2/agent_stats.go @@ -29,14 +29,14 @@ func (a *Agent) GetCandidatePairsStats() []CandidatePairStats { // FirstRequestTimestamp time.Time // LastRequestTimestamp time.Time // LastResponseTimestamp time.Time - // TotalRoundTripTime float64 - // CurrentRoundTripTime float64 + TotalRoundTripTime: cp.TotalRoundTripTime(), + CurrentRoundTripTime: cp.CurrentRoundTripTime(), // AvailableOutgoingBitrate float64 // AvailableIncomingBitrate float64 // CircuitBreakerTriggerCount uint32 // RequestsReceived uint64 // RequestsSent uint64 - // ResponsesReceived uint64 + ResponsesReceived: cp.ResponsesReceived(), // ResponsesSent uint64 // RetransmissionsReceived uint64 // RetransmissionsSent uint64 diff --git a/vendor/github.com/pion/ice/v2/candidate_relay.go b/vendor/github.com/pion/ice/v2/candidate_relay.go index 449d077a69..fa5297b25a 100644 --- a/vendor/github.com/pion/ice/v2/candidate_relay.go +++ b/vendor/github.com/pion/ice/v2/candidate_relay.go @@ -70,6 +70,23 @@ func NewCandidateRelay(config *CandidateRelayConfig) (*CandidateRelay, error) { }, nil } +// LocalPreference returns the local preference for this candidate +func (c *CandidateRelay) LocalPreference() uint16 { + // These preference values come from libwebrtc + // https://github.com/mozilla/libwebrtc/blob/1389c76d9c79839a2ca069df1db48aa3f2e6a1ac/p2p/base/turn_port.cc#L61 + var relayPreference uint16 + switch c.relayProtocol { + case relayProtocolTLS, relayProtocolDTLS: + relayPreference = 2 + case tcp: + relayPreference = 1 + default: + relayPreference = 0 + } + + return c.candidateBase.LocalPreference() + relayPreference +} + // RelayProtocol returns the protocol used between the endpoint and the relay server. func (c *CandidateRelay) RelayProtocol() string { return c.relayProtocol diff --git a/vendor/github.com/pion/ice/v2/candidatepair.go b/vendor/github.com/pion/ice/v2/candidatepair.go index 34ec047076..38f8ccb933 100644 --- a/vendor/github.com/pion/ice/v2/candidatepair.go +++ b/vendor/github.com/pion/ice/v2/candidatepair.go @@ -5,6 +5,8 @@ package ice import ( "fmt" + "sync/atomic" + "time" "github.com/pion/stun" ) @@ -28,6 +30,11 @@ type CandidatePair struct { state CandidatePairState nominated bool nominateOnBindingSuccess bool + + // stats + currentRoundTripTime int64 // in ns + totalRoundTripTime int64 // in ns + responsesReceived uint64 } func (p *CandidatePair) String() string { @@ -100,3 +107,30 @@ func (a *Agent) sendSTUN(msg *stun.Message, local, remote Candidate) { a.log.Tracef("Failed to send STUN message: %s", err) } } + +// UpdateRoundTripTime sets the current round time of this pair and +// accumulates total round trip time and responses received +func (p *CandidatePair) UpdateRoundTripTime(rtt time.Duration) { + rttNs := rtt.Nanoseconds() + atomic.StoreInt64(&p.currentRoundTripTime, rttNs) + atomic.AddInt64(&p.totalRoundTripTime, rttNs) + atomic.AddUint64(&p.responsesReceived, 1) +} + +// CurrentRoundTripTime returns the current round trip time in seconds +// https://www.w3.org/TR/webrtc-stats/#dom-rtcicecandidatepairstats-currentroundtriptime +func (p *CandidatePair) CurrentRoundTripTime() float64 { + return time.Duration(atomic.LoadInt64(&p.currentRoundTripTime)).Seconds() +} + +// TotalRoundTripTime returns the current round trip time in seconds +// https://www.w3.org/TR/webrtc-stats/#dom-rtcicecandidatepairstats-totalroundtriptime +func (p *CandidatePair) TotalRoundTripTime() float64 { + return time.Duration(atomic.LoadInt64(&p.totalRoundTripTime)).Seconds() +} + +// ResponsesReceived returns the total number of connectivity responses received +// https://www.w3.org/TR/webrtc-stats/#dom-rtcicecandidatepairstats-responsesreceived +func (p *CandidatePair) ResponsesReceived() uint64 { + return atomic.LoadUint64(&p.responsesReceived) +} diff --git a/vendor/github.com/pion/ice/v2/gather.go b/vendor/github.com/pion/ice/v2/gather.go index f93e6c16aa..3ca8086e79 100644 --- a/vendor/github.com/pion/ice/v2/gather.go +++ b/vendor/github.com/pion/ice/v2/gather.go @@ -400,7 +400,7 @@ func (a *Agent) gatherCandidatesSrflxUDPMux(ctx context.Context, urls []*stun.UR hostPort := fmt.Sprintf("%s:%d", url.Host, url.Port) serverAddr, err := a.net.ResolveUDPAddr(network, hostPort) if err != nil { - a.log.Debugf("Failed to resolve STUN host: %s: %v", hostPort, err) + a.log.Debugf("Failed to resolve STUN host: %s %s: %v", network, hostPort, err) return } @@ -462,7 +462,7 @@ func (a *Agent) gatherCandidatesSrflx(ctx context.Context, urls []*stun.URI, net hostPort := fmt.Sprintf("%s:%d", url.Host, url.Port) serverAddr, err := a.net.ResolveUDPAddr(network, hostPort) if err != nil { - a.log.Debugf("Failed to resolve STUN host: %s: %v", hostPort, err) + a.log.Debugf("Failed to resolve STUN host: %s %s: %v", network, hostPort, err) return } @@ -616,7 +616,7 @@ func (a *Agent) gatherCandidatesRelay(ctx context.Context, urls []*stun.URI) { / relAddr = conn.LocalAddr().(*net.UDPAddr).IP.String() //nolint:forcetypeassert relPort = conn.LocalAddr().(*net.UDPAddr).Port //nolint:forcetypeassert - relayProtocol = "dtls" + relayProtocol = relayProtocolDTLS locConn = &fakenet.PacketConn{Conn: conn} case url.Proto == stun.ProtoTypeTCP && url.Scheme == stun.SchemeTypeTURNS: tcpAddr, resolvErr := a.net.ResolveTCPAddr(NetworkTypeTCP4.String(), turnServerAddr) @@ -646,7 +646,7 @@ func (a *Agent) gatherCandidatesRelay(ctx context.Context, urls []*stun.URI) { / relAddr = conn.LocalAddr().(*net.TCPAddr).IP.String() //nolint:forcetypeassert relPort = conn.LocalAddr().(*net.TCPAddr).Port //nolint:forcetypeassert - relayProtocol = "tls" + relayProtocol = relayProtocolTLS locConn = turn.NewSTUNConn(conn) default: a.log.Warnf("Unable to handle URL in gatherCandidatesRelay %v", url) diff --git a/vendor/github.com/pion/ice/v2/ice.go b/vendor/github.com/pion/ice/v2/ice.go index bd551206e6..73262dd32f 100644 --- a/vendor/github.com/pion/ice/v2/ice.go +++ b/vendor/github.com/pion/ice/v2/ice.go @@ -83,3 +83,8 @@ func (t GatheringState) String() string { return ErrUnknownType.Error() } } + +const ( + relayProtocolDTLS = "dtls" + relayProtocolTLS = "tls" +) diff --git a/vendor/github.com/pion/ice/v2/selection.go b/vendor/github.com/pion/ice/v2/selection.go index 69bde40ac6..538eb0fff1 100644 --- a/vendor/github.com/pion/ice/v2/selection.go +++ b/vendor/github.com/pion/ice/v2/selection.go @@ -120,7 +120,7 @@ func (s *controllingSelector) HandleBindingRequest(m *stun.Message, local, remot } func (s *controllingSelector) HandleSuccessResponse(m *stun.Message, local, remote Candidate, remoteAddr net.Addr) { - ok, pendingRequest := s.agent.handleInboundBindingSuccess(m.TransactionID) + ok, pendingRequest, rtt := s.agent.handleInboundBindingSuccess(m.TransactionID) if !ok { s.log.Warnf("Discard message from (%s), unknown TransactionID 0x%x", remote, m.TransactionID) return @@ -149,6 +149,8 @@ func (s *controllingSelector) HandleSuccessResponse(m *stun.Message, local, remo if pendingRequest.isUseCandidate && s.agent.getSelectedPair() == nil { s.agent.setSelectedPair(p) } + + p.UpdateRoundTripTime(rtt) } func (s *controllingSelector) PingCandidate(local, remote Candidate) { @@ -211,7 +213,7 @@ func (s *controlledSelector) HandleSuccessResponse(m *stun.Message, local, remot // request with an appropriate error code response (e.g., 400) // [RFC5389]. - ok, pendingRequest := s.agent.handleInboundBindingSuccess(m.TransactionID) + ok, pendingRequest, rtt := s.agent.handleInboundBindingSuccess(m.TransactionID) if !ok { s.log.Warnf("Discard message from (%s), unknown TransactionID 0x%x", remote, m.TransactionID) return @@ -245,6 +247,8 @@ func (s *controlledSelector) HandleSuccessResponse(m *stun.Message, local, remot s.log.Tracef("Ignore nominate new pair %s, already nominated pair %s", p, selectedPair) } } + + p.UpdateRoundTripTime(rtt) } func (s *controlledSelector) HandleBindingRequest(m *stun.Message, local, remote Candidate) { diff --git a/vendor/github.com/pion/webrtc/v3/errors.go b/vendor/github.com/pion/webrtc/v3/errors.go index 009e91dd68..8c460d1444 100644 --- a/vendor/github.com/pion/webrtc/v3/errors.go +++ b/vendor/github.com/pion/webrtc/v3/errors.go @@ -240,6 +240,7 @@ var ( errInvalidICEServer = errors.New("invalid ICEServer") errICETransportNotInNew = errors.New("ICETransport can only be called in ICETransportStateNew") + errICETransportClosed = errors.New("ICETransport closed") errCertificatePEMFormatError = errors.New("bad Certificate PEM format") diff --git a/vendor/github.com/pion/webrtc/v3/icetransport.go b/vendor/github.com/pion/webrtc/v3/icetransport.go index cb9aa22de8..01bbc67c39 100644 --- a/vendor/github.com/pion/webrtc/v3/icetransport.go +++ b/vendor/github.com/pion/webrtc/v3/icetransport.go @@ -67,7 +67,7 @@ func (t *ICETransport) GetSelectedCandidatePair() (*ICECandidatePair, error) { return nil, err } - return &ICECandidatePair{Local: &local, Remote: &remote}, nil + return NewICECandidatePair(&local, &remote), nil } // NewICETransport creates a new NewICETransport. @@ -157,6 +157,10 @@ func (t *ICETransport) Start(gatherer *ICEGatherer, params ICEParameters, role * return err } + if t.State() == ICETransportStateClosed { + return errICETransportClosed + } + t.conn = iceConn config := mux.Config{ @@ -200,28 +204,31 @@ func (t *ICETransport) GracefulStop() error { func (t *ICETransport) stop(shouldGracefullyClose bool) error { t.lock.Lock() - defer t.lock.Unlock() - t.setState(ICETransportStateClosed) if t.ctxCancel != nil { t.ctxCancel() } + // mux and gatherer can only be set when ICETransport.State != Closed. + mux := t.mux + gatherer := t.gatherer + t.lock.Unlock() + if t.mux != nil { var closeErrs []error - if shouldGracefullyClose && t.gatherer != nil { + if shouldGracefullyClose && gatherer != nil { // we can't access icegatherer/icetransport.Close via // mux's net.Conn Close so we call it earlier here. - closeErrs = append(closeErrs, t.gatherer.GracefulClose()) + closeErrs = append(closeErrs, gatherer.GracefulClose()) } - closeErrs = append(closeErrs, t.mux.Close()) + closeErrs = append(closeErrs, mux.Close()) return util.FlattenErrs(closeErrs) - } else if t.gatherer != nil { + } else if gatherer != nil { if shouldGracefullyClose { - return t.gatherer.GracefulClose() + return gatherer.GracefulClose() } - return t.gatherer.Close() + return gatherer.Close() } return nil } diff --git a/vendor/github.com/pion/webrtc/v3/peerconnection.go b/vendor/github.com/pion/webrtc/v3/peerconnection.go index 3b40dafecb..d515c08a7b 100644 --- a/vendor/github.com/pion/webrtc/v3/peerconnection.go +++ b/vendor/github.com/pion/webrtc/v3/peerconnection.go @@ -56,8 +56,9 @@ type PeerConnection struct { idpLoginURL *string isClosed *atomicBool - isGracefulClosed *atomicBool - isGracefulClosedDone chan struct{} + isGracefullyClosingOrClosed bool + isCloseDone chan struct{} + isGracefulCloseDone chan struct{} isNegotiationNeeded *atomicBool updateNegotiationNeededFlagOnEmptyChain *atomicBool @@ -130,8 +131,8 @@ func (api *API) NewPeerConnection(configuration Configuration) (*PeerConnection, ICECandidatePoolSize: 0, }, isClosed: &atomicBool{}, - isGracefulClosed: &atomicBool{}, - isGracefulClosedDone: make(chan struct{}), + isCloseDone: make(chan struct{}), + isGracefulCloseDone: make(chan struct{}), isNegotiationNeeded: &atomicBool{}, updateNegotiationNeededFlagOnEmptyChain: &atomicBool{}, lastOffer: "", @@ -1117,10 +1118,18 @@ func (pc *PeerConnection) SetRemoteDescription(desc SessionDescription) error { case direction == RTPTransceiverDirectionRecvonly: if t.Direction() == RTPTransceiverDirectionSendrecv { t.setDirection(RTPTransceiverDirectionSendonly) + } else if t.Direction() == RTPTransceiverDirectionRecvonly { + t.setDirection(RTPTransceiverDirectionInactive) } case direction == RTPTransceiverDirectionSendrecv: if t.Direction() == RTPTransceiverDirectionSendonly { t.setDirection(RTPTransceiverDirectionSendrecv) + } else if t.Direction() == RTPTransceiverDirectionInactive { + t.setDirection(RTPTransceiverDirectionRecvonly) + } + case direction == RTPTransceiverDirectionSendonly: + if t.Direction() == RTPTransceiverDirectionInactive { + t.setDirection(RTPTransceiverDirectionRecvonly) } } @@ -1287,7 +1296,7 @@ func setRTPTransceiverCurrentDirection(answer *SessionDescription, currentTransc // If a transceiver is created by applying a remote description that has recvonly transceiver, // it will have no sender. In this case, the transceiver's current direction is set to inactive so // that the transceiver can be reused by next AddTrack. - if direction == RTPTransceiverDirectionSendonly && t.Sender() == nil { + if !weOffer && direction == RTPTransceiverDirectionSendonly && t.Sender() == nil { direction = RTPTransceiverDirectionInactive } @@ -1339,8 +1348,8 @@ func (pc *PeerConnection) configureRTPReceivers(isRenegotiation bool, remoteDesc mid := t.Mid() receiverNeedsStopped := false - func() { - for _, t := range tracks { + for _, track := range tracks { + func(t *TrackRemote) { t.mu.Lock() defer t.mu.Unlock() @@ -1348,19 +1357,19 @@ func (pc *PeerConnection) configureRTPReceivers(isRenegotiation bool, remoteDesc if details := trackDetailsForRID(incomingTracks, mid, t.rid); details != nil { t.id = details.id t.streamID = details.streamID - continue + return } } else if t.ssrc != 0 { if details := trackDetailsForSSRC(incomingTracks, t.ssrc); details != nil { t.id = details.id t.streamID = details.streamID - continue + return } } receiverNeedsStopped = true - } - }() + }(track) + } if !receiverNeedsStopped { continue @@ -2101,22 +2110,44 @@ func (pc *PeerConnection) GracefulClose() error { func (pc *PeerConnection) close(shouldGracefullyClose bool) error { // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #1) // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #2) - alreadyGracefullyClosed := shouldGracefullyClose && pc.isGracefulClosed.swap(true) - if pc.isClosed.swap(true) { - if alreadyGracefullyClosed { - // similar but distinct condition where we may be waiting for some - // other graceful close to finish. Incorrectly using isClosed may - // leak a goroutine. - <-pc.isGracefulClosedDone - } - return nil + + pc.mu.Lock() + // A lock in this critical section is needed because pc.isClosed and + // pc.isGracefullyClosingOrClosed are related to each other in that we + // want to make graceful and normal closure one time operations in order + // to avoid any double closure errors from cropping up. However, there are + // some overlapping close cases when both normal and graceful close are used + // that should be idempotent, but be cautioned when writing new close behavior + // to preserve this property. + isAlreadyClosingOrClosed := pc.isClosed.swap(true) + isAlreadyGracefullyClosingOrClosed := pc.isGracefullyClosingOrClosed + if shouldGracefullyClose && !isAlreadyGracefullyClosingOrClosed { + pc.isGracefullyClosingOrClosed = true } - if shouldGracefullyClose && !alreadyGracefullyClosed { - defer close(pc.isGracefulClosedDone) + pc.mu.Unlock() + + if isAlreadyClosingOrClosed { + if !shouldGracefullyClose { + return nil + } + // Even if we're already closing, it may not be graceful: + // If we are not the ones doing the closing, we just wait for the graceful close + // to happen and then return. + if isAlreadyGracefullyClosingOrClosed { + <-pc.isGracefulCloseDone + return nil + } + // Otherwise we need to go through the graceful closure flow once the + // normal closure is done since there are extra steps to take with a + // graceful close. + <-pc.isCloseDone + } else { + defer close(pc.isCloseDone) } - // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #3) - pc.signalingState.Set(SignalingStateClosed) + if shouldGracefullyClose { + defer close(pc.isGracefulCloseDone) + } // Try closing everything and collect the errors // Shutdown strategy: @@ -2126,6 +2157,34 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error { // continue the chain the Mux has to be closed. closeErrs := make([]error, 4) + doGracefulCloseOps := func() []error { + if !shouldGracefullyClose { + return nil + } + + // these are all non-canon steps + var gracefulCloseErrors []error + if pc.iceTransport != nil { + gracefulCloseErrors = append(gracefulCloseErrors, pc.iceTransport.GracefulStop()) + } + + pc.ops.GracefulClose() + + pc.sctpTransport.lock.Lock() + for _, d := range pc.sctpTransport.dataChannels { + gracefulCloseErrors = append(gracefulCloseErrors, d.GracefulClose()) + } + pc.sctpTransport.lock.Unlock() + return gracefulCloseErrors + } + + if isAlreadyClosingOrClosed { + return util.FlattenErrs(doGracefulCloseOps()) + } + + // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #3) + pc.signalingState.Set(SignalingStateClosed) + closeErrs = append(closeErrs, pc.api.interceptor.Close()) // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #4) @@ -2156,28 +2215,15 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error { closeErrs = append(closeErrs, pc.dtlsTransport.Stop()) // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #8, #9, #10) - if pc.iceTransport != nil { - if shouldGracefullyClose { - // note that it isn't canon to stop gracefully - closeErrs = append(closeErrs, pc.iceTransport.GracefulStop()) - } else { - closeErrs = append(closeErrs, pc.iceTransport.Stop()) - } + if pc.iceTransport != nil && !shouldGracefullyClose { + // we will stop gracefully in doGracefulCloseOps + closeErrs = append(closeErrs, pc.iceTransport.Stop()) } // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #11) pc.updateConnectionState(pc.ICEConnectionState(), pc.dtlsTransport.State()) - if shouldGracefullyClose { - pc.ops.GracefulClose() - - // note that it isn't canon to stop gracefully - pc.sctpTransport.lock.Lock() - for _, d := range pc.sctpTransport.dataChannels { - closeErrs = append(closeErrs, d.GracefulClose()) - } - pc.sctpTransport.lock.Unlock() - } + closeErrs = append(closeErrs, doGracefulCloseOps()...) return util.FlattenErrs(closeErrs) } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index 8a4f49a4c5..519db348a7 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -844,9 +844,7 @@ func (h *histogram) Write(out *dto.Metric) error { }} } - // If exemplars are not configured, the cap will be 0. - // So append is not needed in this case. - if cap(h.nativeExemplars.exemplars) > 0 { + if h.nativeExemplars.isEnabled() { h.nativeExemplars.Lock() his.Exemplars = append(his.Exemplars, h.nativeExemplars.exemplars...) h.nativeExemplars.Unlock() @@ -1665,6 +1663,10 @@ type nativeExemplars struct { exemplars []*dto.Exemplar } +func (n *nativeExemplars) isEnabled() bool { + return n.ttl != -1 +} + func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { if ttl == 0 { ttl = 5 * time.Minute @@ -1686,7 +1688,7 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { } func (n *nativeExemplars) addExemplar(e *dto.Exemplar) { - if n.ttl == -1 { + if !n.isEnabled() { return } diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml index d9abe194d9..a5f904197f 100644 --- a/vendor/go.opentelemetry.io/otel/.golangci.yml +++ b/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -64,12 +64,12 @@ issues: - path: _test\.go linters: - gosec - # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) + # Ignoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) # as we commonly use it in tests and examples. - text: "G404:" linters: - gosec - # Igonoring gosec G402: TLS MinVersion too low + # Ignoring gosec G402: TLS MinVersion too low # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well. - text: "G402: TLS MinVersion too low." linters: diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md index 6107c17b89..fb107426e7 100644 --- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md +++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -11,6 +11,25 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## [1.30.0/0.52.0/0.6.0/0.0.9] 2024-09-09 + +### Added + +- Support `OTEL_EXPORTER_OTLP_LOGS_INSECURE` and `OTEL_EXPORTER_OTLP_INSECURE` environments in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#5739) +- The `WithResource` option for `NewMeterProvider` now merges the provided resources with the ones from environment variables. (#5773) +- The `WithResource` option for `NewLoggerProvider` now merges the provided resources with the ones from environment variables. (#5773) +- Add UTF-8 support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5755) + +### Fixed + +- Fix memory leak in the global `MeterProvider` when identical instruments are repeatedly created. (#5754) +- Fix panic on instruments creation when setting meter provider. (#5758) +- Fix an issue where `SetMeterProvider` in `go.opentelemetry.io/otel` might miss the delegation for instruments and registries. (#5780) + +### Removed + +- Drop support for [Go 1.21]. (#5736, #5740, #5800) + ## [1.29.0/0.51.0/0.5.0] 2024-08-23 This release is the last to support [Go 1.21]. @@ -1895,7 +1914,7 @@ with major version 0. - Setting error status while recording error with Span from oteltest package. (#1729) - The concept of a remote and local Span stored in a context is unified to just the current Span. Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. - Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span. + Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContext` can be used to return the current Span. If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) - The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) @@ -2469,7 +2488,7 @@ This release migrates the default OpenTelemetry SDK into its own Go module, deco - Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) - Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) - Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) -- Update otel-colector example to use the v0.5.0 collector. (#915) +- Update otel-collector example to use the v0.5.0 collector. (#915) - The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) - The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) - The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. @@ -3062,7 +3081,8 @@ It contains api and sdk for trace and meter. - CircleCI build CI manifest files. - CODEOWNERS file to track owners of this project. -[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.29.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.30.0...HEAD +[1.30.0/0.52.0/0.6.0/0.0.9]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.30.0 [1.29.0/0.51.0/0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.29.0 [1.28.0/0.50.0/0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.28.0 [1.27.0/0.49.0/0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.27.0 diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md index b7402576f9..9158072535 100644 --- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md +++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -578,7 +578,10 @@ See also: The tests should never leak goroutines. Use the term `ConcurrentSafe` in the test name when it aims to verify the -absence of race conditions. +absence of race conditions. The top-level tests with this term will be run +many times in the `test-concurrent-safe` CI job to increase the chance of +catching concurrency issues. This does not apply to subtests when this term +is not in their root name. ### Internal packages diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile index 070b1e57df..b04695b242 100644 --- a/vendor/go.opentelemetry.io/otel/Makefile +++ b/vendor/go.opentelemetry.io/otel/Makefile @@ -145,12 +145,14 @@ build-tests/%: # Tests -TEST_TARGETS := test-default test-bench test-short test-verbose test-race +TEST_TARGETS := test-default test-bench test-short test-verbose test-race test-concurrent-safe .PHONY: $(TEST_TARGETS) test test-default test-race: ARGS=-race test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=. test-short: ARGS=-short test-verbose: ARGS=-v -race +test-concurrent-safe: ARGS=-run=ConcurrentSafe -count=100 -race +test-concurrent-safe: TIMEOUT=120 $(TEST_TARGETS): test test: $(OTEL_GO_MOD_DIRS:%=test/%) test/%: DIR=$* diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md index 657df34710..9a65707038 100644 --- a/vendor/go.opentelemetry.io/otel/README.md +++ b/vendor/go.opentelemetry.io/otel/README.md @@ -51,25 +51,18 @@ Currently, this project supports the following environments. |----------|------------|--------------| | Ubuntu | 1.23 | amd64 | | Ubuntu | 1.22 | amd64 | -| Ubuntu | 1.21 | amd64 | | Ubuntu | 1.23 | 386 | | Ubuntu | 1.22 | 386 | -| Ubuntu | 1.21 | 386 | | Linux | 1.23 | arm64 | | Linux | 1.22 | arm64 | -| Linux | 1.21 | arm64 | | macOS 13 | 1.23 | amd64 | | macOS 13 | 1.22 | amd64 | -| macOS 13 | 1.21 | amd64 | | macOS | 1.23 | arm64 | | macOS | 1.22 | arm64 | -| macOS | 1.21 | arm64 | | Windows | 1.23 | amd64 | | Windows | 1.22 | amd64 | -| Windows | 1.21 | amd64 | | Windows | 1.23 | 386 | | Windows | 1.22 | 386 | -| Windows | 1.21 | 386 | While this project should work for other systems, no compatibility guarantees are made for those systems currently. diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go index b3569e95e5..36f5367030 100644 --- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go +++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -50,7 +50,7 @@ type Property struct { // component boundaries may impose their own restrictions on Property key. // For example, the W3C Baggage specification restricts the Property keys to strings that // satisfy the token definition from RFC7230, Section 3.2.6. -// For maximum compatibility, alpha-numeric value are strongly recommended to be used as Property key. +// For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key. func NewKeyProperty(key string) (Property, error) { if !validateBaggageName(key) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) @@ -90,7 +90,7 @@ func NewKeyValueProperty(key, value string) (Property, error) { // component boundaries may impose their own restrictions on Property key. // For example, the W3C Baggage specification restricts the Property keys to strings that // satisfy the token definition from RFC7230, Section 3.2.6. -// For maximum compatibility, alpha-numeric value are strongly recommended to be used as Property key. +// For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key. func NewKeyValuePropertyRaw(key, value string) (Property, error) { if !validateBaggageName(key) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) @@ -287,7 +287,7 @@ func NewMember(key, value string, props ...Property) (Member, error) { // component boundaries may impose their own restrictions on baggage key. // For example, the W3C Baggage specification restricts the baggage keys to strings that // satisfy the token definition from RFC7230, Section 3.2.6. -// For maximum compatibility, alpha-numeric value are strongly recommended to be used as baggage key. +// For maximum compatibility, alphanumeric value are strongly recommended to be used as baggage key. func NewMemberRaw(key, value string, props ...Property) (Member, error) { m := Member{ key: key, diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go index cfd1df9bfa..f2fc3929b1 100644 --- a/vendor/go.opentelemetry.io/otel/internal/global/meter.go +++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -5,8 +5,8 @@ package global // import "go.opentelemetry.io/otel/internal/global" import ( "container/list" + "reflect" "sync" - "sync/atomic" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/embedded" @@ -76,7 +76,7 @@ func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Me return val } - t := &meter{name: name, opts: opts} + t := &meter{name: name, opts: opts, instruments: make(map[instID]delegatedInstrument)} p.meters[key] = t return t } @@ -92,17 +92,29 @@ type meter struct { opts []metric.MeterOption mtx sync.Mutex - instruments []delegatedInstrument + instruments map[instID]delegatedInstrument registry list.List - delegate atomic.Value // metric.Meter + delegate metric.Meter } type delegatedInstrument interface { setDelegate(metric.Meter) } +// instID are the identifying properties of a instrument. +type instID struct { + // name is the name of the stream. + name string + // description is the description of the stream. + description string + // kind defines the functional group of the instrument. + kind reflect.Type + // unit is the unit of the stream. + unit string +} + // setDelegate configures m to delegate all Meter functionality to Meters // created by provider. // @@ -110,12 +122,12 @@ type delegatedInstrument interface { // // It is guaranteed by the caller that this happens only once. func (m *meter) setDelegate(provider metric.MeterProvider) { - meter := provider.Meter(m.name, m.opts...) - m.delegate.Store(meter) - m.mtx.Lock() defer m.mtx.Unlock() + meter := provider.Meter(m.name, m.opts...) + m.delegate = meter + for _, inst := range m.instruments { inst.setDelegate(meter) } @@ -133,169 +145,295 @@ func (m *meter) setDelegate(provider metric.MeterProvider) { } func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64Counter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64Counter(name, options...) + } + i := &siCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64CounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64UpDownCounter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64UpDownCounter(name, options...) + } + i := &siUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64UpDownCounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64Histogram(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64Histogram(name, options...) + } + i := &siHistogram{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64HistogramConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Int64Gauge(name string, options ...metric.Int64GaugeOption) (metric.Int64Gauge, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64Gauge(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64Gauge(name, options...) + } + i := &siGauge{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64GaugeConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64ObservableCounter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64ObservableCounter(name, options...) + } + i := &aiCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64ObservableCounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64ObservableUpDownCounter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64ObservableUpDownCounter(name, options...) + } + i := &aiUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64ObservableUpDownCounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64ObservableGauge(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Int64ObservableGauge(name, options...) + } + i := &aiGauge{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewInt64ObservableGaugeConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64Counter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64Counter(name, options...) + } + i := &sfCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64CounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64UpDownCounter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64UpDownCounter(name, options...) + } + i := &sfUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64UpDownCounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64Histogram(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64Histogram(name, options...) + } + i := &sfHistogram{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64HistogramConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64Gauge(name string, options ...metric.Float64GaugeOption) (metric.Float64Gauge, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64Gauge(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64Gauge(name, options...) + } + i := &sfGauge{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64GaugeConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64ObservableCounter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64ObservableCounter(name, options...) + } + i := &afCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64ObservableCounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64ObservableUpDownCounter(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64ObservableUpDownCounter(name, options...) + } + i := &afUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64ObservableUpDownCounterConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64ObservableGauge(name, options...) - } m.mtx.Lock() defer m.mtx.Unlock() + + if m.delegate != nil { + return m.delegate.Float64ObservableGauge(name, options...) + } + i := &afGauge{name: name, opts: options} - m.instruments = append(m.instruments, i) + cfg := metric.NewFloat64ObservableGaugeConfig(options...) + id := instID{ + name: name, + kind: reflect.TypeOf(i), + description: cfg.Description(), + unit: cfg.Unit(), + } + m.instruments[id] = i return i, nil } // RegisterCallback captures the function that will be called during Collect. func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - insts = unwrapInstruments(insts) - return del.RegisterCallback(f, insts...) - } - m.mtx.Lock() defer m.mtx.Unlock() + if m.delegate != nil { + insts = unwrapInstruments(insts) + return m.delegate.RegisterCallback(f, insts...) + } + reg := ®istration{instruments: insts, function: f} e := m.registry.PushBack(reg) reg.unreg = func() error { diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go index cf23db7780..f8435d8f28 100644 --- a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go +++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go @@ -213,7 +213,7 @@ type Float64Observer interface { } // Float64Callback is a function registered with a Meter that makes -// observations for a Float64Observerable instrument it is registered with. +// observations for a Float64Observable instrument it is registered with. // Calls to the Float64Observer record measurement values for the // Float64Observable. // diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go index c82ba5324e..e079aaef16 100644 --- a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go +++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go @@ -212,7 +212,7 @@ type Int64Observer interface { } // Int64Callback is a function registered with a Meter that makes observations -// for an Int64Observerable instrument it is registered with. Calls to the +// for an Int64Observable instrument it is registered with. Calls to the // Int64Observer record measurement values for the Int64Observable. // // The function needs to complete in a finite amount of time and the deadline diff --git a/vendor/go.opentelemetry.io/otel/renovate.json b/vendor/go.opentelemetry.io/otel/renovate.json index 8c5ac55ca9..4d36b98cf4 100644 --- a/vendor/go.opentelemetry.io/otel/renovate.json +++ b/vendor/go.opentelemetry.io/otel/renovate.json @@ -19,6 +19,10 @@ "matchManagers": ["gomod"], "matchDepTypes": ["indirect"], "enabled": false + }, + { + "matchPackageNames": ["google.golang.org/genproto/googleapis/**"], + "groupName": "googleapis" } ] } diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go index 5650a174b4..8c45a7107f 100644 --- a/vendor/go.opentelemetry.io/otel/trace/context.go +++ b/vendor/go.opentelemetry.io/otel/trace/context.go @@ -22,7 +22,7 @@ func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Cont return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) } -// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly +// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicitly // as a remote SpanContext and as the current Span. The Span implementation // that wraps rsc is non-recording and performs no operations other than to // return rsc as the SpanContext from the SpanContext method. diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go index d661c5d100..cdbf41d6d7 100644 --- a/vendor/go.opentelemetry.io/otel/trace/doc.go +++ b/vendor/go.opentelemetry.io/otel/trace/doc.go @@ -96,7 +96,7 @@ can embed the API interface directly. This option is not recommended. It will lead to publishing packages that contain runtime panics when users update to newer versions of -[go.opentelemetry.io/otel/trace], which may be done with a trasitive +[go.opentelemetry.io/otel/trace], which may be done with a transitive dependency. Finally, an author can embed another implementation in theirs. The embedded diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go index f67039ed1f..78b40f3ed2 100644 --- a/vendor/go.opentelemetry.io/otel/version.go +++ b/vendor/go.opentelemetry.io/otel/version.go @@ -5,5 +5,5 @@ package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { - return "1.29.0" + return "1.30.0" } diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml index 3ba611d713..0c32f4fc46 100644 --- a/vendor/go.opentelemetry.io/otel/versions.yaml +++ b/vendor/go.opentelemetry.io/otel/versions.yaml @@ -3,7 +3,7 @@ module-sets: stable-v1: - version: v1.29.0 + version: v1.30.0 modules: - go.opentelemetry.io/otel - go.opentelemetry.io/otel/bridge/opencensus @@ -29,12 +29,12 @@ module-sets: - go.opentelemetry.io/otel/sdk/metric - go.opentelemetry.io/otel/trace experimental-metrics: - version: v0.51.0 + version: v0.52.0 modules: - go.opentelemetry.io/otel/example/prometheus - go.opentelemetry.io/otel/exporters/prometheus experimental-logs: - version: v0.5.0 + version: v0.6.0 modules: - go.opentelemetry.io/otel/log - go.opentelemetry.io/otel/sdk/log @@ -42,7 +42,7 @@ module-sets: - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp - go.opentelemetry.io/otel/exporters/stdout/stdoutlog experimental-schema: - version: v0.0.8 + version: v0.0.9 modules: - go.opentelemetry.io/otel/schema excluded-modules: diff --git a/vendor/modernc.org/libc/libc_all.go b/vendor/modernc.org/libc/libc_all.go new file mode 100644 index 0000000000..196b81bca0 --- /dev/null +++ b/vendor/modernc.org/libc/libc_all.go @@ -0,0 +1,34 @@ +// Copyright 2024 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package libc // import "modernc.org/libc" + +import ( + "unsafe" + "sync/atomic" + + "golang.org/x/exp/constraints" +) + +func X__sync_add_and_fetch[T constraints.Integer](t *TLS, p uintptr, v T) T { + switch unsafe.Sizeof(v) { + case 4: + return T(atomic.AddInt32((*int32)(unsafe.Pointer(p)), int32(v))) + case 8: + return T(atomic.AddInt64((*int64)(unsafe.Pointer(p)), int64(v))) + default: + panic(todo("")) + } +} + +func X__sync_sub_and_fetch[T constraints.Integer](t *TLS, p uintptr, v T) T { + switch unsafe.Sizeof(v) { + case 4: + return T(atomic.AddInt32((*int32)(unsafe.Pointer(p)), -int32(v))) + case 8: + return T(atomic.AddInt64((*int64)(unsafe.Pointer(p)), -int64(v))) + default: + panic(todo("")) + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 860db57eb4..4b294d954c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -26,7 +26,7 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/log github.com/Azure/azure-sdk-for-go/sdk/internal/poller github.com/Azure/azure-sdk-for-go/sdk/internal/temporal github.com/Azure/azure-sdk-for-go/sdk/internal/uuid -# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 +# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob @@ -61,8 +61,8 @@ 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.69-0.20240910113603-b146bae422f6 -## explicit; go 1.23 +# github.com/CortexFoundation/torrentfs v1.0.69-0.20240919133537-42182e03b31a +## explicit; go 1.23.0 github.com/CortexFoundation/torrentfs github.com/CortexFoundation/torrentfs/backend github.com/CortexFoundation/torrentfs/backend/caffe @@ -88,11 +88,11 @@ github.com/ajwerner/btree/internal/abstract # github.com/alecthomas/atomic v0.1.0-alpha2 ## explicit; go 1.18 github.com/alecthomas/atomic -# github.com/anacrolix/chansync v0.5.1 +# github.com/anacrolix/chansync v0.6.0 ## explicit; go 1.16 github.com/anacrolix/chansync github.com/anacrolix/chansync/events -# github.com/anacrolix/dht/v2 v2.21.1 +# github.com/anacrolix/dht/v2 v2.21.2 ## explicit; go 1.18 github.com/anacrolix/dht/v2 github.com/anacrolix/dht/v2/bep44 @@ -127,20 +127,18 @@ github.com/anacrolix/missinggo/iter github.com/anacrolix/missinggo/mime github.com/anacrolix/missinggo/pproffd github.com/anacrolix/missinggo/slices -# github.com/anacrolix/missinggo/perf v1.0.0 -## explicit; go 1.12 -github.com/anacrolix/missinggo/perf -# github.com/anacrolix/missinggo/v2 v2.7.3 +# github.com/anacrolix/missinggo/v2 v2.7.4 ## explicit; go 1.18 github.com/anacrolix/missinggo/v2 github.com/anacrolix/missinggo/v2/bitmap github.com/anacrolix/missinggo/v2/iter +github.com/anacrolix/missinggo/v2/perf github.com/anacrolix/missinggo/v2/pproffd github.com/anacrolix/missinggo/v2/pubsub github.com/anacrolix/missinggo/v2/resource github.com/anacrolix/missinggo/v2/slices -# github.com/anacrolix/mmsg v1.0.0 -## explicit +# github.com/anacrolix/mmsg v1.1.1 +## explicit; go 1.23.0 github.com/anacrolix/mmsg github.com/anacrolix/mmsg/socket # github.com/anacrolix/multiless v0.3.1-0.20221221005021-2d12701f83f7 @@ -150,10 +148,10 @@ github.com/anacrolix/multiless ## explicit; go 1.18 github.com/anacrolix/stm github.com/anacrolix/stm/stmutil -# github.com/anacrolix/sync v0.5.1 +# github.com/anacrolix/sync v0.5.2 ## explicit; go 1.13 github.com/anacrolix/sync -# github.com/anacrolix/torrent v1.56.2-0.20240909105636-b80f6b65f205 +# github.com/anacrolix/torrent v1.57.1-0.20240918090318-144b57016ca9 ## explicit; go 1.23 github.com/anacrolix/torrent github.com/anacrolix/torrent/analysis @@ -237,10 +235,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.27.33 +# github.com/aws/aws-sdk-go-v2/config v1.27.35 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.17.32 +# github.com/aws/aws-sdk-go-v2/credentials v1.17.33 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds @@ -268,28 +266,28 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding # github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 ## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 +# github.com/aws/aws-sdk-go-v2/service/route53 v1.43.3 ## explicit; go 1.21 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.22.7 +# github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 ## explicit; go 1.21 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.26.7 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 ## explicit; go 1.21 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.30.7 +# github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 ## explicit; go 1.21 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.20.4 +# github.com/aws/smithy-go v1.21.0 ## explicit; go 1.21 github.com/aws/smithy-go github.com/aws/smithy-go/auth @@ -309,6 +307,7 @@ 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 +github.com/aws/smithy-go/tracing github.com/aws/smithy-go/transport/http github.com/aws/smithy-go/transport/http/internal/io github.com/aws/smithy-go/waiter @@ -324,7 +323,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.14.2 +# github.com/bits-and-blooms/bitset v1.14.3 ## explicit; go 1.16 github.com/bits-and-blooms/bitset # github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 @@ -346,20 +345,20 @@ github.com/cespare/xxhash # github.com/cespare/xxhash/v2 v2.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 -# github.com/charmbracelet/bubbletea v1.1.0 +# github.com/charmbracelet/bubbletea v1.1.1 ## explicit; go 1.18 github.com/charmbracelet/bubbletea # github.com/charmbracelet/lipgloss v0.13.0 ## explicit; go 1.18 github.com/charmbracelet/lipgloss -# github.com/charmbracelet/x/ansi v0.2.3 +# github.com/charmbracelet/x/ansi v0.3.2 ## explicit; go 1.18 github.com/charmbracelet/x/ansi github.com/charmbracelet/x/ansi/parser # github.com/charmbracelet/x/term v0.2.0 ## explicit; go 1.18 github.com/charmbracelet/x/term -# github.com/cloudflare/cloudflare-go v0.103.0 +# github.com/cloudflare/cloudflare-go v0.104.0 ## explicit; go 1.19 github.com/cloudflare/cloudflare-go # github.com/cockroachdb/errors v1.11.3 @@ -442,7 +441,7 @@ github.com/cockroachdb/tokenbucket # github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be ## explicit github.com/common-nighthawk/go-figure -# github.com/consensys/bavard v0.1.13 +# github.com/consensys/bavard v0.1.15 ## explicit; go 1.15 github.com/consensys/bavard # github.com/consensys/gnark-crypto v0.14.0 @@ -459,7 +458,7 @@ github.com/consensys/gnark-crypto/field/hash github.com/consensys/gnark-crypto/field/pool github.com/consensys/gnark-crypto/internal/generator/config github.com/consensys/gnark-crypto/internal/parallel -# github.com/cpuguy83/go-md2man/v2 v2.0.4 +# github.com/cpuguy83/go-md2man/v2 v2.0.5 ## explicit; go 1.11 github.com/cpuguy83/go-md2man/v2/md2man # github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a @@ -498,7 +497,7 @@ github.com/dgraph-io/badger/v4/skl github.com/dgraph-io/badger/v4/table github.com/dgraph-io/badger/v4/trie github.com/dgraph-io/badger/v4/y -# github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 +# github.com/dgraph-io/ristretto v1.0.0 ## explicit; go 1.19 github.com/dgraph-io/ristretto github.com/dgraph-io/ristretto/z @@ -507,7 +506,7 @@ github.com/dgraph-io/ristretto/z/simd ## explicit; go 1.13 github.com/dlclark/regexp2 github.com/dlclark/regexp2/syntax -# github.com/dop251/goja v0.0.0-20240828124009-016eb7256539 +# github.com/dop251/goja v0.0.0-20240919115326-6c7d1df7ff05 ## explicit; go 1.20 github.com/dop251/goja github.com/dop251/goja/ast @@ -550,7 +549,7 @@ github.com/garslo/gogen # github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 ## explicit github.com/gballet/go-libpcsclite -# github.com/getsentry/sentry-go v0.28.1 +# github.com/getsentry/sentry-go v0.29.0 ## explicit; go 1.18 github.com/getsentry/sentry-go github.com/getsentry/sentry-go/internal/debug @@ -578,8 +577,8 @@ github.com/go-logr/stdr ## explicit; go 1.12 github.com/go-ole/go-ole github.com/go-ole/go-ole/oleutil -# github.com/go-resty/resty/v2 v2.14.0 -## explicit; go 1.16 +# github.com/go-resty/resty/v2 v2.15.1 +## explicit; go 1.20 github.com/go-resty/resty/v2 github.com/go-resty/resty/v2/shellescape # github.com/go-sourcemap/sourcemap v2.1.4+incompatible @@ -629,7 +628,7 @@ github.com/google/go-querystring/query ## explicit; go 1.12 github.com/google/gofuzz github.com/google/gofuzz/bytesource -# github.com/google/pprof v0.0.0-20240903155634-a8630aee4ab9 +# github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 ## explicit; go 1.22 github.com/google/pprof/profile # github.com/google/uuid v1.6.0 @@ -854,7 +853,7 @@ github.com/pion/dtls/v2/pkg/protocol/alert github.com/pion/dtls/v2/pkg/protocol/extension github.com/pion/dtls/v2/pkg/protocol/handshake github.com/pion/dtls/v2/pkg/protocol/recordlayer -# github.com/pion/ice/v2 v2.3.34 +# github.com/pion/ice/v2 v2.3.35 ## explicit; go 1.13 github.com/pion/ice/v2 github.com/pion/ice/v2/internal/atomic @@ -918,7 +917,7 @@ github.com/pion/turn/v2/internal/client github.com/pion/turn/v2/internal/ipnet github.com/pion/turn/v2/internal/proto github.com/pion/turn/v2/internal/server -# github.com/pion/webrtc/v3 v3.3.0 +# github.com/pion/webrtc/v3 v3.3.3 ## explicit; go 1.17 github.com/pion/webrtc/v3 github.com/pion/webrtc/v3/internal/fmtp @@ -932,7 +931,7 @@ github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.0 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/prometheus/client_golang v1.20.3 +# github.com/prometheus/client_golang v1.20.4 ## explicit; go 1.20 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal @@ -1032,7 +1031,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.24-0.20240909203057-3b4dd9a88aca +# github.com/ucwong/golang-kv v1.0.24-0.20240918082513-1a48acf17d80 ## explicit; go 1.22.0 github.com/ucwong/golang-kv github.com/ucwong/golang-kv/badger @@ -1076,8 +1075,8 @@ go.opencensus.io/internal go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/tracestate -# go.opentelemetry.io/otel v1.29.0 -## explicit; go 1.21 +# go.opentelemetry.io/otel v1.30.0 +## explicit; go 1.22 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute go.opentelemetry.io/otel/baggage @@ -1087,12 +1086,12 @@ go.opentelemetry.io/otel/internal/attribute go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation -# go.opentelemetry.io/otel/metric v1.29.0 -## explicit; go 1.21 +# go.opentelemetry.io/otel/metric v1.30.0 +## explicit; go 1.22 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded -# go.opentelemetry.io/otel/trace v1.29.0 -## explicit; go 1.21 +# go.opentelemetry.io/otel/trace v1.30.0 +## explicit; go 1.22 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded # go.uber.org/automaxprocs v1.5.3 @@ -1275,7 +1274,7 @@ gopkg.in/yaml.v3 lukechampine.com/blake3 lukechampine.com/blake3/bao lukechampine.com/blake3/guts -# modernc.org/libc v1.60.1 +# modernc.org/libc v1.61.0 ## explicit; go 1.20 modernc.org/libc modernc.org/libc/errno @@ -1309,7 +1308,7 @@ modernc.org/mathutil # modernc.org/memory v1.8.0 ## explicit; go 1.18 modernc.org/memory -# modernc.org/sqlite v1.32.0 +# modernc.org/sqlite v1.33.1 ## explicit; go 1.20 modernc.org/sqlite/lib # rsc.io/tmplfunc v0.0.3