Merge branch 'public-single-node' into pmm-6401-read-prometheus-data-files

This commit is contained in:
Aliaksandr Valialkin 2023-01-11 01:34:37 -08:00
commit c3f178aa53
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
180 changed files with 6797 additions and 2930 deletions

View file

@ -17,7 +17,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@main
with:
go-version: 1.19.4
go-version: 1.19.5
id: go
- name: Code checkout
uses: actions/checkout@master

View file

@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@main
with:
go-version: 1.19.4
go-version: 1.19.5
id: go
- name: Code checkout
uses: actions/checkout@master

View file

@ -22,7 +22,7 @@ jobs:
name: Setup Go
uses: actions/setup-go@main
with:
go-version: 1.19.4
go-version: 1.19.5
id: go
-
name: Setup docker scan

View file

@ -120,8 +120,8 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool {
err := &httpserver.ErrorWithStatusCode{
Err: fmt.Errorf("couldn't start executing the request in %.3f seconds, since -search.maxConcurrentRequests=%d concurrent requests "+
"are executed. Possible solutions: to reduce query load; to add more compute resources to the server; "+
"to increase -search.maxQueueDuration; to increase -search.maxQueryDuration; to increase -search.maxConcurrentRequests",
d.Seconds(), *maxConcurrentRequests),
"to increase -search.maxQueueDuration=%s; to increase -search.maxQueryDuration; to increase -search.maxConcurrentRequests",
d.Seconds(), *maxConcurrentRequests, maxQueueDuration),
StatusCode: http.StatusServiceUnavailable,
}
httpserver.Errorf(w, r, "%s", err)

View file

@ -766,10 +766,14 @@ func QueryHandler(qt *querytracer.Tracer, startTime time.Time, w http.ResponseWr
}
if queryOffset > 0 {
for i := range result {
timestamps := result[i].Timestamps
r := &result[i]
// Do not modify r.Timestamps, since they may be shared among multiple series.
// Make a copy instead.
timestamps := append([]int64{}, r.Timestamps...)
for j := range timestamps {
timestamps[j] += queryOffset
}
r.Timestamps = timestamps
}
}
@ -910,7 +914,9 @@ func removeEmptyValuesAndTimeseries(tss []netstorage.Result) []netstorage.Result
// Slow path: remove NaNs.
srcTimestamps := ts.Timestamps
dstValues := ts.Values[:0]
dstTimestamps := ts.Timestamps[:0]
// Do not re-use ts.Timestamps for dstTimestamps, since ts.Timestamps
// may be shared among multiple time series.
dstTimestamps := make([]int64, 0, len(ts.Timestamps))
for j, v := range ts.Values {
if math.IsNaN(v) {
continue

View file

@ -652,9 +652,9 @@ func evalExprsInParallel(qt *querytracer.Tracer, ec *EvalConfig, es []metricsql.
}
rvs := make([][]*timeseries, len(es))
errs := make([]error, len(es))
qt.Printf("eval function args in parallel")
var wg sync.WaitGroup
for i, e := range es {
qt.Printf("eval function args in parallel")
wg.Add(1)
qtChild := qt.NewChild("eval arg %d", i)
go func(e metricsql.Expr, i int) {

View file

@ -1,4 +1,4 @@
FROM golang:1.19.4 as build-web-stage
FROM golang:1.19.5 as build-web-stage
COPY build /build
WORKDIR /build

View file

@ -4,7 +4,7 @@ DOCKER_NAMESPACE := victoriametrics
ROOT_IMAGE ?= alpine:3.17.1
CERTS_IMAGE := alpine:3.17.1
GO_BUILDER_IMAGE := golang:1.19.4-alpine
GO_BUILDER_IMAGE := golang:1.19.5-alpine
BUILDER_IMAGE := local/builder:2.0.0-$(shell echo $(GO_BUILDER_IMAGE) | tr :/ __)-1
BASE_IMAGE := local/base:1.1.3-$(shell echo $(ROOT_IMAGE) | tr :/ __)-$(shell echo $(CERTS_IMAGE) | tr :/ __)

View file

@ -2,7 +2,7 @@ version: '3.5'
services:
vmagent:
container_name: vmagent
image: victoriametrics/vmagent:v1.85.3
image: victoriametrics/vmagent:v1.86.0
depends_on:
- "vminsert"
ports:
@ -32,7 +32,7 @@ services:
vmstorage-1:
container_name: vmstorage-1
image: victoriametrics/vmstorage:v1.85.3-cluster
image: victoriametrics/vmstorage:v1.86.0-cluster
ports:
- 8482
- 8400
@ -44,7 +44,7 @@ services:
restart: always
vmstorage-2:
container_name: vmstorage-2
image: victoriametrics/vmstorage:v1.85.3-cluster
image: victoriametrics/vmstorage:v1.86.0-cluster
ports:
- 8482
- 8400
@ -56,19 +56,19 @@ services:
restart: always
vminsert:
container_name: vminsert
image: victoriametrics/vminsert:v1.85.3-cluster
image: victoriametrics/vminsert:v1.86.0-cluster
depends_on:
- "vmstorage-1"
- "vmstorage-2"
command:
- '--storageNode=vmstorage-1.85.3'
- '--storageNode=vmstorage-1.86.0'
- '--storageNode=vmstorage-2:8400'
ports:
- 8480:8480
restart: always
vmselect:
container_name: vmselect
image: victoriametrics/vmselect:v1.85.3-cluster
image: victoriametrics/vmselect:v1.86.0-cluster
depends_on:
- "vmstorage-1"
- "vmstorage-2"
@ -82,7 +82,7 @@ services:
vmalert:
container_name: vmalert
image: victoriametrics/vmalert:v1.85.3
image: victoriametrics/vmalert:v1.86.0
depends_on:
- "vmselect"
ports:

View file

@ -2,7 +2,7 @@ version: "3.5"
services:
vmagent:
container_name: vmagent
image: victoriametrics/vmagent:v1.85.3
image: victoriametrics/vmagent:v1.86.0
depends_on:
- "victoriametrics"
ports:
@ -18,7 +18,7 @@ services:
restart: always
victoriametrics:
container_name: victoriametrics
image: victoriametrics/victoria-metrics:v1.85.3
image: victoriametrics/victoria-metrics:v1.86.0
ports:
- 8428:8428
- 8089:8089
@ -56,7 +56,7 @@ services:
restart: always
vmalert:
container_name: vmalert
image: victoriametrics/vmalert:v1.85.3
image: victoriametrics/vmalert:v1.86.0
depends_on:
- "victoriametrics"
- "alertmanager"

View file

@ -16,8 +16,20 @@ The following tip changes can be tested by building VictoriaMetrics components f
## tip
## [v1.86.1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.86.1)
Released at 2023-01-10
* BUGFIX: return correct query results over time series with gaps. The issue has been introduced in [v1.86.0](https://docs.victoriametrics.com/CHANGELOG.html#v1860).
* BUGFIX: properly take into account the timeout passed by `vmselect` to `vmstorage` during query execution. This issue could result in the following error logs at `vmstorage` under load: `cannot process vmselect request: cannot execute "search_v7": couldn't start executing the request in 0.000 seconds, since -search.maxConcurrentRequests=... concurrent requests are already executed`. The issue has been introduced in [v1.86.0](https://docs.victoriametrics.com/CHANGELOG.html#v1860).
## [v1.86.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.86.0)
Released at 2023-01-10
**It is recommended upgrading to [VictoriaMetrics v1.86.1](https://docs.victoriametrics.com/CHANGELOG.html#v1861) because v1.86.0 contains a bug, which could lead to incorrect query results over time series with gaps.**
**Update note 1:** This release changes the logic behind `-maxConcurrentInserts` command-line flag. Previously this flag was limiting the number of concurrent connections established from clients, which send data to VictoriaMetrics. Some of these connections could be temporarily idle. Such connections do not take significant CPU and memory resources, so there is no need in limiting their count. The new logic takes into account only those connections, which **actively** ingest new data to VictoriaMetrics and to [vmagent](https://docs.victoriametrics.com/vmagent.html). This means that the default `-maxConcurrentInserts` value should handle cases, which could require increasing the value in the previous releases. So it is recommended trying to remove the explicitly set `-maxConcurrentInserts` command-line flag after upgrading to this release and verifying whether this reduces CPU and memory usage.
**Update note 2:** The `vm_concurrent_addrows_current` and `vm_concurrent_addrows_capacity` metrics [exported](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#monitoring) by `vmstorage` are replaced with `vm_concurrent_insert_current` and `vm_concurrent_insert_capacity` metrics in order to be consistent with the corresponding metrics exported by `vminsert`. Please update queries in dahsboards and alerting rules with new metric names if old metric names are used there.
@ -430,6 +442,20 @@ Released at 2022-08-08
* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): properly show date picker at `Table` tab. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2874).
* BUGFIX: properly generate http redirects if `-http.pathPrefix` command-line flag is set. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2918).
## [v1.79.7](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.79.7)
Released at 2023-01-10
**v1.79.x is a line of LTS releases (e.g. long-time support). It contains important up-to-date bugfixes.
The v1.79.x line will be supported for at least 12 months since [v1.79.0](https://docs.victoriametrics.com/CHANGELOG.html#v1790) release**
* BUGFIX: properly parse floating-point numbers without integer or fractional parts such as `.123` and `20.` during [data import](https://docs.victoriametrics.com/#how-to-import-time-series-data). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3544).
* BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): properly parse durations with uppercase suffixes such as `10S`, `5MS`, `1W`, etc. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3589).
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): [dockerswarm_sd_configs](https://docs.victoriametrics.com/sd_configs.html#dockerswarm_sd_configs): properly encode `filters` field. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3579)
* BUGFIX: allow specifying values bigger than 2GiB to the following command-line flag values on 32-bit architectures (`386` and `arm`): `-storage.minFreeDiskSpaceBytes` and `-remoteWrite.maxDiskUsagePerURL`. Previously values bigger than 2GiB were incorrectly truncated on these architectures.
* BUGFIX: [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise.html): expose proper values for `vm_downsampling_partitions_scheduled` and `vm_downsampling_partitions_scheduled_size_bytes` metrics, which were added at [v1.78.0](https://docs.victoriametrics.com/CHANGELOG.html#v1780). See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2612).
* BUGFIX: [DataDog protocol parser](https://docs.victoriametrics.com/#how-to-send-data-from-datadog-agent): do not re-use `host` and `device` fields from the previously parsed messages if these fields are missing in the currently parsed message. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3432).
## [v1.79.6](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.79.6)
Released at 2022-12-11

52
go.mod
View file

@ -4,7 +4,7 @@ go 1.19
require (
cloud.google.com/go/storage v1.28.1
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
github.com/VictoriaMetrics/fastcache v1.12.0
@ -12,11 +12,11 @@ require (
// like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b
github.com/VictoriaMetrics/fasthttp v1.1.0
github.com/VictoriaMetrics/metrics v1.23.0
github.com/VictoriaMetrics/metricsql v0.50.0
github.com/VictoriaMetrics/metricsql v0.51.1
github.com/aws/aws-sdk-go-v2 v1.17.3
github.com/aws/aws-sdk-go-v2/config v1.18.6
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.45
github.com/aws/aws-sdk-go-v2/service/s3 v1.29.6
github.com/aws/aws-sdk-go-v2/config v1.18.8
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0
github.com/cespare/xxhash/v2 v2.2.0
github.com/cheggaaa/pb/v3 v3.1.0
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
@ -26,37 +26,37 @@ require (
github.com/golang/snappy v0.0.4
github.com/googleapis/gax-go/v2 v2.7.0
github.com/influxdata/influxdb v1.11.0
github.com/klauspost/compress v1.15.13
github.com/klauspost/compress v1.15.14
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/oklog/ulid v1.3.1
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/prometheus v0.40.7
github.com/prometheus/prometheus v0.41.0
github.com/urfave/cli/v2 v2.23.7
github.com/valyala/fastjson v1.6.3
github.com/valyala/fastjson v1.6.4
github.com/valyala/fastrand v1.1.0
github.com/valyala/fasttemplate v1.2.2
github.com/valyala/gozstd v1.17.0
github.com/valyala/histogram v1.2.0
github.com/valyala/quicktemplate v1.7.0
golang.org/x/net v0.4.0
golang.org/x/oauth2 v0.3.0
golang.org/x/sys v0.3.0
google.golang.org/api v0.105.0
golang.org/x/net v0.5.0
golang.org/x/oauth2 v0.4.0
golang.org/x/sys v0.4.0
google.golang.org/api v0.106.0
gopkg.in/yaml.v2 v2.4.0
)
require (
cloud.google.com/go v0.107.0 // indirect
cloud.google.com/go/compute v1.14.0 // indirect
cloud.google.com/go v0.108.0 // indirect
cloud.google.com/go/compute v1.15.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.9.0 // indirect
cloud.google.com/go/iam v0.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/aws/aws-sdk-go v1.44.163 // indirect
github.com/aws/aws-sdk-go v1.44.177 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.8 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 // indirect
@ -66,9 +66,9 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.22 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.27 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.17.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.0 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
@ -86,7 +86,7 @@ require (
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pkg/errors v0.9.1 // indirect
@ -94,7 +94,7 @@ require (
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/testify v1.8.1 // indirect
@ -107,14 +107,14 @@ require (
go.opentelemetry.io/otel/trace v1.11.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/goleak v1.2.0 // indirect
golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 // indirect
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.52.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

149
go.sum
View file

@ -13,22 +13,22 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww=
cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I=
cloud.google.com/go v0.108.0 h1:xntQwnfn8oHGX0crLVinvHM+AhXvi3QHQIEcX/2hiWk=
cloud.google.com/go v0.108.0/go.mod h1:lNUfQqusBJp0bgAg6qrHgYFYbTB+dOiob1itwnlD33Q=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v1.14.0 h1:hfm2+FfxVmnRlh6LpB7cg1ZNU+5edAHmW679JePztk0=
cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo=
cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE=
cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/iam v0.9.0 h1:bK6Or6mxhuL8lnj1i9j0yMo2wE/IeTO2cWlfUrf/TZs=
cloud.google.com/go/iam v0.9.0/go.mod h1:nXAECrMt2qHpF6RZUZseteD6QyanL68reN4OXPw0UWM=
cloud.google.com/go/iam v0.10.0 h1:fpP/gByFs6US1ma53v7VxhvbJpO2Aapng6wabJ99MuI=
cloud.google.com/go/iam v0.10.0/go.mod h1:nXAECrMt2qHpF6RZUZseteD6QyanL68reN4OXPw0UWM=
cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
@ -43,8 +43,8 @@ cloud.google.com/go/storage v1.28.1 h1:F5QDG5ChchaAVQhINh24U99OWHURqrW8OmQcGKXcb
cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0 h1:sVW/AFBTGyJxDaMYlq0ct3jUXTtj12tQ6zE2GZUgVQw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.2.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 h1:VuHAcMq8pU1IWNT/m5yRaGqbK0BiQKHT8X4DTp9CHdI=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0/go.mod h1:tZoQYdDZNOiIjdSn0dVWVfl0NEPGOJqVLzSrcFk4Is0=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
@ -62,8 +62,6 @@ github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/VictoriaMetrics/fastcache v1.12.0 h1:vnVi/y9yKDcD9akmc4NqAoqgQhJrOwUF+j9LTgn4QDE=
github.com/VictoriaMetrics/fastcache v1.12.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8=
github.com/VictoriaMetrics/fasthttp v1.1.0 h1:3crd4YWHsMwu60GUXRH6OstowiFvqrwS4a/ueoLdLL0=
@ -71,8 +69,8 @@ github.com/VictoriaMetrics/fasthttp v1.1.0/go.mod h1:/7DMcogqd+aaD3G3Hg5kFgoFwlR
github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA=
github.com/VictoriaMetrics/metrics v1.23.0 h1:WzfqyzCaxUZip+OBbg1+lV33WChDSu4ssYII3nxtpeA=
github.com/VictoriaMetrics/metrics v1.23.0/go.mod h1:rAr/llLpEnAdTehiNlUxKgnjcOuROSzpw0GvjpEbvFc=
github.com/VictoriaMetrics/metricsql v0.50.0 h1:MCBhjn1qlfMqPGP6HiR9JgmEw7oTRGm/O8YwSeoaI1E=
github.com/VictoriaMetrics/metricsql v0.50.0/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0=
github.com/VictoriaMetrics/metricsql v0.51.1 h1:gmh3ZGCDrqUTdhUrr87eJOXMOputDYs1PtLwTfySTsI=
github.com/VictoriaMetrics/metricsql v0.51.1/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
@ -89,20 +87,20 @@ github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo=
github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.44.163 h1:XO1A/Laqf/l0IxVPghaQzdnVwxofVFv00IlX0BpmbhQ=
github.com/aws/aws-sdk-go v1.44.163/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.177 h1:ckMJhU5Gj+4Rta+bJIUiUd7jvHom84aim3zkGPblq0s=
github.com/aws/aws-sdk-go v1.44.177/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.17.3 h1:shN7NlnVzvDUgPQ+1rLMSxY8OWRNDRYtiqe0p/PgrhY=
github.com/aws/aws-sdk-go-v2 v1.17.3/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno=
github.com/aws/aws-sdk-go-v2/config v1.18.6 h1:iSuEAeervBWMHA7Aaq5hCNfwuN2m7x2VuQCnEbbQg68=
github.com/aws/aws-sdk-go-v2/config v1.18.6/go.mod h1:qyjgnyqpKnNGT+C62zMsrZ/Mn2OodYqwIH0DpXiW8f8=
github.com/aws/aws-sdk-go-v2/credentials v1.13.6 h1:BXOMvv3O82/4JLggIi67WKlTO56f0rliCKBT4CKyf0o=
github.com/aws/aws-sdk-go-v2/credentials v1.13.6/go.mod h1:VbnUvhw31DUu6aiubViixQwWCBNO/st84dhPeOkmdls=
github.com/aws/aws-sdk-go-v2/config v1.18.8 h1:lDpy0WM8AHsywOnVrOHaSMfpaiV2igOw8D7svkFkXVA=
github.com/aws/aws-sdk-go-v2/config v1.18.8/go.mod h1:5XCmmyutmzzgkpk/6NYTjeWb6lgo9N170m1j6pQkIBs=
github.com/aws/aws-sdk-go-v2/credentials v1.13.8 h1:vTrwTvv5qAwjWIGhZDSBH/oQHuIQjGmD232k01FUh6A=
github.com/aws/aws-sdk-go-v2/credentials v1.13.8/go.mod h1:lVa4OHbvgjVot4gmh1uouF1ubgexSCN92P6CJQpT0t8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 h1:j9wi1kQ8b+e0FBVHxCqCGo4kxDU175hoDHcWAi0sauU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21/go.mod h1:ugwW57Z5Z48bpvUyZuaPy4Kv+vEfJWnIrky7RmkBvJg=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.45 h1:ckFtXy51PT613d/KLKPxFiwRqgGIxDhVbNLof6x/XLo=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.45/go.mod h1:xar61xizdVU4pQygvQrNdZY1VCLNcOIvm87KzdZmWrE=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47 h1:E884ndKWVGt8IhtUuGhXbEsmaCvdAAkTTUDu7uAok1g=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.47/go.mod h1:KybsEsmXLO0u75FyS3F0sY4OQ97syDe8z+ISq8oEczA=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 h1:I3cakv2Uy1vNmmhRQmFptYDxOvBnwCdNwyw63N0RaRU=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27/go.mod h1:a1/UpzeyBBerajpnP5nGZa9mGzsBn5cOKxm6NWQsvoI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 h1:5NbbMrIzmUn/TXFqAle6mgrH5m9cOvMLRGL7pnG8tRE=
@ -119,14 +117,14 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 h1:5C6XgTViS
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21/go.mod h1:lRToEJsn+DRA9lW4O9L9+/3hjTkUzlzyzHqn8MTds5k=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21 h1:vY5siRXvW5TrOKm2qKEf9tliBfdLxdfy0i02LOcmqUo=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.21/go.mod h1:WZvNXT1XuH8dnJM0HvOlvk+RNn7NbAPvA/ACO0QarSc=
github.com/aws/aws-sdk-go-v2/service/s3 v1.29.6 h1:W8pLcSn6Uy0eXgDBUUl8M8Kxv7JCoP68ZKTD04OXLEA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.29.6/go.mod h1:L2l2/q76teehcW7YEsgsDjqdsDTERJeX3nOMIFlgGUE=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.27 h1:Nmvn0DJKg00TBmoBweK253Kdsuy4V5Rs68yL/H15uBQ=
github.com/aws/aws-sdk-go-v2/service/sso v1.11.27/go.mod h1:wo/B7uUm/7zw/dWhBJ4FXuw1sySU5lyIhVg1Bu2yL9A=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11 h1:KCacyVSs/wlcPGx37hcbT3IGYO8P8Jx+TgSDhAXtQMY=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.11/go.mod h1:TZSH7xLO7+phDtViY/KUp9WGCJMQkLJ/VpgkTFd5gh8=
github.com/aws/aws-sdk-go-v2/service/sts v1.17.7 h1:9Mtq1KM6nD8/+HStvWcvYnixJ5N85DX+P+OY3kI3W2k=
github.com/aws/aws-sdk-go-v2/service/sts v1.17.7/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I=
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0 h1:wddsyuESfviaiXk3w9N6/4iRwTg/a3gktjODY6jYQBo=
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.0/go.mod h1:L2l2/q76teehcW7YEsgsDjqdsDTERJeX3nOMIFlgGUE=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0 h1:/2gzjhQowRLarkkBOGPXSRnb8sQ2RVsjdG1C/UliK/c=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.0/go.mod h1:wo/B7uUm/7zw/dWhBJ4FXuw1sySU5lyIhVg1Bu2yL9A=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0 h1:Jfly6mRxk2ZOSlbCvZfKNS7TukSx1mIzhSsqZ/IGSZI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.0/go.mod h1:TZSH7xLO7+phDtViY/KUp9WGCJMQkLJ/VpgkTFd5gh8=
github.com/aws/aws-sdk-go-v2/service/sts v1.18.0 h1:kOO++CYo50RcTFISESluhWEi5Prhg+gaSs4whWabiZU=
github.com/aws/aws-sdk-go-v2/service/sts v1.18.0/go.mod h1:+lGbb3+1ugwKrNTWcf2RT05Xmp543B06zDFTwiTLp7I=
github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@ -153,20 +151,20 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE=
github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA=
github.com/digitalocean/godo v1.88.0 h1:SAEdw63xOMmzlwCeCWjLH1GcyDPUjbSAR1Bh7VELxzc=
github.com/digitalocean/godo v1.91.1 h1:1o30VOCu1aC6488qBd0SkQiBeAZ35RSTvLwCA1pQMhc=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ=
github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.10.3 h1:xdCVXxEe0Y3FQith+0cj2irwZudqGYvecuLB1HtdexY=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.6.13 h1:TvDcILLkjuZV3ER58VkBmncKsLUBqBDxra/XctCzuMM=
github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
@ -194,7 +192,7 @@ github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs=
github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU=
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@ -277,11 +275,11 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ=
github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8=
github.com/gophercloud/gophercloud v1.0.0 h1:9nTGx0jizmHxDobe4mck89FyQHVyA3CaXLIUSGJjP9k=
github.com/gophercloud/gophercloud v1.1.1 h1:MuGyqbSxiuVBqkPZ3+Nhbytk1xZxhmfCB2Rg1cJWFWM=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5wNy9zU=
github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g=
github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
@ -291,9 +289,9 @@ github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5O
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/nomad/api v0.0.0-20221102143410-8a95f1239005 h1:jKwXhVS4F7qk0g8laz+Anz0g/6yaSJ3HqmSAuSNLUcA=
github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY=
github.com/hetznercloud/hcloud-go v1.35.3 h1:WCmFAhLRooih2QHAsbCbEdpIHnshQQmrPqsr3rHE1Ow=
github.com/hashicorp/nomad/api v0.0.0-20221214074818-7dbbf6bc584d h1:kEWrUx7mld3c6HRcO2KhfD1MYBkofuZfEfDwCRQ9aMU=
github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=
github.com/hetznercloud/hcloud-go v1.38.0 h1:K6Pd/mMdcLfBhvwG39qyAaacp4pCS3dKa8gChmLKxLg=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/influxdata/influxdb v1.11.0 h1:0X+ZsbcOWc6AEi5MHee9BYqXCKmz8IZsljrRYjmV8Qg=
@ -318,8 +316,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0=
github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/klauspost/compress v1.15.14 h1:i7WCKDToww0wA+9qrUZ1xOjp218vfFo3nTU6UHp+gOc=
github.com/klauspost/compress v1.15.14/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00=
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=
@ -338,8 +336,9 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
@ -363,7 +362,7 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
github.com/ovh/go-ovh v1.1.0 h1:bHXZmw8nTgZin4Nv7JuaLs0KG5x54EQR7migYTd1zrk=
github.com/ovh/go-ovh v1.3.0 h1:mvZaddk4E4kLcXhzb+cxBsMPYp2pHqiQpWYkInsuZPQ=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@ -395,10 +394,10 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
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.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/prometheus v0.40.7 h1:cYtp4YrR9M99YpTUfXbei/HjIJJ+En23NKsTCeZ2U2w=
github.com/prometheus/prometheus v0.40.7/go.mod h1:nO+vI0cJo1ezp2DPGw5NEnTlYHGRpBFrqE4zb9O0g0U=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/prometheus/prometheus v0.41.0 h1:+QR4QpzwE54zsKk2K7EUkof3tHxa3b/fyw7xJ4jR1Ns=
github.com/prometheus/prometheus v0.41.0/go.mod h1:Uu5817xm7ibU/VaDZ9pu1ssGzcpO9Bd+LyoZ76RpHyo=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
@ -406,7 +405,7 @@ github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9 h1:0roa6gXKgyta64uqh52AQG3wzZXH21unn+ltzQSXML0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10 h1:wsfMs0iv+MJiViM37qh5VEKISi3/ZUq2nNKNdqmumAs=
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=
@ -429,8 +428,8 @@ github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6f
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus=
github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc=
github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8=
github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
@ -488,8 +487,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 h1:5oN1Pz/eDhCpbMbLstvIPa0b/BEQo6g6nwV3pLjfM6w=
golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a h1:tlXy25amD5A7gOfbXdqCGN5k8ESEed/Ee1E5RcrYnqU=
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@ -512,7 +511,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -548,16 +547,16 @@ golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8=
golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk=
golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M=
golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -617,12 +616,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -631,8 +630,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -681,7 +680,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -704,8 +703,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.105.0 h1:t6P9Jj+6XTn4U9I2wycQai6Q/Kz7iOT+QzjJ3G2V4x8=
google.golang.org/api v0.105.0/go.mod h1:qh7eD5FJks5+BcE+cjBIm6Gz8vioK7EHvnlniqXBnqI=
google.golang.org/api v0.106.0 h1:ffmW0faWCwKkpbbtvlY/K/8fUl+JKvNS5CVzRoyfCv8=
google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@ -743,8 +742,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSgaFAGyInDXeWzUhvYH57G/5GKMn70=
google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@ -758,8 +757,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk=
google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@ -800,16 +799,16 @@ 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=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.25.3 h1:Q1v5UFfYe87vi5H7NU0p4RXC26PPMT8KOpr1TLQbCMQ=
k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc=
k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0=
k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I=
k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg=
k8s.io/client-go v0.26.0 h1:lT1D3OfO+wIi9UFolCrifbjUUgu7CpLca0AD8ghRLI8=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog/v2 v2.80.0 h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g=
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA=
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4=
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 h1:tBEbstoM+K0FiBV5KGAKQ0kuvf54v/hwpldiJt69w1s=
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=

View file

@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
const Version = "1.14.0"
const Version = "1.15.1"

View file

@ -1,5 +1,12 @@
# Changes
## [0.10.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.9.0...iam/v0.10.0) (2023-01-04)
### Features
* **iam:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0))
## [0.9.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.8.0...iam/v0.9.0) (2022-12-15)

View file

@ -287,6 +287,15 @@
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/bigquery/datapolicies/apiv1": {
"distribution_name": "cloud.google.com/go/bigquery/datapolicies/apiv1",
"description": "BigQuery Data Policy API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/bigquery/latest/datapolicies/apiv1",
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/bigquery/datapolicies/apiv1beta1": {
"distribution_name": "cloud.google.com/go/bigquery/datapolicies/apiv1beta1",
"description": "BigQuery Data Policy API",
@ -935,6 +944,15 @@
"release_level": "ga",
"library_type": "CORE"
},
"cloud.google.com/go/iam/apiv1": {
"distribution_name": "cloud.google.com/go/iam/apiv1",
"description": "IAM Meta API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/iam/latest/apiv1",
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/iam/apiv2": {
"distribution_name": "cloud.google.com/go/iam/apiv2",
"description": "Identity and Access Management (IAM) API",
@ -1880,6 +1898,15 @@
"release_level": "ga",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/vmwareengine/apiv1": {
"distribution_name": "cloud.google.com/go/vmwareengine/apiv1",
"description": "VMware Engine API",
"language": "Go",
"client_library_type": "generated",
"docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/vmwareengine/latest/apiv1",
"release_level": "beta",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/vpcaccess/apiv1": {
"distribution_name": "cloud.google.com/go/vpcaccess/apiv1",
"description": "Serverless VPC Access API",

View file

@ -1,5 +1,16 @@
# Release History
## 1.3.0 (2023-01-06)
### Features Added
* Added `BearerTokenOptions.AuthorizationHandler` to enable extending `runtime.BearerTokenPolicy`
with custom authorization logic
* Added `Client` types and matching constructors to the `azcore` and `arm` packages. These represent a basic client for HTTP and ARM respectively.
### Other Changes
* Updated `internal` module to latest version.
* `policy/Request.SetBody()` allows replacing a request's body with an empty one
## 1.2.0 (2022-11-04)
### Features Added

View file

@ -7,25 +7,20 @@
package azcore
import (
"context"
"reflect"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
)
// AccessToken represents an Azure service bearer access token with expiry information.
type AccessToken struct {
Token string
ExpiresOn time.Time
}
type AccessToken = exported.AccessToken
// TokenCredential represents a credential capable of providing an OAuth token.
type TokenCredential interface {
// GetToken requests an access token for the specified set of scopes.
GetToken(ctx context.Context, options policy.TokenRequestOptions) (AccessToken, error)
}
type TokenCredential = exported.TokenCredential
// holds sentinel values used to send nulls
var nullables map[reflect.Type]interface{} = map[reflect.Type]interface{}{}
@ -73,3 +68,46 @@ func IsNullValue[T any](v T) bool {
// ClientOptions contains configuration settings for a client's pipeline.
type ClientOptions = policy.ClientOptions
// Client is a basic HTTP client. It consists of a pipeline and tracing provider.
type Client struct {
pl runtime.Pipeline
tr tracing.Tracer
}
// NewClient creates a new Client instance with the provided values.
// - clientName - the fully qualified name of the client ("package.Client"); this is used by the tracing provider when creating spans
// - moduleVersion - the semantic version of the containing module; used by the telemetry policy
// - plOpts - pipeline configuration options; can be the zero-value
// - options - optional client configurations; pass nil to accept the default values
func NewClient(clientName, moduleVersion string, plOpts runtime.PipelineOptions, options *ClientOptions) (*Client, error) {
pkg, err := shared.ExtractPackageName(clientName)
if err != nil {
return nil, err
}
if options == nil {
options = &ClientOptions{}
}
if !options.Telemetry.Disabled {
if err := shared.ValidateModVer(moduleVersion); err != nil {
return nil, err
}
}
pl := runtime.NewPipeline(pkg, moduleVersion, plOpts, options)
tr := options.TracingProvider.NewTracer(clientName, moduleVersion)
return &Client{pl: pl, tr: tr}, nil
}
// Pipeline returns the pipeline for this client.
func (c *Client) Pipeline() runtime.Pipeline {
return c.pl
}
// Tracer returns the tracer for this client.
func (c *Client) Tracer() tracing.Tracer {
return c.tr
}

View file

@ -7,8 +7,10 @@
package exported
import (
"context"
"io"
"net/http"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
)
@ -58,3 +60,24 @@ func Payload(resp *http.Response) ([]byte, error) {
resp.Body = shared.NewNopClosingBytesReader(bytesBody)
return bytesBody, nil
}
// AccessToken represents an Azure service bearer access token with expiry information.
// Exported as azcore.AccessToken.
type AccessToken struct {
Token string
ExpiresOn time.Time
}
// TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token.
// Exported as policy.TokenRequestOptions.
type TokenRequestOptions struct {
// Scopes contains the list of permission scopes required for the token.
Scopes []string
}
// TokenCredential represents a credential capable of providing an OAuth token.
// Exported as azcore.TokenCredential.
type TokenCredential interface {
// GetToken requests an access token for the specified set of scopes.
GetToken(ctx context.Context, options TokenRequestOptions) (AccessToken, error)
}

View file

@ -100,32 +100,46 @@ func (req *Request) OperationValue(value interface{}) bool {
return req.values.get(value)
}
// SetBody sets the specified ReadSeekCloser as the HTTP request body.
// SetBody sets the specified ReadSeekCloser as the HTTP request body, and sets Content-Type and Content-Length
// accordingly. If the ReadSeekCloser is nil or empty, Content-Length won't be set. If contentType is "",
// Content-Type won't be set.
func (req *Request) SetBody(body io.ReadSeekCloser, contentType string) error {
// Set the body and content length.
size, err := body.Seek(0, io.SeekEnd) // Seek to the end to get the stream's size
if err != nil {
return err
var err error
var size int64
if body != nil {
size, err = body.Seek(0, io.SeekEnd) // Seek to the end to get the stream's size
if err != nil {
return err
}
}
if size == 0 {
body.Close()
return nil
// treat an empty stream the same as a nil one: assign req a nil body
body = nil
// RFC 9110 specifies a client shouldn't set Content-Length on a request containing no content
// (Del is a no-op when the header has no value)
req.req.Header.Del(shared.HeaderContentLength)
} else {
_, err = body.Seek(0, io.SeekStart)
if err != nil {
return err
}
req.req.Header.Set(shared.HeaderContentLength, strconv.FormatInt(size, 10))
req.Raw().GetBody = func() (io.ReadCloser, error) {
_, err := body.Seek(0, io.SeekStart) // Seek back to the beginning of the stream
return body, err
}
}
_, err = body.Seek(0, io.SeekStart)
if err != nil {
return err
}
req.Raw().GetBody = func() (io.ReadCloser, error) {
_, err := body.Seek(0, io.SeekStart) // Seek back to the beginning of the stream
return body, err
}
// keep a copy of the original body. this is to handle cases
// keep a copy of the body argument. this is to handle cases
// where req.Body is replaced, e.g. httputil.DumpRequest and friends.
req.body = body
req.req.Body = body
req.req.ContentLength = size
req.req.Header.Set(shared.HeaderContentType, contentType)
req.req.Header.Set(shared.HeaderContentLength, strconv.FormatInt(size, 10))
if contentType == "" {
// Del is a no-op when the header has no value
req.req.Header.Del(shared.HeaderContentType)
} else {
req.req.Header.Set(shared.HeaderContentType, contentType)
}
return nil
}

View file

@ -30,5 +30,5 @@ const (
Module = "azcore"
// Version is the semantic version (see http://semver.org) of this module.
Version = "v1.2.0"
Version = "v1.3.0"
)

View file

@ -9,10 +9,13 @@ package shared
import (
"context"
"errors"
"fmt"
"io"
"net/http"
"reflect"
"regexp"
"strconv"
"strings"
"time"
)
@ -133,3 +136,24 @@ type TransportFunc func(*http.Request) (*http.Response, error)
func (pf TransportFunc) Do(req *http.Request) (*http.Response, error) {
return pf(req)
}
// ValidateModVer verifies that moduleVersion is a valid semver 2.0 string.
func ValidateModVer(moduleVersion string) error {
modVerRegx := regexp.MustCompile(`^v\d+\.\d+\.\d+(?:-[a-zA-Z0-9_.-]+)?$`)
if !modVerRegx.MatchString(moduleVersion) {
return fmt.Errorf("malformed moduleVersion param value %s", moduleVersion)
}
return nil
}
// ExtractPackageName returns "package" from "package.Client".
// If clientName is malformed, an error is returned.
func ExtractPackageName(clientName string) (string, error) {
pkg, client, ok := strings.Cut(clientName, ".")
if !ok {
return "", fmt.Errorf("missing . in clientName %s", clientName)
} else if pkg == "" || client == "" {
return "", fmt.Errorf("malformed clientName %s", clientName)
}
return pkg, nil
}

View file

@ -7,6 +7,7 @@
package policy
import (
"net/http"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
@ -125,12 +126,30 @@ type TelemetryOptions struct {
}
// TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token.
type TokenRequestOptions struct {
// Scopes contains the list of permission scopes required for the token.
Scopes []string
}
type TokenRequestOptions = exported.TokenRequestOptions
// BearerTokenOptions configures the bearer token policy's behavior.
type BearerTokenOptions struct {
// placeholder for future options
// AuthorizationHandler allows SDK developers to run client-specific logic when BearerTokenPolicy must authorize a request.
// When this field isn't set, the policy follows its default behavior of authorizing every request with a bearer token from
// its given credential.
AuthorizationHandler AuthorizationHandler
}
// AuthorizationHandler allows SDK developers to insert custom logic that runs when BearerTokenPolicy must authorize a request.
type AuthorizationHandler struct {
// OnRequest is called each time the policy receives a request. Its func parameter authorizes the request with a token
// from the policy's given credential. Implementations that need to perform I/O should use the Request's context,
// available from Request.Raw().Context(). When OnRequest returns an error, the policy propagates that error and doesn't
// send the request. When OnRequest is nil, the policy follows its default behavior, authorizing the request with a
// token from its credential according to its configuration.
OnRequest func(*Request, func(TokenRequestOptions) error) error
// OnChallenge is called when the policy receives a 401 response, allowing the AuthorizationHandler to re-authorize the
// request according to an authentication challenge (the Response's WWW-Authenticate header). OnChallenge is responsible
// for parsing parameters from the challenge. Its func parameter will authorize the request with a token from the policy's
// given credential. Implementations that need to perform I/O should use the Request's context, available from
// Request.Raw().Context(). When OnChallenge returns nil, the policy will send the request again. When OnChallenge is nil,
// the policy will return any 401 response to the client.
OnChallenge func(*Request, *http.Response, func(TokenRequestOptions) error) error
}

View file

@ -4,35 +4,39 @@
package runtime
import (
"errors"
"net/http"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo"
"github.com/Azure/azure-sdk-for-go/sdk/internal/temporal"
)
// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential.
type BearerTokenPolicy struct {
// mainResource is the resource to be retreived using the tenant specified in the credential
mainResource *temporal.Resource[azcore.AccessToken, acquiringResourceState]
mainResource *temporal.Resource[exported.AccessToken, acquiringResourceState]
// the following fields are read-only
cred azcore.TokenCredential
scopes []string
authzHandler policy.AuthorizationHandler
cred exported.TokenCredential
scopes []string
}
type acquiringResourceState struct {
req *policy.Request
p *BearerTokenPolicy
tro policy.TokenRequestOptions
}
// acquire acquires or updates the resource; only one
// thread/goroutine at a time ever calls this function
func acquire(state acquiringResourceState) (newResource azcore.AccessToken, newExpiration time.Time, err error) {
tk, err := state.p.cred.GetToken(state.req.Raw().Context(), policy.TokenRequestOptions{Scopes: state.p.scopes})
func acquire(state acquiringResourceState) (newResource exported.AccessToken, newExpiration time.Time, err error) {
tk, err := state.p.cred.GetToken(state.req.Raw().Context(), state.tro)
if err != nil {
return azcore.AccessToken{}, time.Time{}, err
return exported.AccessToken{}, time.Time{}, err
}
return tk, tk.ExpiresOn, nil
}
@ -41,24 +45,72 @@ func acquire(state acquiringResourceState) (newResource azcore.AccessToken, newE
// cred: an azcore.TokenCredential implementation such as a credential object from azidentity
// scopes: the list of permission scopes required for the token.
// opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options.
func NewBearerTokenPolicy(cred azcore.TokenCredential, scopes []string, opts *policy.BearerTokenOptions) *BearerTokenPolicy {
func NewBearerTokenPolicy(cred exported.TokenCredential, scopes []string, opts *policy.BearerTokenOptions) *BearerTokenPolicy {
if opts == nil {
opts = &policy.BearerTokenOptions{}
}
return &BearerTokenPolicy{
authzHandler: opts.AuthorizationHandler,
cred: cred,
scopes: scopes,
mainResource: temporal.NewResource(acquire),
}
}
// authenticateAndAuthorize returns a function which authorizes req with a token from the policy's credential
func (b *BearerTokenPolicy) authenticateAndAuthorize(req *policy.Request) func(policy.TokenRequestOptions) error {
return func(tro policy.TokenRequestOptions) error {
as := acquiringResourceState{p: b, req: req, tro: tro}
tk, err := b.mainResource.Get(as)
if err != nil {
return err
}
req.Raw().Header.Set(shared.HeaderAuthorization, shared.BearerTokenPrefix+tk.Token)
return nil
}
}
// Do authorizes a request with a bearer token
func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) {
as := acquiringResourceState{
p: b,
req: req,
var err error
if b.authzHandler.OnRequest != nil {
err = b.authzHandler.OnRequest(req, b.authenticateAndAuthorize(req))
} else {
err = b.authenticateAndAuthorize(req)(policy.TokenRequestOptions{Scopes: b.scopes})
}
tk, err := b.mainResource.Get(as)
if err != nil {
return nil, ensureNonRetriable(err)
}
res, err := req.Next()
if err != nil {
return nil, err
}
req.Raw().Header.Set(shared.HeaderAuthorization, shared.BearerTokenPrefix+tk.Token)
return req.Next()
if res.StatusCode == http.StatusUnauthorized {
b.mainResource.Expire()
if res.Header.Get("WWW-Authenticate") != "" && b.authzHandler.OnChallenge != nil {
if err = b.authzHandler.OnChallenge(req, res, b.authenticateAndAuthorize(req)); err == nil {
res, err = req.Next()
}
}
}
return res, ensureNonRetriable(err)
}
func ensureNonRetriable(err error) error {
var nre errorinfo.NonRetriable
if err != nil && !errors.As(err, &nre) {
err = btpError{err}
}
return err
}
// btpError is a wrapper that ensures RetryPolicy doesn't retry requests BearerTokenPolicy couldn't authorize
type btpError struct {
error
}
func (btpError) NonRetriable() {}
var _ errorinfo.NonRetriable = (*btpError)(nil)

View file

@ -331,19 +331,22 @@ func scanNumMultiplier(s string) int {
func scanIdent(s string) string {
i := 0
for i < len(s) {
if isIdentChar(s[i]) {
i++
r, size := utf8.DecodeRuneInString(s[i:])
if i == 0 && isFirstIdentChar(r) || i > 0 && isIdentChar(r) {
i += size
continue
}
if s[i] != '\\' {
if r != '\\' {
break
}
i++
// Do not verify the next char, since it is escaped.
// The next char may be encoded as multi-byte UTF8 sequence. See https://en.wikipedia.org/wiki/UTF-8#Encoding
_, size := utf8.DecodeRuneInString(s[i:])
i += size
r, n := decodeEscapeSequence(s[i:])
if r == utf8.RuneError {
// Invalid escape sequence
i -= size
break
}
i += n
}
if i == 0 {
panic("BUG: scanIdent couldn't find a single ident char; make sure isIdentPrefix called before scanIdent")
@ -360,23 +363,12 @@ func unescapeIdent(s string) string {
for {
dst = append(dst, s[:n]...)
s = s[n+1:]
if len(s) == 0 {
return string(dst)
}
if s[0] == 'x' && len(s) >= 3 {
h1 := fromHex(s[1])
h2 := fromHex(s[2])
if h1 >= 0 && h2 >= 0 {
dst = append(dst, byte((h1<<4)|h2))
s = s[3:]
} else {
dst = append(dst, s[0])
s = s[1:]
}
r, size := decodeEscapeSequence(s)
if r == utf8.RuneError {
// Cannot decode escape sequence. Put it in the output as is
dst = append(dst, '\\')
} else {
// UTF8 char. See https://en.wikipedia.org/wiki/UTF-8#Encoding
_, size := utf8.DecodeRuneInString(s)
dst = append(dst, s[:size]...)
dst = utf8.AppendRune(dst, r)
s = s[size:]
}
n = strings.IndexByte(s, '\\')
@ -387,49 +379,16 @@ func unescapeIdent(s string) string {
}
}
func fromHex(ch byte) int {
if ch >= '0' && ch <= '9' {
return int(ch - '0')
}
if ch >= 'a' && ch <= 'f' {
return int((ch - 'a') + 10)
}
if ch >= 'A' && ch <= 'F' {
return int((ch - 'A') + 10)
}
return -1
}
func toHex(n byte) byte {
if n < 10 {
return '0' + n
}
return 'a' + (n - 10)
}
func appendEscapedIdent(dst []byte, s string) []byte {
for i := 0; i < len(s); i++ {
ch := s[i]
if isIdentChar(ch) {
if i == 0 && !isFirstIdentChar(ch) {
// hex-encode the first char
dst = append(dst, '\\', 'x', toHex(ch>>4), toHex(ch&0xf))
} else {
dst = append(dst, ch)
}
continue
}
// escape ch
dst = append(dst, '\\')
i := 0
for i < len(s) {
r, size := utf8.DecodeRuneInString(s[i:])
if r != utf8.RuneError && unicode.IsPrint(r) {
dst = append(dst, s[i:i+size]...)
i += size - 1
if i == 0 && isFirstIdentChar(r) || i > 0 && isIdentChar(r) {
dst = utf8.AppendRune(dst, r)
} else {
// hex-encode non-printable chars
dst = append(dst, 'x', toHex(ch>>4), toHex(ch&0xf))
dst = appendEscapeSequence(dst, r)
}
i += size
}
return dst
}
@ -597,6 +556,7 @@ func DurationValue(s string, step int64) (int64, error) {
}
func parseSingleDuration(s string, step int64) (float64, error) {
s = strings.ToLower(s)
numPart := s[:len(s)-1]
if strings.HasSuffix(numPart, "m") {
// Duration in ms
@ -656,6 +616,7 @@ func scanSingleDuration(s string, canBeNegative bool) int {
if len(s) == 0 {
return -1
}
s = strings.ToLower(s)
i := 0
if s[0] == '-' && canBeNegative {
i++
@ -703,25 +664,26 @@ func isIdentPrefix(s string) bool {
if len(s) == 0 {
return false
}
if s[0] == '\\' {
// Assume this is an escape char for the next char.
return true
r, size := utf8.DecodeRuneInString(s)
if r == '\\' {
r, _ = decodeEscapeSequence(s[size:])
return r != utf8.RuneError
}
return isFirstIdentChar(s[0])
return isFirstIdentChar(r)
}
func isFirstIdentChar(ch byte) bool {
if ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' {
func isFirstIdentChar(r rune) bool {
if unicode.IsLetter(r) {
return true
}
return ch == '_' || ch == ':'
return r == '_' || r == ':'
}
func isIdentChar(ch byte) bool {
if isFirstIdentChar(ch) {
func isIdentChar(r rune) bool {
if isFirstIdentChar(r) {
return true
}
return isDecimalChar(ch) || ch == '.'
return r < 256 && isDecimalChar(byte(r)) || r == '.'
}
func isSpaceChar(ch byte) bool {
@ -732,3 +694,67 @@ func isSpaceChar(ch byte) bool {
return false
}
}
func appendEscapeSequence(dst []byte, r rune) []byte {
dst = append(dst, '\\')
if unicode.IsPrint(r) {
return utf8.AppendRune(dst, r)
}
// hex-encode non-printable chars
if r < 256 {
return append(dst, 'x', toHex(byte(r>>4)), toHex(byte(r&0xf)))
}
return append(dst, 'u', toHex(byte(r>>12)), toHex(byte((r>>8)&0xf)), toHex(byte(r>>4)), toHex(byte(r&0xf)))
}
func decodeEscapeSequence(s string) (rune, int) {
if strings.HasPrefix(s, "x") || strings.HasPrefix(s, "X") {
if len(s) >= 3 {
h1 := fromHex(s[1])
h2 := fromHex(s[2])
if h1 >= 0 && h2 >= 0 {
r := rune((h1 << 4) | h2)
return r, 3
}
}
return utf8.RuneError, 0
}
if strings.HasPrefix(s, "u") || strings.HasPrefix(s, "U") {
if len(s) >= 5 {
h1 := fromHex(s[1])
h2 := fromHex(s[2])
h3 := fromHex(s[3])
h4 := fromHex(s[4])
if h1 >= 0 && h2 >= 0 && h3 >= 0 && h4 >= 0 {
return rune((h1 << 12) | (h2 << 8) | (h3 << 4) | h4), 5
}
}
return utf8.RuneError, 0
}
r, size := utf8.DecodeRuneInString(s)
if unicode.IsPrint(r) {
return r, size
}
// Improperly escaped non-printable char
return utf8.RuneError, 0
}
func fromHex(ch byte) int {
if ch >= '0' && ch <= '9' {
return int(ch - '0')
}
if ch >= 'a' && ch <= 'f' {
return int((ch - 'a') + 10)
}
if ch >= 'A' && ch <= 'F' {
return int((ch - 'A') + 10)
}
return -1
}
func toHex(n byte) byte {
if n < 10 {
return '0' + n
}
return 'a' + (n - 10)
}

View file

@ -1,3 +1,11 @@
# v1.18.8 (2023-01-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.7 (2022-12-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.6 (2022-12-19)
* **Dependency Update**: Updated to the latest SDK module versions

View file

@ -3,4 +3,4 @@
package config
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.18.6"
const goModuleVersion = "1.18.8"

View file

@ -1,3 +1,11 @@
# v1.13.8 (2023-01-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.13.7 (2022-12-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.13.6 (2022-12-19)
* **Dependency Update**: Updated to the latest SDK module versions

View file

@ -3,4 +3,4 @@
package credentials
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.6"
const goModuleVersion = "1.13.8"

View file

@ -1,3 +1,11 @@
# v1.11.47 (2023-01-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.11.46 (2022-12-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.11.45 (2022-12-19)
* **Dependency Update**: Updated to the latest SDK module versions

View file

@ -3,4 +3,4 @@
package manager
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.11.45"
const goModuleVersion = "1.11.47"

View file

@ -1,3 +1,7 @@
# v1.30.0 (2023-01-05)
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
# v1.29.6 (2022-12-15)
* **Dependency Update**: Updated to the latest SDK module versions

View file

@ -3,4 +3,4 @@
package s3
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.29.6"
const goModuleVersion = "1.30.0"

View file

@ -12,6 +12,8 @@ import (
type BucketAlreadyExists struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -24,7 +26,12 @@ func (e *BucketAlreadyExists) ErrorMessage() string {
}
return *e.Message
}
func (e *BucketAlreadyExists) ErrorCode() string { return "BucketAlreadyExists" }
func (e *BucketAlreadyExists) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "BucketAlreadyExists"
}
return *e.ErrorCodeOverride
}
func (e *BucketAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The bucket you tried to create already exists, and you own it. Amazon S3 returns
@ -35,6 +42,8 @@ func (e *BucketAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.Fau
type BucketAlreadyOwnedByYou struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -47,13 +56,20 @@ func (e *BucketAlreadyOwnedByYou) ErrorMessage() string {
}
return *e.Message
}
func (e *BucketAlreadyOwnedByYou) ErrorCode() string { return "BucketAlreadyOwnedByYou" }
func (e *BucketAlreadyOwnedByYou) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "BucketAlreadyOwnedByYou"
}
return *e.ErrorCodeOverride
}
func (e *BucketAlreadyOwnedByYou) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Object is archived and inaccessible until restored.
type InvalidObjectState struct {
Message *string
ErrorCodeOverride *string
StorageClass StorageClass
AccessTier IntelligentTieringAccessTier
@ -69,13 +85,20 @@ func (e *InvalidObjectState) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidObjectState) ErrorCode() string { return "InvalidObjectState" }
func (e *InvalidObjectState) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidObjectState"
}
return *e.ErrorCodeOverride
}
func (e *InvalidObjectState) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified bucket does not exist.
type NoSuchBucket struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -88,13 +111,20 @@ func (e *NoSuchBucket) ErrorMessage() string {
}
return *e.Message
}
func (e *NoSuchBucket) ErrorCode() string { return "NoSuchBucket" }
func (e *NoSuchBucket) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "NoSuchBucket"
}
return *e.ErrorCodeOverride
}
func (e *NoSuchBucket) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified key does not exist.
type NoSuchKey struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -107,13 +137,20 @@ func (e *NoSuchKey) ErrorMessage() string {
}
return *e.Message
}
func (e *NoSuchKey) ErrorCode() string { return "NoSuchKey" }
func (e *NoSuchKey) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "NoSuchKey"
}
return *e.ErrorCodeOverride
}
func (e *NoSuchKey) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified multipart upload does not exist.
type NoSuchUpload struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -126,13 +163,20 @@ func (e *NoSuchUpload) ErrorMessage() string {
}
return *e.Message
}
func (e *NoSuchUpload) ErrorCode() string { return "NoSuchUpload" }
func (e *NoSuchUpload) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "NoSuchUpload"
}
return *e.ErrorCodeOverride
}
func (e *NoSuchUpload) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified content does not exist.
type NotFound struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -145,13 +189,20 @@ func (e *NotFound) ErrorMessage() string {
}
return *e.Message
}
func (e *NotFound) ErrorCode() string { return "NotFound" }
func (e *NotFound) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "NotFound"
}
return *e.ErrorCodeOverride
}
func (e *NotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// This action is not allowed against this storage tier.
type ObjectAlreadyInActiveTierError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -164,7 +215,12 @@ func (e *ObjectAlreadyInActiveTierError) ErrorMessage() string {
}
return *e.Message
}
func (e *ObjectAlreadyInActiveTierError) ErrorCode() string { return "ObjectAlreadyInActiveTierError" }
func (e *ObjectAlreadyInActiveTierError) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "ObjectAlreadyInActiveTierError"
}
return *e.ErrorCodeOverride
}
func (e *ObjectAlreadyInActiveTierError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The source object of the COPY action is not in the active tier and is only
@ -172,6 +228,8 @@ func (e *ObjectAlreadyInActiveTierError) ErrorFault() smithy.ErrorFault { return
type ObjectNotInActiveTierError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -184,5 +242,10 @@ func (e *ObjectNotInActiveTierError) ErrorMessage() string {
}
return *e.Message
}
func (e *ObjectNotInActiveTierError) ErrorCode() string { return "ObjectNotInActiveTierError" }
func (e *ObjectNotInActiveTierError) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "ObjectNotInActiveTierError"
}
return *e.ErrorCodeOverride
}
func (e *ObjectNotInActiveTierError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }

View file

@ -1,3 +1,11 @@
# v1.12.0 (2023-01-05)
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
# v1.11.28 (2022-12-20)
* No change notes available for this release.
# v1.11.27 (2022-12-15)
* **Dependency Update**: Updated to the latest SDK module versions

View file

@ -3,4 +3,4 @@
package sso
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.11.27"
const goModuleVersion = "1.12.0"

View file

@ -135,6 +135,14 @@ var defaultPartitions = endpoints.Partitions{
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{
Hostname: "portal.sso.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{
@ -191,6 +199,14 @@ var defaultPartitions = endpoints.Partitions{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{
Hostname: "portal.sso.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
@ -279,6 +295,14 @@ var defaultPartitions = endpoints.Partitions{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Hostname: "portal.sso.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{

View file

@ -12,6 +12,8 @@ import (
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -24,13 +26,20 @@ func (e *InvalidRequestException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" }
func (e *InvalidRequestException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified resource doesn't exist.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -43,7 +52,12 @@ func (e *ResourceNotFoundException) ErrorMessage() string {
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" }
func (e *ResourceNotFoundException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the request is being made too frequently and is more than what
@ -51,6 +65,8 @@ func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smit
type TooManyRequestsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -63,7 +79,12 @@ func (e *TooManyRequestsException) ErrorMessage() string {
}
return *e.Message
}
func (e *TooManyRequestsException) ErrorCode() string { return "TooManyRequestsException" }
func (e *TooManyRequestsException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "TooManyRequestsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the request is not authorized. This can happen due to an invalid
@ -71,6 +92,8 @@ func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smith
type UnauthorizedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -83,5 +106,10 @@ func (e *UnauthorizedException) ErrorMessage() string {
}
return *e.Message
}
func (e *UnauthorizedException) ErrorCode() string { return "UnauthorizedException" }
func (e *UnauthorizedException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "UnauthorizedException"
}
return *e.ErrorCodeOverride
}
func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }

View file

@ -1,3 +1,7 @@
# v1.14.0 (2023-01-05)
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
# v1.13.11 (2022-12-19)
* No change notes available for this release.

View file

@ -3,4 +3,4 @@
package ssooidc
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.11"
const goModuleVersion = "1.14.0"

View file

@ -11,6 +11,8 @@ import (
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -26,7 +28,12 @@ func (e *AccessDeniedException) ErrorMessage() string {
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" }
func (e *AccessDeniedException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that a request to authorize a client with an access user session token
@ -34,6 +41,8 @@ func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.F
type AuthorizationPendingException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -49,7 +58,12 @@ func (e *AuthorizationPendingException) ErrorMessage() string {
}
return *e.Message
}
func (e *AuthorizationPendingException) ErrorCode() string { return "AuthorizationPendingException" }
func (e *AuthorizationPendingException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "AuthorizationPendingException"
}
return *e.ErrorCodeOverride
}
func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the token issued by the service is expired and is no longer
@ -57,6 +71,8 @@ func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return
type ExpiredTokenException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -72,7 +88,12 @@ func (e *ExpiredTokenException) ErrorMessage() string {
}
return *e.Message
}
func (e *ExpiredTokenException) ErrorCode() string { return "ExpiredTokenException" }
func (e *ExpiredTokenException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "ExpiredTokenException"
}
return *e.ErrorCodeOverride
}
func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that an error from the service occurred while trying to process a
@ -80,6 +101,8 @@ func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.F
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -95,7 +118,12 @@ func (e *InternalServerException) ErrorMessage() string {
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string { return "InternalServerException" }
func (e *InternalServerException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Indicates that the clientId or clientSecret in the request is invalid. For
@ -104,6 +132,8 @@ func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy
type InvalidClientException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -119,7 +149,12 @@ func (e *InvalidClientException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidClientException) ErrorCode() string { return "InvalidClientException" }
func (e *InvalidClientException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidClientException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the client information sent in the request during registration is
@ -127,6 +162,8 @@ func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.
type InvalidClientMetadataException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -142,7 +179,12 @@ func (e *InvalidClientMetadataException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidClientMetadataException) ErrorCode() string { return "InvalidClientMetadataException" }
func (e *InvalidClientMetadataException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidClientMetadataException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that a request contains an invalid grant. This can occur if a client
@ -150,6 +192,8 @@ func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return
type InvalidGrantException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -165,7 +209,12 @@ func (e *InvalidGrantException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidGrantException) ErrorCode() string { return "InvalidGrantException" }
func (e *InvalidGrantException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidGrantException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that something is wrong with the input to the request. For example, a
@ -173,6 +222,8 @@ func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.F
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -188,13 +239,20 @@ func (e *InvalidRequestException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" }
func (e *InvalidRequestException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the scope provided in the request is invalid.
type InvalidScopeException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -210,7 +268,12 @@ func (e *InvalidScopeException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidScopeException) ErrorCode() string { return "InvalidScopeException" }
func (e *InvalidScopeException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidScopeException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the client is making the request too frequently and is more than
@ -218,6 +281,8 @@ func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.F
type SlowDownException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -233,7 +298,12 @@ func (e *SlowDownException) ErrorMessage() string {
}
return *e.Message
}
func (e *SlowDownException) ErrorCode() string { return "SlowDownException" }
func (e *SlowDownException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "SlowDownException"
}
return *e.ErrorCodeOverride
}
func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the client is not currently authorized to make the request. This
@ -241,6 +311,8 @@ func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.Fault
type UnauthorizedClientException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -256,13 +328,20 @@ func (e *UnauthorizedClientException) ErrorMessage() string {
}
return *e.Message
}
func (e *UnauthorizedClientException) ErrorCode() string { return "UnauthorizedClientException" }
func (e *UnauthorizedClientException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "UnauthorizedClientException"
}
return *e.ErrorCodeOverride
}
func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the grant type in the request is not supported by the service.
type UnsupportedGrantTypeException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
@ -278,5 +357,10 @@ func (e *UnsupportedGrantTypeException) ErrorMessage() string {
}
return *e.Message
}
func (e *UnsupportedGrantTypeException) ErrorCode() string { return "UnsupportedGrantTypeException" }
func (e *UnsupportedGrantTypeException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "UnsupportedGrantTypeException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }

View file

@ -1,3 +1,7 @@
# v1.18.0 (2023-01-05)
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
# v1.17.7 (2022-12-15)
* **Dependency Update**: Updated to the latest SDK module versions

View file

@ -3,4 +3,4 @@
package sts
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.17.7"
const goModuleVersion = "1.18.0"

View file

@ -12,6 +12,8 @@ import (
type ExpiredTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -24,7 +26,12 @@ func (e *ExpiredTokenException) ErrorMessage() string {
}
return *e.Message
}
func (e *ExpiredTokenException) ErrorCode() string { return "ExpiredTokenException" }
func (e *ExpiredTokenException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "ExpiredTokenException"
}
return *e.ErrorCodeOverride
}
func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request could not be fulfilled because the identity provider (IDP) that was
@ -35,6 +42,8 @@ func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.F
type IDPCommunicationErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -47,7 +56,12 @@ func (e *IDPCommunicationErrorException) ErrorMessage() string {
}
return *e.Message
}
func (e *IDPCommunicationErrorException) ErrorCode() string { return "IDPCommunicationError" }
func (e *IDPCommunicationErrorException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "IDPCommunicationError"
}
return *e.ErrorCodeOverride
}
func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The identity provider (IdP) reported that authentication failed. This might be
@ -57,6 +71,8 @@ func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return
type IDPRejectedClaimException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -69,7 +85,12 @@ func (e *IDPRejectedClaimException) ErrorMessage() string {
}
return *e.Message
}
func (e *IDPRejectedClaimException) ErrorCode() string { return "IDPRejectedClaim" }
func (e *IDPRejectedClaimException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "IDPRejectedClaim"
}
return *e.ErrorCodeOverride
}
func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The error returned if the message passed to DecodeAuthorizationMessage was
@ -78,6 +99,8 @@ func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smit
type InvalidAuthorizationMessageException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -91,7 +114,10 @@ func (e *InvalidAuthorizationMessageException) ErrorMessage() string {
return *e.Message
}
func (e *InvalidAuthorizationMessageException) ErrorCode() string {
return "InvalidAuthorizationMessageException"
if e.ErrorCodeOverride == nil {
return "InvalidAuthorizationMessageException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
@ -103,6 +129,8 @@ func (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault {
type InvalidIdentityTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -115,7 +143,12 @@ func (e *InvalidIdentityTokenException) ErrorMessage() string {
}
return *e.Message
}
func (e *InvalidIdentityTokenException) ErrorCode() string { return "InvalidIdentityToken" }
func (e *InvalidIdentityTokenException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "InvalidIdentityToken"
}
return *e.ErrorCodeOverride
}
func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the policy document was malformed. The error
@ -123,6 +156,8 @@ func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return
type MalformedPolicyDocumentException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -135,7 +170,12 @@ func (e *MalformedPolicyDocumentException) ErrorMessage() string {
}
return *e.Message
}
func (e *MalformedPolicyDocumentException) ErrorCode() string { return "MalformedPolicyDocument" }
func (e *MalformedPolicyDocumentException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "MalformedPolicyDocument"
}
return *e.ErrorCodeOverride
}
func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the total packed size of the session policies
@ -153,6 +193,8 @@ func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { retu
type PackedPolicyTooLargeException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -165,7 +207,12 @@ func (e *PackedPolicyTooLargeException) ErrorMessage() string {
}
return *e.Message
}
func (e *PackedPolicyTooLargeException) ErrorCode() string { return "PackedPolicyTooLarge" }
func (e *PackedPolicyTooLargeException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "PackedPolicyTooLarge"
}
return *e.ErrorCodeOverride
}
func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// STS is not activated in the requested region for the account that is being asked
@ -177,6 +224,8 @@ func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return
type RegionDisabledException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
@ -189,5 +238,10 @@ func (e *RegionDisabledException) ErrorMessage() string {
}
return *e.Message
}
func (e *RegionDisabledException) ErrorCode() string { return "RegionDisabledException" }
func (e *RegionDisabledException) ErrorCode() string {
if e.ErrorCodeOverride == nil {
return "RegionDisabledException"
}
return *e.ErrorCodeOverride
}
func (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }

File diff suppressed because it is too large Load diff

View file

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
const SDKVersion = "1.44.163"
const SDKVersion = "1.44.177"

View file

@ -13,10 +13,17 @@ import (
"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil"
)
const (
awsQueryError = "x-amzn-query-error"
// A valid header example - "x-amzn-query-error": "<QueryErrorCode>;<ErrorType>"
awsQueryErrorPartsCount = 2
)
// UnmarshalTypedError provides unmarshaling errors API response errors
// for both typed and untyped errors.
type UnmarshalTypedError struct {
exceptions map[string]func(protocol.ResponseMetadata) error
queryExceptions map[string]func(protocol.ResponseMetadata, string) error
}
// NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the
@ -24,6 +31,21 @@ type UnmarshalTypedError struct {
func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError {
return &UnmarshalTypedError{
exceptions: exceptions,
queryExceptions: map[string]func(protocol.ResponseMetadata, string) error{},
}
}
func NewUnmarshalTypedErrorWithOptions(exceptions map[string]func(protocol.ResponseMetadata) error, optFns ...func(*UnmarshalTypedError)) *UnmarshalTypedError {
unmarshaledError := NewUnmarshalTypedError(exceptions)
for _, fn := range optFns {
fn(unmarshaledError)
}
return unmarshaledError
}
func WithQueryCompatibility(queryExceptions map[string]func(protocol.ResponseMetadata, string) error) func(*UnmarshalTypedError) {
return func(typedError *UnmarshalTypedError) {
typedError.queryExceptions = queryExceptions
}
}
@ -50,18 +72,32 @@ func (u *UnmarshalTypedError) UnmarshalError(
code := codeParts[len(codeParts)-1]
msg := jsonErr.Message
queryCodeParts := queryCodeParts(resp, u)
if fn, ok := u.exceptions[code]; ok {
// If exception code is know, use associated constructor to get a value
// If query-compatible exceptions are found and query-error-header is found,
// then use associated constructor to get exception with query error code.
//
// If exception code is known, use associated constructor to get a value
// for the exception that the JSON body can be unmarshaled into.
v := fn(respMeta)
var v error
queryErrFn, queryExceptionsFound := u.queryExceptions[code]
if len(queryCodeParts) == awsQueryErrorPartsCount && queryExceptionsFound {
v = queryErrFn(respMeta, queryCodeParts[0])
} else {
v = fn(respMeta)
}
err := jsonutil.UnmarshalJSONCaseInsensitive(v, body)
if err != nil {
return nil, err
}
return v, nil
}
if len(queryCodeParts) == awsQueryErrorPartsCount && len(u.queryExceptions) > 0 {
code = queryCodeParts[0]
}
// fallback to unmodeled generic exceptions
return awserr.NewRequestFailure(
awserr.New(code, msg, nil),
@ -70,6 +106,16 @@ func (u *UnmarshalTypedError) UnmarshalError(
), nil
}
// A valid header example - "x-amzn-query-error": "<QueryErrorCode>;<ErrorType>"
func queryCodeParts(resp *http.Response, u *UnmarshalTypedError) []string {
queryCodeHeader := resp.Header.Get(awsQueryError)
var queryCodeParts []string
if queryCodeHeader != "" && len(u.queryExceptions) > 0 {
queryCodeParts = strings.Split(queryCodeHeader, ";")
}
return queryCodeParts
}
// UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc
// protocol request errors
var UnmarshalErrorHandler = request.NamedHandler{

View file

@ -3,7 +3,7 @@
before:
hooks:
- ./gen.sh
- go install mvdan.cc/garble@latest
- go install mvdan.cc/garble@v0.7.2
builds:
-

View file

@ -9,7 +9,6 @@ This package provides various compression algorithms.
* [huff0](https://github.com/klauspost/compress/tree/master/huff0) and [FSE](https://github.com/klauspost/compress/tree/master/fse) implementations for raw entropy encoding.
* [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped requests efficiently.
* [pgzip](https://github.com/klauspost/pgzip) is a separate package that provides a very fast parallel gzip implementation.
* [fuzz package](https://github.com/klauspost/compress-fuzz) for fuzz testing all compressors/decompressors here.
[![Go Reference](https://pkg.go.dev/badge/klauspost/compress.svg)](https://pkg.go.dev/github.com/klauspost/compress?tab=subdirectories)
[![Go](https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg)](https://github.com/klauspost/compress/actions/workflows/go.yml)
@ -17,6 +16,10 @@ This package provides various compression algorithms.
# changelog
* Dec 11, 2022 (v1.15.13)
* zstd: Add [MaxEncodedSize](https://pkg.go.dev/github.com/klauspost/compress@v1.15.13/zstd#Encoder.MaxEncodedSize) to encoder https://github.com/klauspost/compress/pull/691
* zstd: Various tweaks and improvements https://github.com/klauspost/compress/pull/693 https://github.com/klauspost/compress/pull/695 https://github.com/klauspost/compress/pull/696 https://github.com/klauspost/compress/pull/701 https://github.com/klauspost/compress/pull/702 https://github.com/klauspost/compress/pull/703 https://github.com/klauspost/compress/pull/704 https://github.com/klauspost/compress/pull/705 https://github.com/klauspost/compress/pull/706 https://github.com/klauspost/compress/pull/707 https://github.com/klauspost/compress/pull/708
* Oct 26, 2022 (v1.15.12)
* zstd: Tweak decoder allocs. https://github.com/klauspost/compress/pull/680

View file

@ -86,11 +86,19 @@ func StatelessDeflate(out io.Writer, in []byte, eof bool, dict []byte) error {
dict = dict[len(dict)-maxStatelessDict:]
}
// For subsequent loops, keep shallow dict reference to avoid alloc+copy.
var inDict []byte
for len(in) > 0 {
todo := in
if len(todo) > maxStatelessBlock-len(dict) {
if len(inDict) > 0 {
if len(todo) > maxStatelessBlock-maxStatelessDict {
todo = todo[:maxStatelessBlock-maxStatelessDict]
}
} else if len(todo) > maxStatelessBlock-len(dict) {
todo = todo[:maxStatelessBlock-len(dict)]
}
inOrg := in
in = in[len(todo):]
uncompressed := todo
if len(dict) > 0 {
@ -102,7 +110,11 @@ func StatelessDeflate(out io.Writer, in []byte, eof bool, dict []byte) error {
todo = combined
}
// Compress
statelessEnc(&dst, todo, int16(len(dict)))
if len(inDict) == 0 {
statelessEnc(&dst, todo, int16(len(dict)))
} else {
statelessEnc(&dst, inDict[:maxStatelessDict+len(todo)], maxStatelessDict)
}
isEof := eof && len(in) == 0
if dst.n == 0 {
@ -119,7 +131,8 @@ func StatelessDeflate(out io.Writer, in []byte, eof bool, dict []byte) error {
}
if len(in) > 0 {
// Retain a dict if we have more
dict = todo[len(todo)-maxStatelessDict:]
inDict = inOrg[len(uncompressed)-maxStatelessDict:]
dict = nil
dst.Reset()
}
if bw.err != nil {

View file

@ -952,7 +952,11 @@ func (r *Reader) ReadSeeker(random bool, index []byte) (*ReadSeeker, error) {
// Seek allows seeking in compressed data.
func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error) {
if r.err != nil {
return 0, r.err
if !errors.Is(r.err, io.EOF) {
return 0, r.err
}
// Reset on EOF
r.err = nil
}
if offset == 0 && whence == io.SeekCurrent {
return r.blockStart + int64(r.i), nil

View file

@ -152,7 +152,7 @@ func (h *Header) Decode(in []byte) error {
}
b, in = in[:size], in[size:]
h.HeaderSize += int(size)
switch size {
switch len(b) {
case 1:
h.DictionaryID = uint32(b[0])
case 2:
@ -182,7 +182,7 @@ func (h *Header) Decode(in []byte) error {
}
b, in = in[:fcsSize], in[fcsSize:]
h.HeaderSize += int(fcsSize)
switch fcsSize {
switch len(b) {
case 1:
h.FrameContentSize = uint64(b[0])
case 2:

View file

@ -167,7 +167,7 @@ func (d *frameDec) reset(br byteBuffer) error {
return err
}
var id uint32
switch size {
switch len(b) {
case 1:
id = uint32(b[0])
case 2:
@ -204,7 +204,7 @@ func (d *frameDec) reset(br byteBuffer) error {
println("Reading Frame content", err)
return err
}
switch fcsSize {
switch len(b) {
case 1:
d.FrameContentSize = uint64(b[0])
case 2:

View file

@ -320,10 +320,6 @@ error_not_enough_literals:
MOVQ $0x00000004, ret+24(FP)
RET
// Return with not enough output space error
MOVQ $0x00000005, ret+24(FP)
RET
// func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
// Requires: CMOV
TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32
@ -617,10 +613,6 @@ error_not_enough_literals:
MOVQ $0x00000004, ret+24(FP)
RET
// Return with not enough output space error
MOVQ $0x00000005, ret+24(FP)
RET
// func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
// Requires: BMI, BMI2, CMOV
TEXT ·sequenceDecs_decode_bmi2(SB), $8-32
@ -897,10 +889,6 @@ error_not_enough_literals:
MOVQ $0x00000004, ret+24(FP)
RET
// Return with not enough output space error
MOVQ $0x00000005, ret+24(FP)
RET
// func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
// Requires: BMI, BMI2, CMOV
TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32
@ -1152,10 +1140,6 @@ error_not_enough_literals:
MOVQ $0x00000004, ret+24(FP)
RET
// Return with not enough output space error
MOVQ $0x00000005, ret+24(FP)
RET
// func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool
// Requires: SSE
TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9
@ -1389,8 +1373,7 @@ loop_finished:
MOVQ ctx+0(FP), AX
MOVQ DX, 24(AX)
MOVQ DI, 104(AX)
MOVQ 80(AX), CX
SUBQ CX, SI
SUBQ 80(AX), SI
MOVQ SI, 112(AX)
RET
@ -1402,8 +1385,7 @@ error_match_off_too_big:
MOVQ ctx+0(FP), AX
MOVQ DX, 24(AX)
MOVQ DI, 104(AX)
MOVQ 80(AX), CX
SUBQ CX, SI
SUBQ 80(AX), SI
MOVQ SI, 112(AX)
RET
@ -1747,8 +1729,7 @@ loop_finished:
MOVQ ctx+0(FP), AX
MOVQ DX, 24(AX)
MOVQ DI, 104(AX)
MOVQ 80(AX), CX
SUBQ CX, SI
SUBQ 80(AX), SI
MOVQ SI, 112(AX)
RET
@ -1760,8 +1741,7 @@ error_match_off_too_big:
MOVQ ctx+0(FP), AX
MOVQ DX, 24(AX)
MOVQ DI, 104(AX)
MOVQ 80(AX), CX
SUBQ CX, SI
SUBQ 80(AX), SI
MOVQ SI, 112(AX)
RET

View file

@ -1,5 +1,5 @@
//go:build (darwin || freebsd || openbsd || netbsd || dragonfly) && !appengine
// +build darwin freebsd openbsd netbsd dragonfly
//go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine
// +build darwin freebsd openbsd netbsd dragonfly hurd
// +build !appengine
package isatty

View file

@ -55,19 +55,22 @@ ifneq ($(shell which gotestsum),)
endif
endif
PROMU_VERSION ?= 0.13.0
PROMU_VERSION ?= 0.14.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.45.2
GOLANGCI_LINT_VERSION ?= v1.49.0
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
# If we're in CI and there is an Actions file, that means the linter
# is being run in Actions, so we don't need to run it here.
ifeq (,$(CIRCLE_JOB))
ifneq (,$(SKIP_GOLANGCI_LINT))
GOLANGCI_LINT :=
else ifeq (,$(CIRCLE_JOB))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint

View file

@ -380,6 +380,42 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) {
return cpuinfo, nil
}
func parseCPUInfoLoong(info []byte) ([]CPUInfo, error) {
scanner := bufio.NewScanner(bytes.NewReader(info))
// find the first "processor" line
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") {
return nil, errors.New("invalid cpuinfo file: " + firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
cpuinfo := []CPUInfo{}
systemType := field[1]
i := 0
for scanner.Scan() {
line := scanner.Text()
if !strings.Contains(line, ":") {
continue
}
field := strings.SplitN(line, ": ", 2)
switch strings.TrimSpace(field[0]) {
case "processor":
v, err := strconv.ParseUint(field[1], 0, 32)
if err != nil {
return nil, err
}
i = int(v)
cpuinfo = append(cpuinfo, CPUInfo{}) // start of the next processor
cpuinfo[i].Processor = uint(v)
cpuinfo[i].VendorID = systemType
case "CPU Family":
cpuinfo[i].CPUFamily = field[1]
case "Model Name":
cpuinfo[i].ModelName = field[1]
}
}
return cpuinfo, nil
}
func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) {
scanner := bufio.NewScanner(bytes.NewReader(info))

19
vendor/github.com/prometheus/procfs/cpuinfo_loong64.go generated vendored Normal file
View file

@ -0,0 +1,19 @@
// Copyright 2022 The Prometheus Authors
// 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.
//go:build linux
// +build linux
package procfs
var parseCPUInfo = parseCPUInfoLoong

View file

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build linux && !386 && !amd64 && !arm && !arm64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x
// +build linux,!386,!amd64,!arm,!arm64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x
//go:build linux && !386 && !amd64 && !arm && !arm64 && !loong64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x
// +build linux,!386,!amd64,!arm,!arm64,!loong64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x
package procfs

View file

@ -16,30 +16,29 @@
//
// Example:
//
// package main
// package main
//
// import (
// "fmt"
// "log"
// import (
// "fmt"
// "log"
//
// "github.com/prometheus/procfs"
// )
// "github.com/prometheus/procfs"
// )
//
// func main() {
// p, err := procfs.Self()
// if err != nil {
// log.Fatalf("could not get process: %s", err)
// }
// func main() {
// p, err := procfs.Self()
// if err != nil {
// log.Fatalf("could not get process: %s", err)
// }
//
// stat, err := p.Stat()
// if err != nil {
// log.Fatalf("could not get process stat: %s", err)
// }
//
// fmt.Printf("command: %s\n", stat.Comm)
// fmt.Printf("cpu time: %fs\n", stat.CPUTime())
// fmt.Printf("vsize: %dB\n", stat.VirtualMemory())
// fmt.Printf("rss: %dB\n", stat.ResidentMemory())
// }
// stat, err := p.Stat()
// if err != nil {
// log.Fatalf("could not get process stat: %s", err)
// }
//
// fmt.Printf("command: %s\n", stat.Comm)
// fmt.Printf("cpu time: %fs\n", stat.CPUTime())
// fmt.Printf("vsize: %dB\n", stat.VirtualMemory())
// fmt.Printf("rss: %dB\n", stat.ResidentMemory())
// }
package procfs

View file

@ -284,7 +284,8 @@ func parseMountStats(r io.Reader) ([]*Mount, error) {
}
// parseMount parses an entry in /proc/[pid]/mountstats in the format:
// device [device] mounted on [mount] with fstype [type]
//
// device [device] mounted on [mount] with fstype [type]
func parseMount(ss []string) (*Mount, error) {
if len(ss) < deviceEntryLen {
return nil, fmt.Errorf("invalid device entry: %v", ss)

View file

@ -27,8 +27,9 @@ import (
// For the proc file format details,
// See:
// * Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2343
// * Linux 4.17 https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162
// and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810.
// * Linux 2.6.39 https://elixir.bootlin.com/linux/v2.6.39/source/net/core/dev.c#L4086
// * Linux 4.18 https://elixir.bootlin.com/linux/v4.18/source/net/core/net-procfs.c#L162
// * Linux 5.14 https://elixir.bootlin.com/linux/v5.14/source/net/core/net-procfs.c#L169
// SoftnetStat contains a single row of data from /proc/net/softnet_stat.
type SoftnetStat struct {
@ -38,6 +39,18 @@ type SoftnetStat struct {
Dropped uint32
// Number of times processing packets ran out of quota.
TimeSqueezed uint32
// Number of collision occur while obtaining device lock while transmitting.
CPUCollision uint32
// Number of times cpu woken up received_rps.
ReceivedRps uint32
// number of times flow limit has been reached.
FlowLimitCount uint32
// Softnet backlog status.
SoftnetBacklogLen uint32
// CPU id owning this softnet_data.
Index uint32
// softnet_data's Width.
Width int
}
var softNetProcFile = "net/softnet_stat"
@ -66,22 +79,57 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) {
for s.Scan() {
columns := strings.Fields(s.Text())
width := len(columns)
softnetStat := SoftnetStat{}
if width < minColumns {
return nil, fmt.Errorf("%d columns were detected, but at least %d were expected", width, minColumns)
}
// We only parse the first three columns at the moment.
us, err := parseHexUint32s(columns[0:3])
if err != nil {
return nil, err
// Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2347
if width >= minColumns {
us, err := parseHexUint32s(columns[0:9])
if err != nil {
return nil, err
}
softnetStat.Processed = us[0]
softnetStat.Dropped = us[1]
softnetStat.TimeSqueezed = us[2]
softnetStat.CPUCollision = us[8]
}
stats = append(stats, SoftnetStat{
Processed: us[0],
Dropped: us[1],
TimeSqueezed: us[2],
})
// Linux 2.6.39 https://elixir.bootlin.com/linux/v2.6.39/source/net/core/dev.c#L4086
if width >= 10 {
us, err := parseHexUint32s(columns[9:10])
if err != nil {
return nil, err
}
softnetStat.ReceivedRps = us[0]
}
// Linux 4.18 https://elixir.bootlin.com/linux/v4.18/source/net/core/net-procfs.c#L162
if width >= 11 {
us, err := parseHexUint32s(columns[10:11])
if err != nil {
return nil, err
}
softnetStat.FlowLimitCount = us[0]
}
// Linux 5.14 https://elixir.bootlin.com/linux/v5.14/source/net/core/net-procfs.c#L169
if width >= 13 {
us, err := parseHexUint32s(columns[11:13])
if err != nil {
return nil, err
}
softnetStat.SoftnetBacklogLen = us[0]
softnetStat.Index = us[1]
}
softnetStat.Width = width
stats = append(stats, softnetStat)
}
return stats, nil

View file

@ -15,6 +15,7 @@ package procfs
import (
"bufio"
"io"
"os"
"path/filepath"
"strconv"
@ -42,27 +43,43 @@ func (fs FS) NetStat() ([]NetStat, error) {
return nil, err
}
netStatFile := NetStat{
Filename: filepath.Base(filePath),
Stats: make(map[string][]uint64),
procNetstat, err := parseNetstat(file)
if err != nil {
return nil, err
}
scanner := bufio.NewScanner(file)
scanner.Scan()
// First string is always a header for stats
var headers []string
headers = append(headers, strings.Fields(scanner.Text())...)
procNetstat.Filename = filepath.Base(filePath)
// Other strings represent per-CPU counters
for scanner.Scan() {
for num, counter := range strings.Fields(scanner.Text()) {
value, err := strconv.ParseUint(counter, 16, 64)
if err != nil {
return nil, err
}
netStatFile.Stats[headers[num]] = append(netStatFile.Stats[headers[num]], value)
}
}
netStatsTotal = append(netStatsTotal, netStatFile)
netStatsTotal = append(netStatsTotal, procNetstat)
}
return netStatsTotal, nil
}
// parseNetstat parses the metrics from `/proc/net/stat/` file
// and returns a NetStat structure.
func parseNetstat(r io.Reader) (NetStat, error) {
var (
scanner = bufio.NewScanner(r)
netStat = NetStat{
Stats: make(map[string][]uint64),
}
)
scanner.Scan()
// First string is always a header for stats
var headers []string
headers = append(headers, strings.Fields(scanner.Text())...)
// Other strings represent per-CPU counters
for scanner.Scan() {
for num, counter := range strings.Fields(scanner.Text()) {
value, err := strconv.ParseUint(counter, 16, 64)
if err != nil {
return NetStat{}, err
}
netStat.Stats[headers[num]] = append(netStat.Stats[headers[num]], value)
}
}
return netStat, nil
}

View file

@ -23,7 +23,7 @@ import (
"github.com/prometheus/procfs/internal/util"
)
// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the the placement of a PID inside a
// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the placement of a PID inside a
// specific control hierarchy. The kernel has two cgroup APIs, v1 and v2. v1 has one hierarchy per available resource
// controller, while v2 has one unified hierarchy shared by all controllers. Regardless of v1 or v2, all hierarchies
// contain all running processes, so the question answerable with a Cgroup struct is 'where is this process in

98
vendor/github.com/prometheus/procfs/proc_interrupts.go generated vendored Normal file
View file

@ -0,0 +1,98 @@
// Copyright 2022 The Prometheus Authors
// 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 procfs
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"strconv"
"strings"
"github.com/prometheus/procfs/internal/util"
)
// Interrupt represents a single interrupt line.
type Interrupt struct {
// Info is the type of interrupt.
Info string
// Devices is the name of the device that is located at that IRQ
Devices string
// Values is the number of interrupts per CPU.
Values []string
}
// Interrupts models the content of /proc/interrupts. Key is the IRQ number.
// - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-proc-interrupts
// - https://raspberrypi.stackexchange.com/questions/105802/explanation-of-proc-interrupts-output
type Interrupts map[string]Interrupt
// Interrupts creates a new instance from a given Proc instance.
func (p Proc) Interrupts() (Interrupts, error) {
data, err := util.ReadFileNoStat(p.path("interrupts"))
if err != nil {
return nil, err
}
return parseInterrupts(bytes.NewReader(data))
}
func parseInterrupts(r io.Reader) (Interrupts, error) {
var (
interrupts = Interrupts{}
scanner = bufio.NewScanner(r)
)
if !scanner.Scan() {
return nil, errors.New("interrupts empty")
}
cpuNum := len(strings.Fields(scanner.Text())) // one header per cpu
for scanner.Scan() {
parts := strings.Fields(scanner.Text())
if len(parts) == 0 { // skip empty lines
continue
}
if len(parts) < 2 {
return nil, fmt.Errorf("not enough fields in interrupts (expected at least 2 fields but got %d): %s", len(parts), parts)
}
intName := parts[0][:len(parts[0])-1] // remove trailing :
if len(parts) == 2 {
interrupts[intName] = Interrupt{
Info: "",
Devices: "",
Values: []string{
parts[1],
},
}
continue
}
intr := Interrupt{
Values: parts[1 : cpuNum+1],
}
if _, err := strconv.Atoi(intName); err == nil { // numeral interrupt
intr.Info = parts[cpuNum+1]
intr.Devices = strings.Join(parts[cpuNum+2:], " ")
} else {
intr.Info = strings.Join(parts[cpuNum+1:], " ")
}
interrupts[intName] = intr
}
return interrupts, scanner.Err()
}

View file

@ -33,139 +33,140 @@ type ProcNetstat struct {
}
type TcpExt struct { // nolint:revive
SyncookiesSent float64
SyncookiesRecv float64
SyncookiesFailed float64
EmbryonicRsts float64
PruneCalled float64
RcvPruned float64
OfoPruned float64
OutOfWindowIcmps float64
LockDroppedIcmps float64
ArpFilter float64
TW float64
TWRecycled float64
TWKilled float64
PAWSActive float64
PAWSEstab float64
DelayedACKs float64
DelayedACKLocked float64
DelayedACKLost float64
ListenOverflows float64
ListenDrops float64
TCPHPHits float64
TCPPureAcks float64
TCPHPAcks float64
TCPRenoRecovery float64
TCPSackRecovery float64
TCPSACKReneging float64
TCPSACKReorder float64
TCPRenoReorder float64
TCPTSReorder float64
TCPFullUndo float64
TCPPartialUndo float64
TCPDSACKUndo float64
TCPLossUndo float64
TCPLostRetransmit float64
TCPRenoFailures float64
TCPSackFailures float64
TCPLossFailures float64
TCPFastRetrans float64
TCPSlowStartRetrans float64
TCPTimeouts float64
TCPLossProbes float64
TCPLossProbeRecovery float64
TCPRenoRecoveryFail float64
TCPSackRecoveryFail float64
TCPRcvCollapsed float64
TCPDSACKOldSent float64
TCPDSACKOfoSent float64
TCPDSACKRecv float64
TCPDSACKOfoRecv float64
TCPAbortOnData float64
TCPAbortOnClose float64
TCPAbortOnMemory float64
TCPAbortOnTimeout float64
TCPAbortOnLinger float64
TCPAbortFailed float64
TCPMemoryPressures float64
TCPMemoryPressuresChrono float64
TCPSACKDiscard float64
TCPDSACKIgnoredOld float64
TCPDSACKIgnoredNoUndo float64
TCPSpuriousRTOs float64
TCPMD5NotFound float64
TCPMD5Unexpected float64
TCPMD5Failure float64
TCPSackShifted float64
TCPSackMerged float64
TCPSackShiftFallback float64
TCPBacklogDrop float64
PFMemallocDrop float64
TCPMinTTLDrop float64
TCPDeferAcceptDrop float64
IPReversePathFilter float64
TCPTimeWaitOverflow float64
TCPReqQFullDoCookies float64
TCPReqQFullDrop float64
TCPRetransFail float64
TCPRcvCoalesce float64
TCPOFOQueue float64
TCPOFODrop float64
TCPOFOMerge float64
TCPChallengeACK float64
TCPSYNChallenge float64
TCPFastOpenActive float64
TCPFastOpenActiveFail float64
TCPFastOpenPassive float64
TCPFastOpenPassiveFail float64
TCPFastOpenListenOverflow float64
TCPFastOpenCookieReqd float64
TCPFastOpenBlackhole float64
TCPSpuriousRtxHostQueues float64
BusyPollRxPackets float64
TCPAutoCorking float64
TCPFromZeroWindowAdv float64
TCPToZeroWindowAdv float64
TCPWantZeroWindowAdv float64
TCPSynRetrans float64
TCPOrigDataSent float64
TCPHystartTrainDetect float64
TCPHystartTrainCwnd float64
TCPHystartDelayDetect float64
TCPHystartDelayCwnd float64
TCPACKSkippedSynRecv float64
TCPACKSkippedPAWS float64
TCPACKSkippedSeq float64
TCPACKSkippedFinWait2 float64
TCPACKSkippedTimeWait float64
TCPACKSkippedChallenge float64
TCPWinProbe float64
TCPKeepAlive float64
TCPMTUPFail float64
TCPMTUPSuccess float64
TCPWqueueTooBig float64
SyncookiesSent *float64
SyncookiesRecv *float64
SyncookiesFailed *float64
EmbryonicRsts *float64
PruneCalled *float64
RcvPruned *float64
OfoPruned *float64
OutOfWindowIcmps *float64
LockDroppedIcmps *float64
ArpFilter *float64
TW *float64
TWRecycled *float64
TWKilled *float64
PAWSActive *float64
PAWSEstab *float64
DelayedACKs *float64
DelayedACKLocked *float64
DelayedACKLost *float64
ListenOverflows *float64
ListenDrops *float64
TCPHPHits *float64
TCPPureAcks *float64
TCPHPAcks *float64
TCPRenoRecovery *float64
TCPSackRecovery *float64
TCPSACKReneging *float64
TCPSACKReorder *float64
TCPRenoReorder *float64
TCPTSReorder *float64
TCPFullUndo *float64
TCPPartialUndo *float64
TCPDSACKUndo *float64
TCPLossUndo *float64
TCPLostRetransmit *float64
TCPRenoFailures *float64
TCPSackFailures *float64
TCPLossFailures *float64
TCPFastRetrans *float64
TCPSlowStartRetrans *float64
TCPTimeouts *float64
TCPLossProbes *float64
TCPLossProbeRecovery *float64
TCPRenoRecoveryFail *float64
TCPSackRecoveryFail *float64
TCPRcvCollapsed *float64
TCPDSACKOldSent *float64
TCPDSACKOfoSent *float64
TCPDSACKRecv *float64
TCPDSACKOfoRecv *float64
TCPAbortOnData *float64
TCPAbortOnClose *float64
TCPAbortOnMemory *float64
TCPAbortOnTimeout *float64
TCPAbortOnLinger *float64
TCPAbortFailed *float64
TCPMemoryPressures *float64
TCPMemoryPressuresChrono *float64
TCPSACKDiscard *float64
TCPDSACKIgnoredOld *float64
TCPDSACKIgnoredNoUndo *float64
TCPSpuriousRTOs *float64
TCPMD5NotFound *float64
TCPMD5Unexpected *float64
TCPMD5Failure *float64
TCPSackShifted *float64
TCPSackMerged *float64
TCPSackShiftFallback *float64
TCPBacklogDrop *float64
PFMemallocDrop *float64
TCPMinTTLDrop *float64
TCPDeferAcceptDrop *float64
IPReversePathFilter *float64
TCPTimeWaitOverflow *float64
TCPReqQFullDoCookies *float64
TCPReqQFullDrop *float64
TCPRetransFail *float64
TCPRcvCoalesce *float64
TCPRcvQDrop *float64
TCPOFOQueue *float64
TCPOFODrop *float64
TCPOFOMerge *float64
TCPChallengeACK *float64
TCPSYNChallenge *float64
TCPFastOpenActive *float64
TCPFastOpenActiveFail *float64
TCPFastOpenPassive *float64
TCPFastOpenPassiveFail *float64
TCPFastOpenListenOverflow *float64
TCPFastOpenCookieReqd *float64
TCPFastOpenBlackhole *float64
TCPSpuriousRtxHostQueues *float64
BusyPollRxPackets *float64
TCPAutoCorking *float64
TCPFromZeroWindowAdv *float64
TCPToZeroWindowAdv *float64
TCPWantZeroWindowAdv *float64
TCPSynRetrans *float64
TCPOrigDataSent *float64
TCPHystartTrainDetect *float64
TCPHystartTrainCwnd *float64
TCPHystartDelayDetect *float64
TCPHystartDelayCwnd *float64
TCPACKSkippedSynRecv *float64
TCPACKSkippedPAWS *float64
TCPACKSkippedSeq *float64
TCPACKSkippedFinWait2 *float64
TCPACKSkippedTimeWait *float64
TCPACKSkippedChallenge *float64
TCPWinProbe *float64
TCPKeepAlive *float64
TCPMTUPFail *float64
TCPMTUPSuccess *float64
TCPWqueueTooBig *float64
}
type IpExt struct { // nolint:revive
InNoRoutes float64
InTruncatedPkts float64
InMcastPkts float64
OutMcastPkts float64
InBcastPkts float64
OutBcastPkts float64
InOctets float64
OutOctets float64
InMcastOctets float64
OutMcastOctets float64
InBcastOctets float64
OutBcastOctets float64
InCsumErrors float64
InNoECTPkts float64
InECT1Pkts float64
InECT0Pkts float64
InCEPkts float64
ReasmOverlaps float64
InNoRoutes *float64
InTruncatedPkts *float64
InMcastPkts *float64
OutMcastPkts *float64
InBcastPkts *float64
OutBcastPkts *float64
InOctets *float64
OutOctets *float64
InMcastOctets *float64
OutMcastOctets *float64
InBcastOctets *float64
OutBcastOctets *float64
InCsumErrors *float64
InNoECTPkts *float64
InECT1Pkts *float64
InECT0Pkts *float64
InCEPkts *float64
ReasmOverlaps *float64
}
func (p Proc) Netstat() (ProcNetstat, error) {
@ -174,14 +175,14 @@ func (p Proc) Netstat() (ProcNetstat, error) {
if err != nil {
return ProcNetstat{PID: p.PID}, err
}
procNetstat, err := parseNetstat(bytes.NewReader(data), filename)
procNetstat, err := parseProcNetstat(bytes.NewReader(data), filename)
procNetstat.PID = p.PID
return procNetstat, err
}
// parseNetstat parses the metrics from proc/<pid>/net/netstat file
// parseProcNetstat parses the metrics from proc/<pid>/net/netstat file
// and returns a ProcNetstat structure.
func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
func parseProcNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
var (
scanner = bufio.NewScanner(r)
procNetstat = ProcNetstat{}
@ -208,230 +209,232 @@ func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
case "TcpExt":
switch key {
case "SyncookiesSent":
procNetstat.TcpExt.SyncookiesSent = value
procNetstat.TcpExt.SyncookiesSent = &value
case "SyncookiesRecv":
procNetstat.TcpExt.SyncookiesRecv = value
procNetstat.TcpExt.SyncookiesRecv = &value
case "SyncookiesFailed":
procNetstat.TcpExt.SyncookiesFailed = value
procNetstat.TcpExt.SyncookiesFailed = &value
case "EmbryonicRsts":
procNetstat.TcpExt.EmbryonicRsts = value
procNetstat.TcpExt.EmbryonicRsts = &value
case "PruneCalled":
procNetstat.TcpExt.PruneCalled = value
procNetstat.TcpExt.PruneCalled = &value
case "RcvPruned":
procNetstat.TcpExt.RcvPruned = value
procNetstat.TcpExt.RcvPruned = &value
case "OfoPruned":
procNetstat.TcpExt.OfoPruned = value
procNetstat.TcpExt.OfoPruned = &value
case "OutOfWindowIcmps":
procNetstat.TcpExt.OutOfWindowIcmps = value
procNetstat.TcpExt.OutOfWindowIcmps = &value
case "LockDroppedIcmps":
procNetstat.TcpExt.LockDroppedIcmps = value
procNetstat.TcpExt.LockDroppedIcmps = &value
case "ArpFilter":
procNetstat.TcpExt.ArpFilter = value
procNetstat.TcpExt.ArpFilter = &value
case "TW":
procNetstat.TcpExt.TW = value
procNetstat.TcpExt.TW = &value
case "TWRecycled":
procNetstat.TcpExt.TWRecycled = value
procNetstat.TcpExt.TWRecycled = &value
case "TWKilled":
procNetstat.TcpExt.TWKilled = value
procNetstat.TcpExt.TWKilled = &value
case "PAWSActive":
procNetstat.TcpExt.PAWSActive = value
procNetstat.TcpExt.PAWSActive = &value
case "PAWSEstab":
procNetstat.TcpExt.PAWSEstab = value
procNetstat.TcpExt.PAWSEstab = &value
case "DelayedACKs":
procNetstat.TcpExt.DelayedACKs = value
procNetstat.TcpExt.DelayedACKs = &value
case "DelayedACKLocked":
procNetstat.TcpExt.DelayedACKLocked = value
procNetstat.TcpExt.DelayedACKLocked = &value
case "DelayedACKLost":
procNetstat.TcpExt.DelayedACKLost = value
procNetstat.TcpExt.DelayedACKLost = &value
case "ListenOverflows":
procNetstat.TcpExt.ListenOverflows = value
procNetstat.TcpExt.ListenOverflows = &value
case "ListenDrops":
procNetstat.TcpExt.ListenDrops = value
procNetstat.TcpExt.ListenDrops = &value
case "TCPHPHits":
procNetstat.TcpExt.TCPHPHits = value
procNetstat.TcpExt.TCPHPHits = &value
case "TCPPureAcks":
procNetstat.TcpExt.TCPPureAcks = value
procNetstat.TcpExt.TCPPureAcks = &value
case "TCPHPAcks":
procNetstat.TcpExt.TCPHPAcks = value
procNetstat.TcpExt.TCPHPAcks = &value
case "TCPRenoRecovery":
procNetstat.TcpExt.TCPRenoRecovery = value
procNetstat.TcpExt.TCPRenoRecovery = &value
case "TCPSackRecovery":
procNetstat.TcpExt.TCPSackRecovery = value
procNetstat.TcpExt.TCPSackRecovery = &value
case "TCPSACKReneging":
procNetstat.TcpExt.TCPSACKReneging = value
procNetstat.TcpExt.TCPSACKReneging = &value
case "TCPSACKReorder":
procNetstat.TcpExt.TCPSACKReorder = value
procNetstat.TcpExt.TCPSACKReorder = &value
case "TCPRenoReorder":
procNetstat.TcpExt.TCPRenoReorder = value
procNetstat.TcpExt.TCPRenoReorder = &value
case "TCPTSReorder":
procNetstat.TcpExt.TCPTSReorder = value
procNetstat.TcpExt.TCPTSReorder = &value
case "TCPFullUndo":
procNetstat.TcpExt.TCPFullUndo = value
procNetstat.TcpExt.TCPFullUndo = &value
case "TCPPartialUndo":
procNetstat.TcpExt.TCPPartialUndo = value
procNetstat.TcpExt.TCPPartialUndo = &value
case "TCPDSACKUndo":
procNetstat.TcpExt.TCPDSACKUndo = value
procNetstat.TcpExt.TCPDSACKUndo = &value
case "TCPLossUndo":
procNetstat.TcpExt.TCPLossUndo = value
procNetstat.TcpExt.TCPLossUndo = &value
case "TCPLostRetransmit":
procNetstat.TcpExt.TCPLostRetransmit = value
procNetstat.TcpExt.TCPLostRetransmit = &value
case "TCPRenoFailures":
procNetstat.TcpExt.TCPRenoFailures = value
procNetstat.TcpExt.TCPRenoFailures = &value
case "TCPSackFailures":
procNetstat.TcpExt.TCPSackFailures = value
procNetstat.TcpExt.TCPSackFailures = &value
case "TCPLossFailures":
procNetstat.TcpExt.TCPLossFailures = value
procNetstat.TcpExt.TCPLossFailures = &value
case "TCPFastRetrans":
procNetstat.TcpExt.TCPFastRetrans = value
procNetstat.TcpExt.TCPFastRetrans = &value
case "TCPSlowStartRetrans":
procNetstat.TcpExt.TCPSlowStartRetrans = value
procNetstat.TcpExt.TCPSlowStartRetrans = &value
case "TCPTimeouts":
procNetstat.TcpExt.TCPTimeouts = value
procNetstat.TcpExt.TCPTimeouts = &value
case "TCPLossProbes":
procNetstat.TcpExt.TCPLossProbes = value
procNetstat.TcpExt.TCPLossProbes = &value
case "TCPLossProbeRecovery":
procNetstat.TcpExt.TCPLossProbeRecovery = value
procNetstat.TcpExt.TCPLossProbeRecovery = &value
case "TCPRenoRecoveryFail":
procNetstat.TcpExt.TCPRenoRecoveryFail = value
procNetstat.TcpExt.TCPRenoRecoveryFail = &value
case "TCPSackRecoveryFail":
procNetstat.TcpExt.TCPSackRecoveryFail = value
procNetstat.TcpExt.TCPSackRecoveryFail = &value
case "TCPRcvCollapsed":
procNetstat.TcpExt.TCPRcvCollapsed = value
procNetstat.TcpExt.TCPRcvCollapsed = &value
case "TCPDSACKOldSent":
procNetstat.TcpExt.TCPDSACKOldSent = value
procNetstat.TcpExt.TCPDSACKOldSent = &value
case "TCPDSACKOfoSent":
procNetstat.TcpExt.TCPDSACKOfoSent = value
procNetstat.TcpExt.TCPDSACKOfoSent = &value
case "TCPDSACKRecv":
procNetstat.TcpExt.TCPDSACKRecv = value
procNetstat.TcpExt.TCPDSACKRecv = &value
case "TCPDSACKOfoRecv":
procNetstat.TcpExt.TCPDSACKOfoRecv = value
procNetstat.TcpExt.TCPDSACKOfoRecv = &value
case "TCPAbortOnData":
procNetstat.TcpExt.TCPAbortOnData = value
procNetstat.TcpExt.TCPAbortOnData = &value
case "TCPAbortOnClose":
procNetstat.TcpExt.TCPAbortOnClose = value
procNetstat.TcpExt.TCPAbortOnClose = &value
case "TCPDeferAcceptDrop":
procNetstat.TcpExt.TCPDeferAcceptDrop = value
procNetstat.TcpExt.TCPDeferAcceptDrop = &value
case "IPReversePathFilter":
procNetstat.TcpExt.IPReversePathFilter = value
procNetstat.TcpExt.IPReversePathFilter = &value
case "TCPTimeWaitOverflow":
procNetstat.TcpExt.TCPTimeWaitOverflow = value
procNetstat.TcpExt.TCPTimeWaitOverflow = &value
case "TCPReqQFullDoCookies":
procNetstat.TcpExt.TCPReqQFullDoCookies = value
procNetstat.TcpExt.TCPReqQFullDoCookies = &value
case "TCPReqQFullDrop":
procNetstat.TcpExt.TCPReqQFullDrop = value
procNetstat.TcpExt.TCPReqQFullDrop = &value
case "TCPRetransFail":
procNetstat.TcpExt.TCPRetransFail = value
procNetstat.TcpExt.TCPRetransFail = &value
case "TCPRcvCoalesce":
procNetstat.TcpExt.TCPRcvCoalesce = value
procNetstat.TcpExt.TCPRcvCoalesce = &value
case "TCPRcvQDrop":
procNetstat.TcpExt.TCPRcvQDrop = &value
case "TCPOFOQueue":
procNetstat.TcpExt.TCPOFOQueue = value
procNetstat.TcpExt.TCPOFOQueue = &value
case "TCPOFODrop":
procNetstat.TcpExt.TCPOFODrop = value
procNetstat.TcpExt.TCPOFODrop = &value
case "TCPOFOMerge":
procNetstat.TcpExt.TCPOFOMerge = value
procNetstat.TcpExt.TCPOFOMerge = &value
case "TCPChallengeACK":
procNetstat.TcpExt.TCPChallengeACK = value
procNetstat.TcpExt.TCPChallengeACK = &value
case "TCPSYNChallenge":
procNetstat.TcpExt.TCPSYNChallenge = value
procNetstat.TcpExt.TCPSYNChallenge = &value
case "TCPFastOpenActive":
procNetstat.TcpExt.TCPFastOpenActive = value
procNetstat.TcpExt.TCPFastOpenActive = &value
case "TCPFastOpenActiveFail":
procNetstat.TcpExt.TCPFastOpenActiveFail = value
procNetstat.TcpExt.TCPFastOpenActiveFail = &value
case "TCPFastOpenPassive":
procNetstat.TcpExt.TCPFastOpenPassive = value
procNetstat.TcpExt.TCPFastOpenPassive = &value
case "TCPFastOpenPassiveFail":
procNetstat.TcpExt.TCPFastOpenPassiveFail = value
procNetstat.TcpExt.TCPFastOpenPassiveFail = &value
case "TCPFastOpenListenOverflow":
procNetstat.TcpExt.TCPFastOpenListenOverflow = value
procNetstat.TcpExt.TCPFastOpenListenOverflow = &value
case "TCPFastOpenCookieReqd":
procNetstat.TcpExt.TCPFastOpenCookieReqd = value
procNetstat.TcpExt.TCPFastOpenCookieReqd = &value
case "TCPFastOpenBlackhole":
procNetstat.TcpExt.TCPFastOpenBlackhole = value
procNetstat.TcpExt.TCPFastOpenBlackhole = &value
case "TCPSpuriousRtxHostQueues":
procNetstat.TcpExt.TCPSpuriousRtxHostQueues = value
procNetstat.TcpExt.TCPSpuriousRtxHostQueues = &value
case "BusyPollRxPackets":
procNetstat.TcpExt.BusyPollRxPackets = value
procNetstat.TcpExt.BusyPollRxPackets = &value
case "TCPAutoCorking":
procNetstat.TcpExt.TCPAutoCorking = value
procNetstat.TcpExt.TCPAutoCorking = &value
case "TCPFromZeroWindowAdv":
procNetstat.TcpExt.TCPFromZeroWindowAdv = value
procNetstat.TcpExt.TCPFromZeroWindowAdv = &value
case "TCPToZeroWindowAdv":
procNetstat.TcpExt.TCPToZeroWindowAdv = value
procNetstat.TcpExt.TCPToZeroWindowAdv = &value
case "TCPWantZeroWindowAdv":
procNetstat.TcpExt.TCPWantZeroWindowAdv = value
procNetstat.TcpExt.TCPWantZeroWindowAdv = &value
case "TCPSynRetrans":
procNetstat.TcpExt.TCPSynRetrans = value
procNetstat.TcpExt.TCPSynRetrans = &value
case "TCPOrigDataSent":
procNetstat.TcpExt.TCPOrigDataSent = value
procNetstat.TcpExt.TCPOrigDataSent = &value
case "TCPHystartTrainDetect":
procNetstat.TcpExt.TCPHystartTrainDetect = value
procNetstat.TcpExt.TCPHystartTrainDetect = &value
case "TCPHystartTrainCwnd":
procNetstat.TcpExt.TCPHystartTrainCwnd = value
procNetstat.TcpExt.TCPHystartTrainCwnd = &value
case "TCPHystartDelayDetect":
procNetstat.TcpExt.TCPHystartDelayDetect = value
procNetstat.TcpExt.TCPHystartDelayDetect = &value
case "TCPHystartDelayCwnd":
procNetstat.TcpExt.TCPHystartDelayCwnd = value
procNetstat.TcpExt.TCPHystartDelayCwnd = &value
case "TCPACKSkippedSynRecv":
procNetstat.TcpExt.TCPACKSkippedSynRecv = value
procNetstat.TcpExt.TCPACKSkippedSynRecv = &value
case "TCPACKSkippedPAWS":
procNetstat.TcpExt.TCPACKSkippedPAWS = value
procNetstat.TcpExt.TCPACKSkippedPAWS = &value
case "TCPACKSkippedSeq":
procNetstat.TcpExt.TCPACKSkippedSeq = value
procNetstat.TcpExt.TCPACKSkippedSeq = &value
case "TCPACKSkippedFinWait2":
procNetstat.TcpExt.TCPACKSkippedFinWait2 = value
procNetstat.TcpExt.TCPACKSkippedFinWait2 = &value
case "TCPACKSkippedTimeWait":
procNetstat.TcpExt.TCPACKSkippedTimeWait = value
procNetstat.TcpExt.TCPACKSkippedTimeWait = &value
case "TCPACKSkippedChallenge":
procNetstat.TcpExt.TCPACKSkippedChallenge = value
procNetstat.TcpExt.TCPACKSkippedChallenge = &value
case "TCPWinProbe":
procNetstat.TcpExt.TCPWinProbe = value
procNetstat.TcpExt.TCPWinProbe = &value
case "TCPKeepAlive":
procNetstat.TcpExt.TCPKeepAlive = value
procNetstat.TcpExt.TCPKeepAlive = &value
case "TCPMTUPFail":
procNetstat.TcpExt.TCPMTUPFail = value
procNetstat.TcpExt.TCPMTUPFail = &value
case "TCPMTUPSuccess":
procNetstat.TcpExt.TCPMTUPSuccess = value
procNetstat.TcpExt.TCPMTUPSuccess = &value
case "TCPWqueueTooBig":
procNetstat.TcpExt.TCPWqueueTooBig = value
procNetstat.TcpExt.TCPWqueueTooBig = &value
}
case "IpExt":
switch key {
case "InNoRoutes":
procNetstat.IpExt.InNoRoutes = value
procNetstat.IpExt.InNoRoutes = &value
case "InTruncatedPkts":
procNetstat.IpExt.InTruncatedPkts = value
procNetstat.IpExt.InTruncatedPkts = &value
case "InMcastPkts":
procNetstat.IpExt.InMcastPkts = value
procNetstat.IpExt.InMcastPkts = &value
case "OutMcastPkts":
procNetstat.IpExt.OutMcastPkts = value
procNetstat.IpExt.OutMcastPkts = &value
case "InBcastPkts":
procNetstat.IpExt.InBcastPkts = value
procNetstat.IpExt.InBcastPkts = &value
case "OutBcastPkts":
procNetstat.IpExt.OutBcastPkts = value
procNetstat.IpExt.OutBcastPkts = &value
case "InOctets":
procNetstat.IpExt.InOctets = value
procNetstat.IpExt.InOctets = &value
case "OutOctets":
procNetstat.IpExt.OutOctets = value
procNetstat.IpExt.OutOctets = &value
case "InMcastOctets":
procNetstat.IpExt.InMcastOctets = value
procNetstat.IpExt.InMcastOctets = &value
case "OutMcastOctets":
procNetstat.IpExt.OutMcastOctets = value
procNetstat.IpExt.OutMcastOctets = &value
case "InBcastOctets":
procNetstat.IpExt.InBcastOctets = value
procNetstat.IpExt.InBcastOctets = &value
case "OutBcastOctets":
procNetstat.IpExt.OutBcastOctets = value
procNetstat.IpExt.OutBcastOctets = &value
case "InCsumErrors":
procNetstat.IpExt.InCsumErrors = value
procNetstat.IpExt.InCsumErrors = &value
case "InNoECTPkts":
procNetstat.IpExt.InNoECTPkts = value
procNetstat.IpExt.InNoECTPkts = &value
case "InECT1Pkts":
procNetstat.IpExt.InECT1Pkts = value
procNetstat.IpExt.InECT1Pkts = &value
case "InECT0Pkts":
procNetstat.IpExt.InECT0Pkts = value
procNetstat.IpExt.InECT0Pkts = &value
case "InCEPkts":
procNetstat.IpExt.InCEPkts = value
procNetstat.IpExt.InCEPkts = &value
case "ReasmOverlaps":
procNetstat.IpExt.ReasmOverlaps = value
procNetstat.IpExt.ReasmOverlaps = &value
}
}
}

View file

@ -37,100 +37,100 @@ type ProcSnmp struct {
}
type Ip struct { // nolint:revive
Forwarding float64
DefaultTTL float64
InReceives float64
InHdrErrors float64
InAddrErrors float64
ForwDatagrams float64
InUnknownProtos float64
InDiscards float64
InDelivers float64
OutRequests float64
OutDiscards float64
OutNoRoutes float64
ReasmTimeout float64
ReasmReqds float64
ReasmOKs float64
ReasmFails float64
FragOKs float64
FragFails float64
FragCreates float64
Forwarding *float64
DefaultTTL *float64
InReceives *float64
InHdrErrors *float64
InAddrErrors *float64
ForwDatagrams *float64
InUnknownProtos *float64
InDiscards *float64
InDelivers *float64
OutRequests *float64
OutDiscards *float64
OutNoRoutes *float64
ReasmTimeout *float64
ReasmReqds *float64
ReasmOKs *float64
ReasmFails *float64
FragOKs *float64
FragFails *float64
FragCreates *float64
}
type Icmp struct {
InMsgs float64
InErrors float64
InCsumErrors float64
InDestUnreachs float64
InTimeExcds float64
InParmProbs float64
InSrcQuenchs float64
InRedirects float64
InEchos float64
InEchoReps float64
InTimestamps float64
InTimestampReps float64
InAddrMasks float64
InAddrMaskReps float64
OutMsgs float64
OutErrors float64
OutDestUnreachs float64
OutTimeExcds float64
OutParmProbs float64
OutSrcQuenchs float64
OutRedirects float64
OutEchos float64
OutEchoReps float64
OutTimestamps float64
OutTimestampReps float64
OutAddrMasks float64
OutAddrMaskReps float64
type Icmp struct { // nolint:revive
InMsgs *float64
InErrors *float64
InCsumErrors *float64
InDestUnreachs *float64
InTimeExcds *float64
InParmProbs *float64
InSrcQuenchs *float64
InRedirects *float64
InEchos *float64
InEchoReps *float64
InTimestamps *float64
InTimestampReps *float64
InAddrMasks *float64
InAddrMaskReps *float64
OutMsgs *float64
OutErrors *float64
OutDestUnreachs *float64
OutTimeExcds *float64
OutParmProbs *float64
OutSrcQuenchs *float64
OutRedirects *float64
OutEchos *float64
OutEchoReps *float64
OutTimestamps *float64
OutTimestampReps *float64
OutAddrMasks *float64
OutAddrMaskReps *float64
}
type IcmpMsg struct {
InType3 float64
OutType3 float64
InType3 *float64
OutType3 *float64
}
type Tcp struct { // nolint:revive
RtoAlgorithm float64
RtoMin float64
RtoMax float64
MaxConn float64
ActiveOpens float64
PassiveOpens float64
AttemptFails float64
EstabResets float64
CurrEstab float64
InSegs float64
OutSegs float64
RetransSegs float64
InErrs float64
OutRsts float64
InCsumErrors float64
RtoAlgorithm *float64
RtoMin *float64
RtoMax *float64
MaxConn *float64
ActiveOpens *float64
PassiveOpens *float64
AttemptFails *float64
EstabResets *float64
CurrEstab *float64
InSegs *float64
OutSegs *float64
RetransSegs *float64
InErrs *float64
OutRsts *float64
InCsumErrors *float64
}
type Udp struct { // nolint:revive
InDatagrams float64
NoPorts float64
InErrors float64
OutDatagrams float64
RcvbufErrors float64
SndbufErrors float64
InCsumErrors float64
IgnoredMulti float64
InDatagrams *float64
NoPorts *float64
InErrors *float64
OutDatagrams *float64
RcvbufErrors *float64
SndbufErrors *float64
InCsumErrors *float64
IgnoredMulti *float64
}
type UdpLite struct { // nolint:revive
InDatagrams float64
NoPorts float64
InErrors float64
OutDatagrams float64
RcvbufErrors float64
SndbufErrors float64
InCsumErrors float64
IgnoredMulti float64
InDatagrams *float64
NoPorts *float64
InErrors *float64
OutDatagrams *float64
RcvbufErrors *float64
SndbufErrors *float64
InCsumErrors *float64
IgnoredMulti *float64
}
func (p Proc) Snmp() (ProcSnmp, error) {
@ -173,178 +173,178 @@ func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) {
case "Ip":
switch key {
case "Forwarding":
procSnmp.Ip.Forwarding = value
procSnmp.Ip.Forwarding = &value
case "DefaultTTL":
procSnmp.Ip.DefaultTTL = value
procSnmp.Ip.DefaultTTL = &value
case "InReceives":
procSnmp.Ip.InReceives = value
procSnmp.Ip.InReceives = &value
case "InHdrErrors":
procSnmp.Ip.InHdrErrors = value
procSnmp.Ip.InHdrErrors = &value
case "InAddrErrors":
procSnmp.Ip.InAddrErrors = value
procSnmp.Ip.InAddrErrors = &value
case "ForwDatagrams":
procSnmp.Ip.ForwDatagrams = value
procSnmp.Ip.ForwDatagrams = &value
case "InUnknownProtos":
procSnmp.Ip.InUnknownProtos = value
procSnmp.Ip.InUnknownProtos = &value
case "InDiscards":
procSnmp.Ip.InDiscards = value
procSnmp.Ip.InDiscards = &value
case "InDelivers":
procSnmp.Ip.InDelivers = value
procSnmp.Ip.InDelivers = &value
case "OutRequests":
procSnmp.Ip.OutRequests = value
procSnmp.Ip.OutRequests = &value
case "OutDiscards":
procSnmp.Ip.OutDiscards = value
procSnmp.Ip.OutDiscards = &value
case "OutNoRoutes":
procSnmp.Ip.OutNoRoutes = value
procSnmp.Ip.OutNoRoutes = &value
case "ReasmTimeout":
procSnmp.Ip.ReasmTimeout = value
procSnmp.Ip.ReasmTimeout = &value
case "ReasmReqds":
procSnmp.Ip.ReasmReqds = value
procSnmp.Ip.ReasmReqds = &value
case "ReasmOKs":
procSnmp.Ip.ReasmOKs = value
procSnmp.Ip.ReasmOKs = &value
case "ReasmFails":
procSnmp.Ip.ReasmFails = value
procSnmp.Ip.ReasmFails = &value
case "FragOKs":
procSnmp.Ip.FragOKs = value
procSnmp.Ip.FragOKs = &value
case "FragFails":
procSnmp.Ip.FragFails = value
procSnmp.Ip.FragFails = &value
case "FragCreates":
procSnmp.Ip.FragCreates = value
procSnmp.Ip.FragCreates = &value
}
case "Icmp":
switch key {
case "InMsgs":
procSnmp.Icmp.InMsgs = value
procSnmp.Icmp.InMsgs = &value
case "InErrors":
procSnmp.Icmp.InErrors = value
procSnmp.Icmp.InErrors = &value
case "InCsumErrors":
procSnmp.Icmp.InCsumErrors = value
procSnmp.Icmp.InCsumErrors = &value
case "InDestUnreachs":
procSnmp.Icmp.InDestUnreachs = value
procSnmp.Icmp.InDestUnreachs = &value
case "InTimeExcds":
procSnmp.Icmp.InTimeExcds = value
procSnmp.Icmp.InTimeExcds = &value
case "InParmProbs":
procSnmp.Icmp.InParmProbs = value
procSnmp.Icmp.InParmProbs = &value
case "InSrcQuenchs":
procSnmp.Icmp.InSrcQuenchs = value
procSnmp.Icmp.InSrcQuenchs = &value
case "InRedirects":
procSnmp.Icmp.InRedirects = value
procSnmp.Icmp.InRedirects = &value
case "InEchos":
procSnmp.Icmp.InEchos = value
procSnmp.Icmp.InEchos = &value
case "InEchoReps":
procSnmp.Icmp.InEchoReps = value
procSnmp.Icmp.InEchoReps = &value
case "InTimestamps":
procSnmp.Icmp.InTimestamps = value
procSnmp.Icmp.InTimestamps = &value
case "InTimestampReps":
procSnmp.Icmp.InTimestampReps = value
procSnmp.Icmp.InTimestampReps = &value
case "InAddrMasks":
procSnmp.Icmp.InAddrMasks = value
procSnmp.Icmp.InAddrMasks = &value
case "InAddrMaskReps":
procSnmp.Icmp.InAddrMaskReps = value
procSnmp.Icmp.InAddrMaskReps = &value
case "OutMsgs":
procSnmp.Icmp.OutMsgs = value
procSnmp.Icmp.OutMsgs = &value
case "OutErrors":
procSnmp.Icmp.OutErrors = value
procSnmp.Icmp.OutErrors = &value
case "OutDestUnreachs":
procSnmp.Icmp.OutDestUnreachs = value
procSnmp.Icmp.OutDestUnreachs = &value
case "OutTimeExcds":
procSnmp.Icmp.OutTimeExcds = value
procSnmp.Icmp.OutTimeExcds = &value
case "OutParmProbs":
procSnmp.Icmp.OutParmProbs = value
procSnmp.Icmp.OutParmProbs = &value
case "OutSrcQuenchs":
procSnmp.Icmp.OutSrcQuenchs = value
procSnmp.Icmp.OutSrcQuenchs = &value
case "OutRedirects":
procSnmp.Icmp.OutRedirects = value
procSnmp.Icmp.OutRedirects = &value
case "OutEchos":
procSnmp.Icmp.OutEchos = value
procSnmp.Icmp.OutEchos = &value
case "OutEchoReps":
procSnmp.Icmp.OutEchoReps = value
procSnmp.Icmp.OutEchoReps = &value
case "OutTimestamps":
procSnmp.Icmp.OutTimestamps = value
procSnmp.Icmp.OutTimestamps = &value
case "OutTimestampReps":
procSnmp.Icmp.OutTimestampReps = value
procSnmp.Icmp.OutTimestampReps = &value
case "OutAddrMasks":
procSnmp.Icmp.OutAddrMasks = value
procSnmp.Icmp.OutAddrMasks = &value
case "OutAddrMaskReps":
procSnmp.Icmp.OutAddrMaskReps = value
procSnmp.Icmp.OutAddrMaskReps = &value
}
case "IcmpMsg":
switch key {
case "InType3":
procSnmp.IcmpMsg.InType3 = value
procSnmp.IcmpMsg.InType3 = &value
case "OutType3":
procSnmp.IcmpMsg.OutType3 = value
procSnmp.IcmpMsg.OutType3 = &value
}
case "Tcp":
switch key {
case "RtoAlgorithm":
procSnmp.Tcp.RtoAlgorithm = value
procSnmp.Tcp.RtoAlgorithm = &value
case "RtoMin":
procSnmp.Tcp.RtoMin = value
procSnmp.Tcp.RtoMin = &value
case "RtoMax":
procSnmp.Tcp.RtoMax = value
procSnmp.Tcp.RtoMax = &value
case "MaxConn":
procSnmp.Tcp.MaxConn = value
procSnmp.Tcp.MaxConn = &value
case "ActiveOpens":
procSnmp.Tcp.ActiveOpens = value
procSnmp.Tcp.ActiveOpens = &value
case "PassiveOpens":
procSnmp.Tcp.PassiveOpens = value
procSnmp.Tcp.PassiveOpens = &value
case "AttemptFails":
procSnmp.Tcp.AttemptFails = value
procSnmp.Tcp.AttemptFails = &value
case "EstabResets":
procSnmp.Tcp.EstabResets = value
procSnmp.Tcp.EstabResets = &value
case "CurrEstab":
procSnmp.Tcp.CurrEstab = value
procSnmp.Tcp.CurrEstab = &value
case "InSegs":
procSnmp.Tcp.InSegs = value
procSnmp.Tcp.InSegs = &value
case "OutSegs":
procSnmp.Tcp.OutSegs = value
procSnmp.Tcp.OutSegs = &value
case "RetransSegs":
procSnmp.Tcp.RetransSegs = value
procSnmp.Tcp.RetransSegs = &value
case "InErrs":
procSnmp.Tcp.InErrs = value
procSnmp.Tcp.InErrs = &value
case "OutRsts":
procSnmp.Tcp.OutRsts = value
procSnmp.Tcp.OutRsts = &value
case "InCsumErrors":
procSnmp.Tcp.InCsumErrors = value
procSnmp.Tcp.InCsumErrors = &value
}
case "Udp":
switch key {
case "InDatagrams":
procSnmp.Udp.InDatagrams = value
procSnmp.Udp.InDatagrams = &value
case "NoPorts":
procSnmp.Udp.NoPorts = value
procSnmp.Udp.NoPorts = &value
case "InErrors":
procSnmp.Udp.InErrors = value
procSnmp.Udp.InErrors = &value
case "OutDatagrams":
procSnmp.Udp.OutDatagrams = value
procSnmp.Udp.OutDatagrams = &value
case "RcvbufErrors":
procSnmp.Udp.RcvbufErrors = value
procSnmp.Udp.RcvbufErrors = &value
case "SndbufErrors":
procSnmp.Udp.SndbufErrors = value
procSnmp.Udp.SndbufErrors = &value
case "InCsumErrors":
procSnmp.Udp.InCsumErrors = value
procSnmp.Udp.InCsumErrors = &value
case "IgnoredMulti":
procSnmp.Udp.IgnoredMulti = value
procSnmp.Udp.IgnoredMulti = &value
}
case "UdpLite":
switch key {
case "InDatagrams":
procSnmp.UdpLite.InDatagrams = value
procSnmp.UdpLite.InDatagrams = &value
case "NoPorts":
procSnmp.UdpLite.NoPorts = value
procSnmp.UdpLite.NoPorts = &value
case "InErrors":
procSnmp.UdpLite.InErrors = value
procSnmp.UdpLite.InErrors = &value
case "OutDatagrams":
procSnmp.UdpLite.OutDatagrams = value
procSnmp.UdpLite.OutDatagrams = &value
case "RcvbufErrors":
procSnmp.UdpLite.RcvbufErrors = value
procSnmp.UdpLite.RcvbufErrors = &value
case "SndbufErrors":
procSnmp.UdpLite.SndbufErrors = value
procSnmp.UdpLite.SndbufErrors = &value
case "InCsumErrors":
procSnmp.UdpLite.InCsumErrors = value
procSnmp.UdpLite.InCsumErrors = &value
case "IgnoredMulti":
procSnmp.UdpLite.IgnoredMulti = value
procSnmp.UdpLite.IgnoredMulti = &value
}
}
}

View file

@ -36,106 +36,106 @@ type ProcSnmp6 struct {
}
type Ip6 struct { // nolint:revive
InReceives float64
InHdrErrors float64
InTooBigErrors float64
InNoRoutes float64
InAddrErrors float64
InUnknownProtos float64
InTruncatedPkts float64
InDiscards float64
InDelivers float64
OutForwDatagrams float64
OutRequests float64
OutDiscards float64
OutNoRoutes float64
ReasmTimeout float64
ReasmReqds float64
ReasmOKs float64
ReasmFails float64
FragOKs float64
FragFails float64
FragCreates float64
InMcastPkts float64
OutMcastPkts float64
InOctets float64
OutOctets float64
InMcastOctets float64
OutMcastOctets float64
InBcastOctets float64
OutBcastOctets float64
InNoECTPkts float64
InECT1Pkts float64
InECT0Pkts float64
InCEPkts float64
InReceives *float64
InHdrErrors *float64
InTooBigErrors *float64
InNoRoutes *float64
InAddrErrors *float64
InUnknownProtos *float64
InTruncatedPkts *float64
InDiscards *float64
InDelivers *float64
OutForwDatagrams *float64
OutRequests *float64
OutDiscards *float64
OutNoRoutes *float64
ReasmTimeout *float64
ReasmReqds *float64
ReasmOKs *float64
ReasmFails *float64
FragOKs *float64
FragFails *float64
FragCreates *float64
InMcastPkts *float64
OutMcastPkts *float64
InOctets *float64
OutOctets *float64
InMcastOctets *float64
OutMcastOctets *float64
InBcastOctets *float64
OutBcastOctets *float64
InNoECTPkts *float64
InECT1Pkts *float64
InECT0Pkts *float64
InCEPkts *float64
}
type Icmp6 struct {
InMsgs float64
InErrors float64
OutMsgs float64
OutErrors float64
InCsumErrors float64
InDestUnreachs float64
InPktTooBigs float64
InTimeExcds float64
InParmProblems float64
InEchos float64
InEchoReplies float64
InGroupMembQueries float64
InGroupMembResponses float64
InGroupMembReductions float64
InRouterSolicits float64
InRouterAdvertisements float64
InNeighborSolicits float64
InNeighborAdvertisements float64
InRedirects float64
InMLDv2Reports float64
OutDestUnreachs float64
OutPktTooBigs float64
OutTimeExcds float64
OutParmProblems float64
OutEchos float64
OutEchoReplies float64
OutGroupMembQueries float64
OutGroupMembResponses float64
OutGroupMembReductions float64
OutRouterSolicits float64
OutRouterAdvertisements float64
OutNeighborSolicits float64
OutNeighborAdvertisements float64
OutRedirects float64
OutMLDv2Reports float64
InType1 float64
InType134 float64
InType135 float64
InType136 float64
InType143 float64
OutType133 float64
OutType135 float64
OutType136 float64
OutType143 float64
InMsgs *float64
InErrors *float64
OutMsgs *float64
OutErrors *float64
InCsumErrors *float64
InDestUnreachs *float64
InPktTooBigs *float64
InTimeExcds *float64
InParmProblems *float64
InEchos *float64
InEchoReplies *float64
InGroupMembQueries *float64
InGroupMembResponses *float64
InGroupMembReductions *float64
InRouterSolicits *float64
InRouterAdvertisements *float64
InNeighborSolicits *float64
InNeighborAdvertisements *float64
InRedirects *float64
InMLDv2Reports *float64
OutDestUnreachs *float64
OutPktTooBigs *float64
OutTimeExcds *float64
OutParmProblems *float64
OutEchos *float64
OutEchoReplies *float64
OutGroupMembQueries *float64
OutGroupMembResponses *float64
OutGroupMembReductions *float64
OutRouterSolicits *float64
OutRouterAdvertisements *float64
OutNeighborSolicits *float64
OutNeighborAdvertisements *float64
OutRedirects *float64
OutMLDv2Reports *float64
InType1 *float64
InType134 *float64
InType135 *float64
InType136 *float64
InType143 *float64
OutType133 *float64
OutType135 *float64
OutType136 *float64
OutType143 *float64
}
type Udp6 struct { // nolint:revive
InDatagrams float64
NoPorts float64
InErrors float64
OutDatagrams float64
RcvbufErrors float64
SndbufErrors float64
InCsumErrors float64
IgnoredMulti float64
InDatagrams *float64
NoPorts *float64
InErrors *float64
OutDatagrams *float64
RcvbufErrors *float64
SndbufErrors *float64
InCsumErrors *float64
IgnoredMulti *float64
}
type UdpLite6 struct { // nolint:revive
InDatagrams float64
NoPorts float64
InErrors float64
OutDatagrams float64
RcvbufErrors float64
SndbufErrors float64
InCsumErrors float64
InDatagrams *float64
NoPorts *float64
InErrors *float64
OutDatagrams *float64
RcvbufErrors *float64
SndbufErrors *float64
InCsumErrors *float64
}
func (p Proc) Snmp6() (ProcSnmp6, error) {
@ -182,197 +182,197 @@ func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) {
case "Ip6":
switch key {
case "InReceives":
procSnmp6.Ip6.InReceives = value
procSnmp6.Ip6.InReceives = &value
case "InHdrErrors":
procSnmp6.Ip6.InHdrErrors = value
procSnmp6.Ip6.InHdrErrors = &value
case "InTooBigErrors":
procSnmp6.Ip6.InTooBigErrors = value
procSnmp6.Ip6.InTooBigErrors = &value
case "InNoRoutes":
procSnmp6.Ip6.InNoRoutes = value
procSnmp6.Ip6.InNoRoutes = &value
case "InAddrErrors":
procSnmp6.Ip6.InAddrErrors = value
procSnmp6.Ip6.InAddrErrors = &value
case "InUnknownProtos":
procSnmp6.Ip6.InUnknownProtos = value
procSnmp6.Ip6.InUnknownProtos = &value
case "InTruncatedPkts":
procSnmp6.Ip6.InTruncatedPkts = value
procSnmp6.Ip6.InTruncatedPkts = &value
case "InDiscards":
procSnmp6.Ip6.InDiscards = value
procSnmp6.Ip6.InDiscards = &value
case "InDelivers":
procSnmp6.Ip6.InDelivers = value
procSnmp6.Ip6.InDelivers = &value
case "OutForwDatagrams":
procSnmp6.Ip6.OutForwDatagrams = value
procSnmp6.Ip6.OutForwDatagrams = &value
case "OutRequests":
procSnmp6.Ip6.OutRequests = value
procSnmp6.Ip6.OutRequests = &value
case "OutDiscards":
procSnmp6.Ip6.OutDiscards = value
procSnmp6.Ip6.OutDiscards = &value
case "OutNoRoutes":
procSnmp6.Ip6.OutNoRoutes = value
procSnmp6.Ip6.OutNoRoutes = &value
case "ReasmTimeout":
procSnmp6.Ip6.ReasmTimeout = value
procSnmp6.Ip6.ReasmTimeout = &value
case "ReasmReqds":
procSnmp6.Ip6.ReasmReqds = value
procSnmp6.Ip6.ReasmReqds = &value
case "ReasmOKs":
procSnmp6.Ip6.ReasmOKs = value
procSnmp6.Ip6.ReasmOKs = &value
case "ReasmFails":
procSnmp6.Ip6.ReasmFails = value
procSnmp6.Ip6.ReasmFails = &value
case "FragOKs":
procSnmp6.Ip6.FragOKs = value
procSnmp6.Ip6.FragOKs = &value
case "FragFails":
procSnmp6.Ip6.FragFails = value
procSnmp6.Ip6.FragFails = &value
case "FragCreates":
procSnmp6.Ip6.FragCreates = value
procSnmp6.Ip6.FragCreates = &value
case "InMcastPkts":
procSnmp6.Ip6.InMcastPkts = value
procSnmp6.Ip6.InMcastPkts = &value
case "OutMcastPkts":
procSnmp6.Ip6.OutMcastPkts = value
procSnmp6.Ip6.OutMcastPkts = &value
case "InOctets":
procSnmp6.Ip6.InOctets = value
procSnmp6.Ip6.InOctets = &value
case "OutOctets":
procSnmp6.Ip6.OutOctets = value
procSnmp6.Ip6.OutOctets = &value
case "InMcastOctets":
procSnmp6.Ip6.InMcastOctets = value
procSnmp6.Ip6.InMcastOctets = &value
case "OutMcastOctets":
procSnmp6.Ip6.OutMcastOctets = value
procSnmp6.Ip6.OutMcastOctets = &value
case "InBcastOctets":
procSnmp6.Ip6.InBcastOctets = value
procSnmp6.Ip6.InBcastOctets = &value
case "OutBcastOctets":
procSnmp6.Ip6.OutBcastOctets = value
procSnmp6.Ip6.OutBcastOctets = &value
case "InNoECTPkts":
procSnmp6.Ip6.InNoECTPkts = value
procSnmp6.Ip6.InNoECTPkts = &value
case "InECT1Pkts":
procSnmp6.Ip6.InECT1Pkts = value
procSnmp6.Ip6.InECT1Pkts = &value
case "InECT0Pkts":
procSnmp6.Ip6.InECT0Pkts = value
procSnmp6.Ip6.InECT0Pkts = &value
case "InCEPkts":
procSnmp6.Ip6.InCEPkts = value
procSnmp6.Ip6.InCEPkts = &value
}
case "Icmp6":
switch key {
case "InMsgs":
procSnmp6.Icmp6.InMsgs = value
procSnmp6.Icmp6.InMsgs = &value
case "InErrors":
procSnmp6.Icmp6.InErrors = value
procSnmp6.Icmp6.InErrors = &value
case "OutMsgs":
procSnmp6.Icmp6.OutMsgs = value
procSnmp6.Icmp6.OutMsgs = &value
case "OutErrors":
procSnmp6.Icmp6.OutErrors = value
procSnmp6.Icmp6.OutErrors = &value
case "InCsumErrors":
procSnmp6.Icmp6.InCsumErrors = value
procSnmp6.Icmp6.InCsumErrors = &value
case "InDestUnreachs":
procSnmp6.Icmp6.InDestUnreachs = value
procSnmp6.Icmp6.InDestUnreachs = &value
case "InPktTooBigs":
procSnmp6.Icmp6.InPktTooBigs = value
procSnmp6.Icmp6.InPktTooBigs = &value
case "InTimeExcds":
procSnmp6.Icmp6.InTimeExcds = value
procSnmp6.Icmp6.InTimeExcds = &value
case "InParmProblems":
procSnmp6.Icmp6.InParmProblems = value
procSnmp6.Icmp6.InParmProblems = &value
case "InEchos":
procSnmp6.Icmp6.InEchos = value
procSnmp6.Icmp6.InEchos = &value
case "InEchoReplies":
procSnmp6.Icmp6.InEchoReplies = value
procSnmp6.Icmp6.InEchoReplies = &value
case "InGroupMembQueries":
procSnmp6.Icmp6.InGroupMembQueries = value
procSnmp6.Icmp6.InGroupMembQueries = &value
case "InGroupMembResponses":
procSnmp6.Icmp6.InGroupMembResponses = value
procSnmp6.Icmp6.InGroupMembResponses = &value
case "InGroupMembReductions":
procSnmp6.Icmp6.InGroupMembReductions = value
procSnmp6.Icmp6.InGroupMembReductions = &value
case "InRouterSolicits":
procSnmp6.Icmp6.InRouterSolicits = value
procSnmp6.Icmp6.InRouterSolicits = &value
case "InRouterAdvertisements":
procSnmp6.Icmp6.InRouterAdvertisements = value
procSnmp6.Icmp6.InRouterAdvertisements = &value
case "InNeighborSolicits":
procSnmp6.Icmp6.InNeighborSolicits = value
procSnmp6.Icmp6.InNeighborSolicits = &value
case "InNeighborAdvertisements":
procSnmp6.Icmp6.InNeighborAdvertisements = value
procSnmp6.Icmp6.InNeighborAdvertisements = &value
case "InRedirects":
procSnmp6.Icmp6.InRedirects = value
procSnmp6.Icmp6.InRedirects = &value
case "InMLDv2Reports":
procSnmp6.Icmp6.InMLDv2Reports = value
procSnmp6.Icmp6.InMLDv2Reports = &value
case "OutDestUnreachs":
procSnmp6.Icmp6.OutDestUnreachs = value
procSnmp6.Icmp6.OutDestUnreachs = &value
case "OutPktTooBigs":
procSnmp6.Icmp6.OutPktTooBigs = value
procSnmp6.Icmp6.OutPktTooBigs = &value
case "OutTimeExcds":
procSnmp6.Icmp6.OutTimeExcds = value
procSnmp6.Icmp6.OutTimeExcds = &value
case "OutParmProblems":
procSnmp6.Icmp6.OutParmProblems = value
procSnmp6.Icmp6.OutParmProblems = &value
case "OutEchos":
procSnmp6.Icmp6.OutEchos = value
procSnmp6.Icmp6.OutEchos = &value
case "OutEchoReplies":
procSnmp6.Icmp6.OutEchoReplies = value
procSnmp6.Icmp6.OutEchoReplies = &value
case "OutGroupMembQueries":
procSnmp6.Icmp6.OutGroupMembQueries = value
procSnmp6.Icmp6.OutGroupMembQueries = &value
case "OutGroupMembResponses":
procSnmp6.Icmp6.OutGroupMembResponses = value
procSnmp6.Icmp6.OutGroupMembResponses = &value
case "OutGroupMembReductions":
procSnmp6.Icmp6.OutGroupMembReductions = value
procSnmp6.Icmp6.OutGroupMembReductions = &value
case "OutRouterSolicits":
procSnmp6.Icmp6.OutRouterSolicits = value
procSnmp6.Icmp6.OutRouterSolicits = &value
case "OutRouterAdvertisements":
procSnmp6.Icmp6.OutRouterAdvertisements = value
procSnmp6.Icmp6.OutRouterAdvertisements = &value
case "OutNeighborSolicits":
procSnmp6.Icmp6.OutNeighborSolicits = value
procSnmp6.Icmp6.OutNeighborSolicits = &value
case "OutNeighborAdvertisements":
procSnmp6.Icmp6.OutNeighborAdvertisements = value
procSnmp6.Icmp6.OutNeighborAdvertisements = &value
case "OutRedirects":
procSnmp6.Icmp6.OutRedirects = value
procSnmp6.Icmp6.OutRedirects = &value
case "OutMLDv2Reports":
procSnmp6.Icmp6.OutMLDv2Reports = value
procSnmp6.Icmp6.OutMLDv2Reports = &value
case "InType1":
procSnmp6.Icmp6.InType1 = value
procSnmp6.Icmp6.InType1 = &value
case "InType134":
procSnmp6.Icmp6.InType134 = value
procSnmp6.Icmp6.InType134 = &value
case "InType135":
procSnmp6.Icmp6.InType135 = value
procSnmp6.Icmp6.InType135 = &value
case "InType136":
procSnmp6.Icmp6.InType136 = value
procSnmp6.Icmp6.InType136 = &value
case "InType143":
procSnmp6.Icmp6.InType143 = value
procSnmp6.Icmp6.InType143 = &value
case "OutType133":
procSnmp6.Icmp6.OutType133 = value
procSnmp6.Icmp6.OutType133 = &value
case "OutType135":
procSnmp6.Icmp6.OutType135 = value
procSnmp6.Icmp6.OutType135 = &value
case "OutType136":
procSnmp6.Icmp6.OutType136 = value
procSnmp6.Icmp6.OutType136 = &value
case "OutType143":
procSnmp6.Icmp6.OutType143 = value
procSnmp6.Icmp6.OutType143 = &value
}
case "Udp6":
switch key {
case "InDatagrams":
procSnmp6.Udp6.InDatagrams = value
procSnmp6.Udp6.InDatagrams = &value
case "NoPorts":
procSnmp6.Udp6.NoPorts = value
procSnmp6.Udp6.NoPorts = &value
case "InErrors":
procSnmp6.Udp6.InErrors = value
procSnmp6.Udp6.InErrors = &value
case "OutDatagrams":
procSnmp6.Udp6.OutDatagrams = value
procSnmp6.Udp6.OutDatagrams = &value
case "RcvbufErrors":
procSnmp6.Udp6.RcvbufErrors = value
procSnmp6.Udp6.RcvbufErrors = &value
case "SndbufErrors":
procSnmp6.Udp6.SndbufErrors = value
procSnmp6.Udp6.SndbufErrors = &value
case "InCsumErrors":
procSnmp6.Udp6.InCsumErrors = value
procSnmp6.Udp6.InCsumErrors = &value
case "IgnoredMulti":
procSnmp6.Udp6.IgnoredMulti = value
procSnmp6.Udp6.IgnoredMulti = &value
}
case "UdpLite6":
switch key {
case "InDatagrams":
procSnmp6.UdpLite6.InDatagrams = value
procSnmp6.UdpLite6.InDatagrams = &value
case "NoPorts":
procSnmp6.UdpLite6.NoPorts = value
procSnmp6.UdpLite6.NoPorts = &value
case "InErrors":
procSnmp6.UdpLite6.InErrors = value
procSnmp6.UdpLite6.InErrors = &value
case "OutDatagrams":
procSnmp6.UdpLite6.OutDatagrams = value
procSnmp6.UdpLite6.OutDatagrams = &value
case "RcvbufErrors":
procSnmp6.UdpLite6.RcvbufErrors = value
procSnmp6.UdpLite6.RcvbufErrors = &value
case "SndbufErrors":
procSnmp6.UdpLite6.SndbufErrors = value
procSnmp6.UdpLite6.SndbufErrors = &value
case "InCsumErrors":
procSnmp6.UdpLite6.InCsumErrors = value
procSnmp6.UdpLite6.InCsumErrors = &value
}
}
}

View file

@ -102,6 +102,8 @@ type ProcStat struct {
RSS int
// Soft limit in bytes on the rss of the process.
RSSLimit uint64
// CPU number last executed on.
Processor uint
// Real-time scheduling priority, a number in the range 1 to 99 for processes
// scheduled under a real-time policy, or 0, for non-real-time processes.
RTPriority uint
@ -184,7 +186,7 @@ func (p Proc) Stat() (ProcStat, error) {
&ignoreUint64,
&ignoreUint64,
&ignoreInt64,
&ignoreInt64,
&s.Processor,
&s.RTPriority,
&s.Policy,
&s.DelayAcctBlkIOTicks,

View file

@ -96,10 +96,10 @@ func (p Proc) NewStatus() (ProcStatus, error) {
kv := strings.SplitN(line, ":", 2)
// removes spaces
k := string(strings.TrimSpace(kv[0]))
v := string(strings.TrimSpace(kv[1]))
k := strings.TrimSpace(kv[0])
v := strings.TrimSpace(kv[1])
// removes "kB"
v = string(bytes.Trim([]byte(v), " kB"))
v = strings.TrimSuffix(v, " kB")
// value to int when possible
// we can skip error check here, 'cause vKBytes is not used when value is a string

View file

@ -62,7 +62,7 @@ type Stat struct {
// Summed up cpu statistics.
CPUTotal CPUStat
// Per-CPU statistics.
CPU []CPUStat
CPU map[int64]CPUStat
// Number of times interrupts were handled, which contains numbered and unnumbered IRQs.
IRQTotal uint64
// Number of times a numbered IRQ was triggered.
@ -170,10 +170,23 @@ func (fs FS) Stat() (Stat, error) {
if err != nil {
return Stat{}, err
}
procStat, err := parseStat(bytes.NewReader(data), fileName)
if err != nil {
return Stat{}, err
}
return procStat, nil
}
stat := Stat{}
// parseStat parses the metrics from /proc/[pid]/stat.
func parseStat(r io.Reader, fileName string) (Stat, error) {
var (
scanner = bufio.NewScanner(r)
stat = Stat{
CPU: make(map[int64]CPUStat),
}
err error
)
scanner := bufio.NewScanner(bytes.NewReader(data))
for scanner.Scan() {
line := scanner.Text()
parts := strings.Fields(scanner.Text())
@ -228,9 +241,6 @@ func (fs FS) Stat() (Stat, error) {
if cpuID == -1 {
stat.CPUTotal = cpuStat
} else {
for int64(len(stat.CPU)) <= cpuID {
stat.CPU = append(stat.CPU, CPUStat{})
}
stat.CPU[cpuID] = cpuStat
}
}

79
vendor/github.com/prometheus/procfs/thread.go generated vendored Normal file
View file

@ -0,0 +1,79 @@
// Copyright 2022 The Prometheus Authors
// 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 procfs
import (
"fmt"
"os"
"strconv"
fsi "github.com/prometheus/procfs/internal/fs"
)
// Provide access to /proc/PID/task/TID files, for thread specific values. Since
// such files have the same structure as /proc/PID/ ones, the data structures
// and the parsers for the latter may be reused.
// AllThreads returns a list of all currently available threads under /proc/PID.
func AllThreads(pid int) (Procs, error) {
fs, err := NewFS(DefaultMountPoint)
if err != nil {
return Procs{}, err
}
return fs.AllThreads(pid)
}
// AllThreads returns a list of all currently available threads for PID.
func (fs FS) AllThreads(pid int) (Procs, error) {
taskPath := fs.proc.Path(strconv.Itoa(pid), "task")
d, err := os.Open(taskPath)
if err != nil {
return Procs{}, err
}
defer d.Close()
names, err := d.Readdirnames(-1)
if err != nil {
return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err)
}
t := Procs{}
for _, n := range names {
tid, err := strconv.ParseInt(n, 10, 64)
if err != nil {
continue
}
t = append(t, Proc{PID: int(tid), fs: fsi.FS(taskPath)})
}
return t, nil
}
// Thread returns a process for a given PID, TID.
func (fs FS) Thread(pid, tid int) (Proc, error) {
taskPath := fs.proc.Path(strconv.Itoa(pid), "task")
if _, err := os.Stat(taskPath); err != nil {
return Proc{}, err
}
return Proc{PID: tid, fs: fsi.FS(taskPath)}, nil
}
// Thread returns a process for a given TID of Proc.
func (proc Proc) Thread(tid int) (Proc, error) {
tfs := fsi.FS(proc.path("task"))
if _, err := os.Stat(tfs.Path(strconv.Itoa(tid))); err != nil {
return Proc{}, err
}
return Proc{PID: tid, fs: tfs}, nil
}

View file

@ -26,7 +26,9 @@ import (
)
// The VM interface is described at
// https://www.kernel.org/doc/Documentation/sysctl/vm.txt
//
// https://www.kernel.org/doc/Documentation/sysctl/vm.txt
//
// Each setting is exposed as a single file.
// Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array
// and numa_zonelist_order (deprecated) which is a string.

View file

@ -20,6 +20,7 @@ import (
"strconv"
"github.com/cespare/xxhash/v2"
"github.com/prometheus/common/model"
)
// Well-known label names used by Prometheus components.
@ -134,6 +135,7 @@ func (ls Labels) MatchLabels(on bool, names ...string) Labels {
}
// Hash returns a hash value for the label set.
// Note: the result is not guaranteed to be consistent across different runs of Prometheus.
func (ls Labels) Hash() uint64 {
// Use xxhash.Sum64(b) for fast path as it's faster.
b := make([]byte, 0, 1024)
@ -311,6 +313,19 @@ func (ls Labels) WithoutEmpty() Labels {
return ls
}
// IsValid checks if the metric name or label names are valid.
func (ls Labels) IsValid() bool {
for _, l := range ls {
if l.Name == model.MetricNameLabel && !model.IsValidMetricName(model.LabelValue(l.Value)) {
return false
}
if !model.LabelName(l.Name).IsValid() || !model.LabelValue(l.Value).IsValid() {
return false
}
}
return true
}
// Equal returns whether the two label sets are equal.
func Equal(ls, o Labels) bool {
if len(ls) != len(o) {

View file

@ -45,6 +45,10 @@ const (
Keep Action = "keep"
// Drop drops targets for which the input does match the regex.
Drop Action = "drop"
// KeepEqual drops targets for which the input does not match the target.
KeepEqual Action = "keepequal"
// Drop drops targets for which the input does match the target.
DropEqual Action = "dropequal"
// HashMod sets a label to the modulus of a hash of labels.
HashMod Action = "hashmod"
// LabelMap copies labels to other labelnames based on a regex.
@ -66,7 +70,7 @@ func (a *Action) UnmarshalYAML(unmarshal func(interface{}) error) error {
return err
}
switch act := Action(strings.ToLower(s)); act {
case Replace, Keep, Drop, HashMod, LabelMap, LabelDrop, LabelKeep, Lowercase, Uppercase:
case Replace, Keep, Drop, HashMod, LabelMap, LabelDrop, LabelKeep, Lowercase, Uppercase, KeepEqual, DropEqual:
*a = act
return nil
}
@ -109,13 +113,13 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
if c.Modulus == 0 && c.Action == HashMod {
return fmt.Errorf("relabel configuration for hashmod requires non-zero modulus")
}
if (c.Action == Replace || c.Action == HashMod || c.Action == Lowercase || c.Action == Uppercase) && c.TargetLabel == "" {
if (c.Action == Replace || c.Action == HashMod || c.Action == Lowercase || c.Action == Uppercase || c.Action == KeepEqual || c.Action == DropEqual) && c.TargetLabel == "" {
return fmt.Errorf("relabel configuration for %s action requires 'target_label' value", c.Action)
}
if (c.Action == Replace || c.Action == Lowercase || c.Action == Uppercase) && !relabelTarget.MatchString(c.TargetLabel) {
if (c.Action == Replace || c.Action == Lowercase || c.Action == Uppercase || c.Action == KeepEqual || c.Action == DropEqual) && !relabelTarget.MatchString(c.TargetLabel) {
return fmt.Errorf("%q is invalid 'target_label' for %s action", c.TargetLabel, c.Action)
}
if (c.Action == Lowercase || c.Action == Uppercase) && c.Replacement != DefaultRelabelConfig.Replacement {
if (c.Action == Lowercase || c.Action == Uppercase || c.Action == KeepEqual || c.Action == DropEqual) && c.Replacement != DefaultRelabelConfig.Replacement {
return fmt.Errorf("'replacement' can not be set for %s action", c.Action)
}
if c.Action == LabelMap && !relabelTarget.MatchString(c.Replacement) {
@ -125,6 +129,15 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
return fmt.Errorf("%q is invalid 'target_label' for %s action", c.TargetLabel, c.Action)
}
if c.Action == DropEqual || c.Action == KeepEqual {
if c.Regex != DefaultRelabelConfig.Regex ||
c.Modulus != DefaultRelabelConfig.Modulus ||
c.Separator != DefaultRelabelConfig.Separator ||
c.Replacement != DefaultRelabelConfig.Replacement {
return fmt.Errorf("%s action requires only 'source_labels' and `target_label`, and no other fields", c.Action)
}
}
if c.Action == LabelDrop || c.Action == LabelKeep {
if c.SourceLabels != nil ||
c.TargetLabel != DefaultRelabelConfig.TargetLabel ||
@ -225,6 +238,14 @@ func relabel(lset labels.Labels, cfg *Config, lb *labels.Builder) labels.Labels
if !cfg.Regex.MatchString(val) {
return nil
}
case DropEqual:
if lset.Get(cfg.TargetLabel) == val {
return nil
}
case KeepEqual:
if lset.Get(cfg.TargetLabel) != val {
return nil
}
case Replace:
indexes := cfg.Regex.FindStringSubmatchIndex(val)
// If there is no match no replacement must take place.

View file

@ -13,5 +13,22 @@
package prompb
import (
"sync"
)
func (m Sample) T() int64 { return m.Timestamp }
func (m Sample) V() float64 { return m.Value }
func (r *ChunkedReadResponse) PooledMarshal(p *sync.Pool) ([]byte, error) {
size := r.Size()
data, ok := p.Get().(*[]byte)
if ok && cap(*data) >= size {
n, err := r.MarshalToSizedBuffer((*data)[:size])
if err != nil {
return nil, err
}
return (*data)[:n], nil
}
return r.Marshal()
}

View file

@ -1609,6 +1609,10 @@ loop:
err = errNameLabelMandatory
break loop
}
if !lset.IsValid() {
err = fmt.Errorf("invalid metric name or label names: %s", lset.String())
break loop
}
// If any label limits is exceeded the scrape should fail.
if err = verifyLabelLimits(lset, sl.labelLimits); err != nil {

View file

@ -248,7 +248,8 @@ type GetRef interface {
// Returns reference number that can be used to pass to Appender.Append(),
// and a set of labels that will not cause another copy when passed to Appender.Append().
// 0 means the appender does not have a reference to this series.
GetRef(lset labels.Labels) (SeriesRef, labels.Labels)
// hash should be a hash of lset.
GetRef(lset labels.Labels, hash uint64) (SeriesRef, labels.Labels)
}
// ExemplarAppender provides an interface for adding samples to exemplar storage, which

View file

@ -20,6 +20,7 @@ import (
"net/http"
"sort"
"strings"
"sync"
"github.com/gogo/protobuf/proto"
"github.com/golang/snappy"
@ -193,6 +194,7 @@ func StreamChunkedReadResponses(
ss storage.ChunkSeriesSet,
sortedExternalLabels []prompb.Label,
maxBytesInFrame int,
marshalPool *sync.Pool,
) (storage.Warnings, error) {
var (
chks []prompb.Chunk
@ -234,12 +236,14 @@ func StreamChunkedReadResponses(
continue
}
b, err := proto.Marshal(&prompb.ChunkedReadResponse{
resp := &prompb.ChunkedReadResponse{
ChunkedSeries: []*prompb.ChunkedSeries{
{Labels: lbls, Chunks: chks},
},
QueryIndex: queryIndex,
})
}
b, err := resp.PooledMarshal(marshalPool)
if err != nil {
return ss.Warnings(), fmt.Errorf("marshal ChunkedReadResponse: %w", err)
}
@ -247,6 +251,9 @@ func StreamChunkedReadResponses(
if _, err := stream.Write(b); err != nil {
return ss.Warnings(), fmt.Errorf("write to stream: %w", err)
}
// We immediately flush the Write() so it is safe to return to the pool.
marshalPool.Put(&b)
chks = chks[:0]
}
if err := iter.Err(); err != nil {

View file

@ -17,6 +17,7 @@ import (
"context"
"net/http"
"sort"
"sync"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
@ -37,6 +38,7 @@ type readHandler struct {
remoteReadMaxBytesInFrame int
remoteReadGate *gate.Gate
queries prometheus.Gauge
marshalPool *sync.Pool
}
// NewReadHandler creates a http.Handler that accepts remote read requests and
@ -49,6 +51,7 @@ func NewReadHandler(logger log.Logger, r prometheus.Registerer, queryable storag
remoteReadSampleLimit: remoteReadSampleLimit,
remoteReadGate: gate.New(remoteReadConcurrencyLimit),
remoteReadMaxBytesInFrame: remoteReadMaxBytesInFrame,
marshalPool: &sync.Pool{},
queries: prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: "prometheus",
@ -225,6 +228,7 @@ func (h *readHandler) remoteReadStreamedXORChunks(ctx context.Context, w http.Re
querier.Select(true, hints, filteredMatchers...),
sortedExternalLabels,
h.remoteReadMaxBytesInFrame,
h.marshalPool,
)
if err != nil {
return err

View file

@ -67,11 +67,14 @@ func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// checkAppendExemplarError modifies the AppendExamplar's returned error based on the error cause.
func (h *writeHandler) checkAppendExemplarError(err error, e exemplar.Exemplar, outOfOrderErrs *int) error {
unwrapedErr := errors.Unwrap(err)
unwrappedErr := errors.Unwrap(err)
if unwrappedErr == nil {
unwrappedErr = err
}
switch {
case errors.Is(unwrapedErr, storage.ErrNotFound):
case errors.Is(unwrappedErr, storage.ErrNotFound):
return storage.ErrNotFound
case errors.Is(unwrapedErr, storage.ErrOutOfOrderExemplar):
case errors.Is(unwrappedErr, storage.ErrOutOfOrderExemplar):
*outOfOrderErrs++
level.Debug(h.logger).Log("msg", "Out of order exemplar", "exemplar", fmt.Sprintf("%+v", e))
return nil
@ -98,8 +101,11 @@ func (h *writeHandler) write(ctx context.Context, req *prompb.WriteRequest) (err
for _, s := range ts.Samples {
_, err = app.Append(0, labels, s.Timestamp, s.Value)
if err != nil {
unwrapedErr := errors.Unwrap(err)
if errors.Is(unwrapedErr, storage.ErrOutOfOrderSample) || errors.Is(unwrapedErr, storage.ErrOutOfBounds) || errors.Is(unwrapedErr, storage.ErrDuplicateSampleForTimestamp) {
unwrappedErr := errors.Unwrap(err)
if unwrappedErr == nil {
unwrappedErr = err
}
if errors.Is(err, storage.ErrOutOfOrderSample) || errors.Is(unwrappedErr, storage.ErrOutOfBounds) || errors.Is(unwrappedErr, storage.ErrDuplicateSampleForTimestamp) {
level.Error(h.logger).Log("msg", "Out of order sample from remote write", "err", err.Error(), "series", labels.String(), "timestamp", s.Timestamp)
}
return err
@ -123,6 +129,9 @@ func (h *writeHandler) write(ctx context.Context, req *prompb.WriteRequest) (err
_, err = app.AppendHistogram(0, labels, hp.Timestamp, hs)
if err != nil {
unwrappedErr := errors.Unwrap(err)
if unwrappedErr == nil {
unwrappedErr = err
}
// Althogh AppendHistogram does not currently return ErrDuplicateSampleForTimestamp there is
// a note indicating its inclusion in the future.
if errors.Is(unwrappedErr, storage.ErrOutOfOrderSample) || errors.Is(unwrappedErr, storage.ErrOutOfBounds) || errors.Is(unwrappedErr, storage.ErrDuplicateSampleForTimestamp) {

View file

@ -727,7 +727,7 @@ func (c *LeveledCompactor) populateBlock(blocks []BlockReader, meta *BlockMeta,
}
all = indexr.SortedPostings(all)
// Blocks meta is half open: [min, max), so subtract 1 to ensure we don't hold samples with exact meta.MaxTime timestamp.
sets = append(sets, newBlockChunkSeriesSet(indexr, chunkr, tombsr, all, meta.MinTime, meta.MaxTime-1, false))
sets = append(sets, newBlockChunkSeriesSet(b.Meta().ULID, indexr, chunkr, tombsr, all, meta.MinTime, meta.MaxTime-1, false))
syms := indexr.Symbols()
if i == 0 {
symbols = syms

View file

@ -66,7 +66,7 @@ const (
// ErrNotReady is returned if the underlying storage is not ready yet.
var ErrNotReady = errors.New("TSDB not ready")
// DefaultOptions used for the DB. They are sane for setups using
// DefaultOptions used for the DB. They are reasonable for setups using
// millisecond precision timestamps.
func DefaultOptions() *Options {
return &Options{
@ -998,9 +998,9 @@ type dbAppender struct {
var _ storage.GetRef = dbAppender{}
func (a dbAppender) GetRef(lset labels.Labels) (storage.SeriesRef, labels.Labels) {
func (a dbAppender) GetRef(lset labels.Labels, hash uint64) (storage.SeriesRef, labels.Labels) {
if g, ok := a.Appender.(storage.GetRef); ok {
return g.GetRef(lset)
return g.GetRef(lset, hash)
}
return 0, nil
}

View file

@ -98,9 +98,9 @@ func (h *Head) initTime(t int64) {
h.maxTime.CompareAndSwap(math.MinInt64, t)
}
func (a *initAppender) GetRef(lset labels.Labels) (storage.SeriesRef, labels.Labels) {
func (a *initAppender) GetRef(lset labels.Labels, hash uint64) (storage.SeriesRef, labels.Labels) {
if g, ok := a.app.(storage.GetRef); ok {
return g.GetRef(lset)
return g.GetRef(lset, hash)
}
return 0, nil
}
@ -440,7 +440,7 @@ func (s *memSeries) appendableHistogram(t int64, h *histogram.Histogram) error {
}
// AppendExemplar for headAppender assumes the series ref already exists, and so it doesn't
// use getOrCreate or make any of the lset sanity checks that Append does.
// use getOrCreate or make any of the lset validity checks that Append does.
func (a *headAppender) AppendExemplar(ref storage.SeriesRef, lset labels.Labels, e exemplar.Exemplar) (storage.SeriesRef, error) {
// Check if exemplar storage is enabled.
if !a.head.opts.EnableExemplarStorage || a.head.opts.MaxExemplars.Load() <= 0 {
@ -647,8 +647,8 @@ func checkHistogramBuckets(buckets []int64) (uint64, error) {
var _ storage.GetRef = &headAppender{}
func (a *headAppender) GetRef(lset labels.Labels) (storage.SeriesRef, labels.Labels) {
s := a.head.series.getByHash(lset.Hash(), lset)
func (a *headAppender) GetRef(lset labels.Labels, hash uint64) (storage.SeriesRef, labels.Labels) {
s := a.head.series.getByHash(hash, lset)
if s == nil {
return 0, nil
}

View file

@ -1164,44 +1164,37 @@ func newReader(b ByteSlice, c io.Closer) (*Reader, error) {
// Earlier V1 formats don't have a sorted postings offset table, so
// load the whole offset table into memory.
r.postingsV1 = map[string]map[string]uint64{}
if err := ReadOffsetTable(r.b, r.toc.PostingsTable, func(key []string, off uint64, _ int) error {
if len(key) != 2 {
return errors.Errorf("unexpected key length for posting table %d", len(key))
if err := ReadPostingsOffsetTable(r.b, r.toc.PostingsTable, func(name, value []byte, off uint64, _ int) error {
if _, ok := r.postingsV1[string(name)]; !ok {
r.postingsV1[string(name)] = map[string]uint64{}
r.postings[string(name)] = nil // Used to get a list of labelnames in places.
}
if _, ok := r.postingsV1[key[0]]; !ok {
r.postingsV1[key[0]] = map[string]uint64{}
r.postings[key[0]] = nil // Used to get a list of labelnames in places.
}
r.postingsV1[key[0]][key[1]] = off
r.postingsV1[string(name)][string(value)] = off
return nil
}); err != nil {
return nil, errors.Wrap(err, "read postings table")
}
} else {
var lastKey []string
var lastName, lastValue []byte
lastOff := 0
valueCount := 0
// For the postings offset table we keep every label name but only every nth
// label value (plus the first and last one), to save memory.
if err := ReadOffsetTable(r.b, r.toc.PostingsTable, func(key []string, _ uint64, off int) error {
if len(key) != 2 {
return errors.Errorf("unexpected key length for posting table %d", len(key))
}
if _, ok := r.postings[key[0]]; !ok {
if err := ReadPostingsOffsetTable(r.b, r.toc.PostingsTable, func(name, value []byte, _ uint64, off int) error {
if _, ok := r.postings[string(name)]; !ok {
// Next label name.
r.postings[key[0]] = []postingOffset{}
if lastKey != nil {
r.postings[string(name)] = []postingOffset{}
if lastName != nil {
// Always include last value for each label name.
r.postings[lastKey[0]] = append(r.postings[lastKey[0]], postingOffset{value: lastKey[1], off: lastOff})
r.postings[string(lastName)] = append(r.postings[string(lastName)], postingOffset{value: string(lastValue), off: lastOff})
}
lastKey = nil
valueCount = 0
}
if valueCount%symbolFactor == 0 {
r.postings[key[0]] = append(r.postings[key[0]], postingOffset{value: key[1], off: off})
lastKey = nil
r.postings[string(name)] = append(r.postings[string(name)], postingOffset{value: string(value), off: off})
lastName, lastValue = nil, nil
} else {
lastKey = key
lastName, lastValue = name, value
lastOff = off
}
valueCount++
@ -1209,8 +1202,8 @@ func newReader(b ByteSlice, c io.Closer) (*Reader, error) {
}); err != nil {
return nil, errors.Wrap(err, "read postings table")
}
if lastKey != nil {
r.postings[lastKey[0]] = append(r.postings[lastKey[0]], postingOffset{value: lastKey[1], off: lastOff})
if lastName != nil {
r.postings[string(lastName)] = append(r.postings[string(lastName)], postingOffset{value: string(lastValue), off: lastOff})
}
// Trim any extra space in the slices.
for k, v := range r.postings {
@ -1251,15 +1244,12 @@ type Range struct {
// for all postings lists.
func (r *Reader) PostingsRanges() (map[labels.Label]Range, error) {
m := map[labels.Label]Range{}
if err := ReadOffsetTable(r.b, r.toc.PostingsTable, func(key []string, off uint64, _ int) error {
if len(key) != 2 {
return errors.Errorf("unexpected key length for posting table %d", len(key))
}
if err := ReadPostingsOffsetTable(r.b, r.toc.PostingsTable, func(name, value []byte, off uint64, _ int) error {
d := encoding.NewDecbufAt(r.b, int(off), castagnoliTable)
if d.Err() != nil {
return d.Err()
}
m[labels.Label{Name: key[0], Value: key[1]}] = Range{
m[labels.Label{Name: string(name), Value: string(value)}] = Range{
Start: int64(off) + 4,
End: int64(off) + 4 + int64(d.Len()),
}
@ -1412,29 +1402,29 @@ func (s *symbolsIter) Next() bool {
func (s symbolsIter) At() string { return s.cur }
func (s symbolsIter) Err() error { return s.err }
// ReadOffsetTable reads an offset table and at the given position calls f for each
// found entry. If f returns an error it stops decoding and returns the received error.
func ReadOffsetTable(bs ByteSlice, off uint64, f func([]string, uint64, int) error) error {
// ReadPostingsOffsetTable reads the postings offset table and at the given position calls f for each
// found entry.
// The name and value parameters passed to f reuse the backing memory of the underlying byte slice,
// so they shouldn't be persisted without previously copying them.
// If f returns an error it stops decoding and returns the received error.
func ReadPostingsOffsetTable(bs ByteSlice, off uint64, f func(name, value []byte, postingsOffset uint64, labelOffset int) error) error {
d := encoding.NewDecbufAt(bs, int(off), castagnoliTable)
startLen := d.Len()
cnt := d.Be32()
for d.Err() == nil && d.Len() > 0 && cnt > 0 {
offsetPos := startLen - d.Len()
keyCount := d.Uvarint()
// The Postings offset table takes only 2 keys per entry (name and value of label),
// and the LabelIndices offset table takes only 1 key per entry (a label name).
// Hence setting the size to max of both, i.e. 2.
keys := make([]string, 0, 2)
for i := 0; i < keyCount; i++ {
keys = append(keys, d.UvarintStr())
if keyCount := d.Uvarint(); keyCount != 2 {
return errors.Errorf("unexpected number of keys for postings offset table %d", keyCount)
}
name := d.UvarintBytes()
value := d.UvarintBytes()
o := d.Uvarint64()
if d.Err() != nil {
break
}
if err := f(keys, o, offsetPos); err != nil {
if err := f(name, value, o, offsetPos); err != nil {
return err
}
cnt--

View file

@ -19,6 +19,7 @@ import (
"strings"
"unicode/utf8"
"github.com/oklog/ulid"
"github.com/pkg/errors"
"golang.org/x/exp/slices"
@ -47,6 +48,7 @@ func init() {
}
type blockBaseQuerier struct {
blockID ulid.ULID
index IndexReader
chunks ChunkReader
tombstones tombstones.Reader
@ -77,6 +79,7 @@ func newBlockBaseQuerier(b BlockReader, mint, maxt int64) (*blockBaseQuerier, er
tombsr = tombstones.NewMemTombstones()
}
return &blockBaseQuerier{
blockID: b.Meta().ULID,
mint: mint,
maxt: maxt,
index: indexr,
@ -178,7 +181,7 @@ func (q *blockChunkQuerier) Select(sortSeries bool, hints *storage.SelectHints,
if sortSeries {
p = q.index.SortedPostings(p)
}
return newBlockChunkSeriesSet(q.index, q.chunks, q.tombstones, p, mint, maxt, disableTrimming)
return newBlockChunkSeriesSet(q.blockID, q.index, q.chunks, q.tombstones, p, mint, maxt, disableTrimming)
}
func findSetMatches(pattern string) []string {
@ -427,6 +430,7 @@ func labelNamesWithMatchers(r IndexReader, matchers ...*labels.Matcher) ([]strin
// Iterated series are trimmed with given min and max time as well as tombstones.
// See newBlockSeriesSet and newBlockChunkSeriesSet to use it for either sample or chunk iterating.
type blockBaseSeriesSet struct {
blockID ulid.ULID
p index.Postings
index IndexReader
chunks ChunkReader
@ -471,7 +475,14 @@ func (b *blockBaseSeriesSet) Next() bool {
var trimFront, trimBack bool
// Copy chunks as iterables are reusable.
chks := make([]chunks.Meta, 0, len(b.bufChks))
// Count those in range to size allocation (roughly - ignoring tombstones).
nChks := 0
for _, chk := range b.bufChks {
if !(chk.MaxTime < b.mint || chk.MinTime > b.maxt) {
nChks++
}
}
chks := make([]chunks.Meta, 0, nChks)
// Prefilter chunks and pick those which are not entirely deleted or totally outside of the requested range.
for _, chk := range b.bufChks {
@ -481,10 +492,10 @@ func (b *blockBaseSeriesSet) Next() bool {
if chk.MinTime > b.maxt {
continue
}
if !(tombstones.Interval{Mint: chk.MinTime, Maxt: chk.MaxTime}.IsSubrange(intervals)) {
chks = append(chks, chk)
if (tombstones.Interval{Mint: chk.MinTime, Maxt: chk.MaxTime}.IsSubrange(intervals)) {
continue
}
chks = append(chks, chk)
// If still not entirely deleted, check if trim is needed based on requested time range.
if !b.disableTrimming {
@ -512,7 +523,7 @@ func (b *blockBaseSeriesSet) Next() bool {
copy(b.currLabels, b.bufLbls)
b.currIterFn = func() *populateWithDelGenericSeriesIterator {
return newPopulateWithDelGenericSeriesIterator(b.chunks, chks, intervals)
return newPopulateWithDelGenericSeriesIterator(b.blockID, b.chunks, chks, intervals)
}
return true
}
@ -539,7 +550,8 @@ func (b *blockBaseSeriesSet) Warnings() storage.Warnings { return nil }
// means that the chunk iterator in currChkMeta is invalid and a chunk rewrite
// is needed, for which currDelIter should be used.
type populateWithDelGenericSeriesIterator struct {
chunks ChunkReader
blockID ulid.ULID
chunks ChunkReader
// chks are expected to be sorted by minTime and should be related to
// the same, single series.
chks []chunks.Meta
@ -554,11 +566,13 @@ type populateWithDelGenericSeriesIterator struct {
}
func newPopulateWithDelGenericSeriesIterator(
blockID ulid.ULID,
chunks ChunkReader,
chks []chunks.Meta,
intervals tombstones.Intervals,
) *populateWithDelGenericSeriesIterator {
return &populateWithDelGenericSeriesIterator{
blockID: blockID,
chunks: chunks,
chks: chks,
i: -1,
@ -577,7 +591,7 @@ func (p *populateWithDelGenericSeriesIterator) next() bool {
p.currChkMeta.Chunk, p.err = p.chunks.Chunk(p.currChkMeta)
if p.err != nil {
p.err = errors.Wrapf(p.err, "cannot populate chunk %d", p.currChkMeta.Ref)
p.err = errors.Wrapf(p.err, "cannot populate chunk %d from block %s", p.currChkMeta.Ref, p.blockID.String())
return false
}
@ -837,9 +851,10 @@ type blockChunkSeriesSet struct {
blockBaseSeriesSet
}
func newBlockChunkSeriesSet(i IndexReader, c ChunkReader, t tombstones.Reader, p index.Postings, mint, maxt int64, disableTrimming bool) storage.ChunkSeriesSet {
func newBlockChunkSeriesSet(id ulid.ULID, i IndexReader, c ChunkReader, t tombstones.Reader, p index.Postings, mint, maxt int64, disableTrimming bool) storage.ChunkSeriesSet {
return &blockChunkSeriesSet{
blockBaseSeriesSet{
blockID: id,
index: i,
chunks: c,
tombstones: t,

View file

@ -213,6 +213,12 @@ func ParseBestEffort(s string) float64 {
}
}
// the integer part might be elided to remain compliant
// with https://go.dev/ref/spec#Floating-point_literals
if s[i] == '.' && (i+1 >= uint(len(s)) || s[i+1] < '0' || s[i+1] > '9') {
return 0
}
d := uint64(0)
j := i
for i < uint(len(s)) {
@ -232,7 +238,7 @@ func ParseBestEffort(s string) float64 {
}
break
}
if i <= j {
if i <= j && s[i] != '.' {
s = s[i:]
if strings.HasPrefix(s, "+") {
s = s[1:]
@ -263,7 +269,9 @@ func ParseBestEffort(s string) float64 {
// Parse fractional part.
i++
if i >= uint(len(s)) {
return 0
// the fractional part may be elided to remain compliant
// with https://go.dev/ref/spec#Floating-point_literals
return f
}
k := i
for i < uint(len(s)) {
@ -363,6 +371,12 @@ func Parse(s string) (float64, error) {
}
}
// the integer part might be elided to remain compliant
// with https://go.dev/ref/spec#Floating-point_literals
if s[i] == '.' && (i+1 >= uint(len(s)) || s[i+1] < '0' || s[i+1] > '9') {
return 0, fmt.Errorf("missing integer and fractional part in %q", s)
}
d := uint64(0)
j := i
for i < uint(len(s)) {
@ -382,7 +396,7 @@ func Parse(s string) (float64, error) {
}
break
}
if i <= j {
if i <= j && s[i] != '.' {
ss := s[i:]
if strings.HasPrefix(ss, "+") {
ss = ss[1:]
@ -413,7 +427,9 @@ func Parse(s string) (float64, error) {
// Parse fractional part.
i++
if i >= uint(len(s)) {
return 0, fmt.Errorf("cannot parse fractional part in %q", s)
// the fractional part might be elided to remain compliant
// with https://go.dev/ref/spec#Floating-point_literals
return f, nil
}
k := i
for i < uint(len(s)) {

View file

@ -6,23 +6,91 @@
package http2
// flow is the flow control window's size.
type flow struct {
// inflowMinRefresh is the minimum number of bytes we'll send for a
// flow control window update.
const inflowMinRefresh = 4 << 10
// inflow accounts for an inbound flow control window.
// It tracks both the latest window sent to the peer (used for enforcement)
// and the accumulated unsent window.
type inflow struct {
avail int32
unsent int32
}
// set sets the initial window.
func (f *inflow) init(n int32) {
f.avail = n
}
// add adds n bytes to the window, with a maximum window size of max,
// indicating that the peer can now send us more data.
// For example, the user read from a {Request,Response} body and consumed
// some of the buffered data, so the peer can now send more.
// It returns the number of bytes to send in a WINDOW_UPDATE frame to the peer.
// Window updates are accumulated and sent when the unsent capacity
// is at least inflowMinRefresh or will at least double the peer's available window.
func (f *inflow) add(n int) (connAdd int32) {
if n < 0 {
panic("negative update")
}
unsent := int64(f.unsent) + int64(n)
// "A sender MUST NOT allow a flow-control window to exceed 2^31-1 octets."
// RFC 7540 Section 6.9.1.
const maxWindow = 1<<31 - 1
if unsent+int64(f.avail) > maxWindow {
panic("flow control update exceeds maximum window size")
}
f.unsent = int32(unsent)
if f.unsent < inflowMinRefresh && f.unsent < f.avail {
// If there aren't at least inflowMinRefresh bytes of window to send,
// and this update won't at least double the window, buffer the update for later.
return 0
}
f.avail += f.unsent
f.unsent = 0
return int32(unsent)
}
// take attempts to take n bytes from the peer's flow control window.
// It reports whether the window has available capacity.
func (f *inflow) take(n uint32) bool {
if n > uint32(f.avail) {
return false
}
f.avail -= int32(n)
return true
}
// takeInflows attempts to take n bytes from two inflows,
// typically connection-level and stream-level flows.
// It reports whether both windows have available capacity.
func takeInflows(f1, f2 *inflow, n uint32) bool {
if n > uint32(f1.avail) || n > uint32(f2.avail) {
return false
}
f1.avail -= int32(n)
f2.avail -= int32(n)
return true
}
// outflow is the outbound flow control window's size.
type outflow struct {
_ incomparable
// n is the number of DATA bytes we're allowed to send.
// A flow is kept both on a conn and a per-stream.
// An outflow is kept both on a conn and a per-stream.
n int32
// conn points to the shared connection-level flow that is
// shared by all streams on that conn. It is nil for the flow
// conn points to the shared connection-level outflow that is
// shared by all streams on that conn. It is nil for the outflow
// that's on the conn directly.
conn *flow
conn *outflow
}
func (f *flow) setConnFlow(cf *flow) { f.conn = cf }
func (f *outflow) setConnFlow(cf *outflow) { f.conn = cf }
func (f *flow) available() int32 {
func (f *outflow) available() int32 {
n := f.n
if f.conn != nil && f.conn.n < n {
n = f.conn.n
@ -30,7 +98,7 @@ func (f *flow) available() int32 {
return n
}
func (f *flow) take(n int32) {
func (f *outflow) take(n int32) {
if n > f.available() {
panic("internal error: took too much")
}
@ -42,7 +110,7 @@ func (f *flow) take(n int32) {
// add adds n bytes (positive or negative) to the flow control window.
// It returns false if the sum would exceed 2^31-1.
func (f *flow) add(n int32) bool {
func (f *outflow) add(n int32) bool {
sum := f.n + n
if (sum > n) == (f.n > 0) {
f.n = sum

View file

@ -448,7 +448,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
// configured value for inflow, that will be updated when we send a
// WINDOW_UPDATE shortly after sending SETTINGS.
sc.flow.add(initialWindowSize)
sc.inflow.add(initialWindowSize)
sc.inflow.init(initialWindowSize)
sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf)
sc.hpackEncoder.SetMaxDynamicTableSizeLimit(s.maxEncoderHeaderTableSize())
@ -563,8 +563,8 @@ type serverConn struct {
wroteFrameCh chan frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes
bodyReadCh chan bodyReadMsg // from handlers -> serve
serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop
flow flow // conn-wide (not stream-specific) outbound flow control
inflow flow // conn-wide inbound flow control
flow outflow // conn-wide (not stream-specific) outbound flow control
inflow inflow // conn-wide inbound flow control
tlsState *tls.ConnectionState // shared by all handlers, like net/http
remoteAddrStr string
writeSched WriteScheduler
@ -641,10 +641,10 @@ type stream struct {
cancelCtx func()
// owned by serverConn's serve loop:
bodyBytes int64 // body bytes seen so far
declBodyBytes int64 // or -1 if undeclared
flow flow // limits writing from Handler to client
inflow flow // what the client is allowed to POST/etc to us
bodyBytes int64 // body bytes seen so far
declBodyBytes int64 // or -1 if undeclared
flow outflow // limits writing from Handler to client
inflow inflow // what the client is allowed to POST/etc to us
state streamState
resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
gotTrailerHeader bool // HEADER frame for trailers was seen
@ -1503,7 +1503,7 @@ func (sc *serverConn) processFrame(f Frame) error {
if sc.inGoAway && (sc.goAwayCode != ErrCodeNo || f.Header().StreamID > sc.maxClientStreamID) {
if f, ok := f.(*DataFrame); ok {
if sc.inflow.available() < int32(f.Length) {
if !sc.inflow.take(f.Length) {
return sc.countError("data_flow", streamError(f.Header().StreamID, ErrCodeFlowControl))
}
sc.sendWindowUpdate(nil, int(f.Length)) // conn-level
@ -1775,14 +1775,9 @@ func (sc *serverConn) processData(f *DataFrame) error {
// But still enforce their connection-level flow control,
// and return any flow control bytes since we're not going
// to consume them.
if sc.inflow.available() < int32(f.Length) {
if !sc.inflow.take(f.Length) {
return sc.countError("data_flow", streamError(id, ErrCodeFlowControl))
}
// Deduct the flow control from inflow, since we're
// going to immediately add it back in
// sendWindowUpdate, which also schedules sending the
// frames.
sc.inflow.take(int32(f.Length))
sc.sendWindowUpdate(nil, int(f.Length)) // conn-level
if st != nil && st.resetQueued {
@ -1797,10 +1792,9 @@ func (sc *serverConn) processData(f *DataFrame) error {
// Sender sending more than they'd declared?
if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes {
if sc.inflow.available() < int32(f.Length) {
if !sc.inflow.take(f.Length) {
return sc.countError("data_flow", streamError(id, ErrCodeFlowControl))
}
sc.inflow.take(int32(f.Length))
sc.sendWindowUpdate(nil, int(f.Length)) // conn-level
st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes))
@ -1811,10 +1805,9 @@ func (sc *serverConn) processData(f *DataFrame) error {
}
if f.Length > 0 {
// Check whether the client has flow control quota.
if st.inflow.available() < int32(f.Length) {
if !takeInflows(&sc.inflow, &st.inflow, f.Length) {
return sc.countError("flow_on_data_length", streamError(id, ErrCodeFlowControl))
}
st.inflow.take(int32(f.Length))
if len(data) > 0 {
wrote, err := st.body.Write(data)
@ -1830,10 +1823,12 @@ func (sc *serverConn) processData(f *DataFrame) error {
// Return any padded flow control now, since we won't
// refund it later on body reads.
if pad := int32(f.Length) - int32(len(data)); pad > 0 {
sc.sendWindowUpdate32(nil, pad)
sc.sendWindowUpdate32(st, pad)
}
// Call sendWindowUpdate even if there is no padding,
// to return buffered flow control credit if the sent
// window has shrunk.
pad := int32(f.Length) - int32(len(data))
sc.sendWindowUpdate32(nil, pad)
sc.sendWindowUpdate32(st, pad)
}
if f.StreamEnded() {
st.endStream()
@ -2105,8 +2100,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
st.cw.Init()
st.flow.conn = &sc.flow // link to conn-level counter
st.flow.add(sc.initialStreamSendWindowSize)
st.inflow.conn = &sc.inflow // link to conn-level counter
st.inflow.add(sc.srv.initialStreamRecvWindowSize())
st.inflow.init(sc.srv.initialStreamRecvWindowSize())
if sc.hs.WriteTimeout != 0 {
st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
}
@ -2388,47 +2382,28 @@ func (sc *serverConn) noteBodyRead(st *stream, n int) {
}
// st may be nil for conn-level
func (sc *serverConn) sendWindowUpdate(st *stream, n int) {
sc.serveG.check()
// "The legal range for the increment to the flow control
// window is 1 to 2^31-1 (2,147,483,647) octets."
// A Go Read call on 64-bit machines could in theory read
// a larger Read than this. Very unlikely, but we handle it here
// rather than elsewhere for now.
const maxUint31 = 1<<31 - 1
for n > maxUint31 {
sc.sendWindowUpdate32(st, maxUint31)
n -= maxUint31
}
sc.sendWindowUpdate32(st, int32(n))
func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) {
sc.sendWindowUpdate(st, int(n))
}
// st may be nil for conn-level
func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) {
func (sc *serverConn) sendWindowUpdate(st *stream, n int) {
sc.serveG.check()
if n == 0 {
var streamID uint32
var send int32
if st == nil {
send = sc.inflow.add(n)
} else {
streamID = st.id
send = st.inflow.add(n)
}
if send == 0 {
return
}
if n < 0 {
panic("negative update")
}
var streamID uint32
if st != nil {
streamID = st.id
}
sc.writeFrame(FrameWriteRequest{
write: writeWindowUpdate{streamID: streamID, n: uint32(n)},
write: writeWindowUpdate{streamID: streamID, n: uint32(send)},
stream: st,
})
var ok bool
if st == nil {
ok = sc.inflow.add(n)
} else {
ok = st.inflow.add(n)
}
if !ok {
panic("internal error; sent too many window updates without decrements?")
}
}
// requestBody is the Handler's Request.Body type.

View file

@ -47,10 +47,6 @@ const (
// we buffer per stream.
transportDefaultStreamFlow = 4 << 20
// transportDefaultStreamMinRefresh is the minimum number of bytes we'll send
// a stream-level WINDOW_UPDATE for at a time.
transportDefaultStreamMinRefresh = 4 << 10
defaultUserAgent = "Go-http-client/2.0"
// initialMaxConcurrentStreams is a connections maxConcurrentStreams until
@ -310,8 +306,8 @@ type ClientConn struct {
mu sync.Mutex // guards following
cond *sync.Cond // hold mu; broadcast on flow/closed changes
flow flow // our conn-level flow control quota (cs.flow is per stream)
inflow flow // peer's conn-level flow control
flow outflow // our conn-level flow control quota (cs.outflow is per stream)
inflow inflow // peer's conn-level flow control
doNotReuse bool // whether conn is marked to not be reused for any future requests
closing bool
closed bool
@ -376,10 +372,10 @@ type clientStream struct {
respHeaderRecv chan struct{} // closed when headers are received
res *http.Response // set if respHeaderRecv is closed
flow flow // guarded by cc.mu
inflow flow // guarded by cc.mu
bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read
readErr error // sticky read error; owned by transportResponseBody.Read
flow outflow // guarded by cc.mu
inflow inflow // guarded by cc.mu
bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read
readErr error // sticky read error; owned by transportResponseBody.Read
reqBody io.ReadCloser
reqBodyContentLength int64 // -1 means unknown
@ -811,7 +807,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
cc.bw.Write(clientPreface)
cc.fr.WriteSettings(initialSettings...)
cc.fr.WriteWindowUpdate(0, transportDefaultConnFlow)
cc.inflow.add(transportDefaultConnFlow + initialWindowSize)
cc.inflow.init(transportDefaultConnFlow + initialWindowSize)
cc.bw.Flush()
if cc.werr != nil {
cc.Close()
@ -2073,8 +2069,7 @@ type resAndError struct {
func (cc *ClientConn) addStreamLocked(cs *clientStream) {
cs.flow.add(int32(cc.initialWindowSize))
cs.flow.setConnFlow(&cc.flow)
cs.inflow.add(transportDefaultStreamFlow)
cs.inflow.setConnFlow(&cc.inflow)
cs.inflow.init(transportDefaultStreamFlow)
cs.ID = cc.nextStreamID
cc.nextStreamID += 2
cc.streams[cs.ID] = cs
@ -2533,21 +2528,10 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) {
}
cc.mu.Lock()
var connAdd, streamAdd int32
// Check the conn-level first, before the stream-level.
if v := cc.inflow.available(); v < transportDefaultConnFlow/2 {
connAdd = transportDefaultConnFlow - v
cc.inflow.add(connAdd)
}
connAdd := cc.inflow.add(n)
var streamAdd int32
if err == nil { // No need to refresh if the stream is over or failed.
// Consider any buffered body data (read from the conn but not
// consumed by the client) when computing flow control for this
// stream.
v := int(cs.inflow.available()) + cs.bufPipe.Len()
if v < transportDefaultStreamFlow-transportDefaultStreamMinRefresh {
streamAdd = int32(transportDefaultStreamFlow - v)
cs.inflow.add(streamAdd)
}
streamAdd = cs.inflow.add(n)
}
cc.mu.Unlock()
@ -2575,17 +2559,15 @@ func (b transportResponseBody) Close() error {
if unread > 0 {
cc.mu.Lock()
// Return connection-level flow control.
if unread > 0 {
cc.inflow.add(int32(unread))
}
connAdd := cc.inflow.add(unread)
cc.mu.Unlock()
// TODO(dneil): Acquiring this mutex can block indefinitely.
// Move flow control return to a goroutine?
cc.wmu.Lock()
// Return connection-level flow control.
if unread > 0 {
cc.fr.WriteWindowUpdate(0, uint32(unread))
if connAdd > 0 {
cc.fr.WriteWindowUpdate(0, uint32(connAdd))
}
cc.bw.Flush()
cc.wmu.Unlock()
@ -2628,13 +2610,18 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error {
// But at least return their flow control:
if f.Length > 0 {
cc.mu.Lock()
cc.inflow.add(int32(f.Length))
ok := cc.inflow.take(f.Length)
connAdd := cc.inflow.add(int(f.Length))
cc.mu.Unlock()
cc.wmu.Lock()
cc.fr.WriteWindowUpdate(0, uint32(f.Length))
cc.bw.Flush()
cc.wmu.Unlock()
if !ok {
return ConnectionError(ErrCodeFlowControl)
}
if connAdd > 0 {
cc.wmu.Lock()
cc.fr.WriteWindowUpdate(0, uint32(connAdd))
cc.bw.Flush()
cc.wmu.Unlock()
}
}
return nil
}
@ -2665,9 +2652,7 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error {
}
// Check connection-level flow control.
cc.mu.Lock()
if cs.inflow.available() >= int32(f.Length) {
cs.inflow.take(int32(f.Length))
} else {
if !takeInflows(&cc.inflow, &cs.inflow, f.Length) {
cc.mu.Unlock()
return ConnectionError(ErrCodeFlowControl)
}
@ -2689,19 +2674,20 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error {
}
}
if refund > 0 {
cc.inflow.add(int32(refund))
if !didReset {
cs.inflow.add(int32(refund))
}
sendConn := cc.inflow.add(refund)
var sendStream int32
if !didReset {
sendStream = cs.inflow.add(refund)
}
cc.mu.Unlock()
if refund > 0 {
if sendConn > 0 || sendStream > 0 {
cc.wmu.Lock()
cc.fr.WriteWindowUpdate(0, uint32(refund))
if !didReset {
cc.fr.WriteWindowUpdate(cs.ID, uint32(refund))
if sendConn > 0 {
cc.fr.WriteWindowUpdate(0, uint32(sendConn))
}
if sendStream > 0 {
cc.fr.WriteWindowUpdate(cs.ID, uint32(sendStream))
}
cc.bw.Flush()
cc.wmu.Unlock()

View file

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gccgo && !aix
// +build gccgo,!aix
//go:build gccgo && !aix && !hurd
// +build gccgo,!aix,!hurd
package unix

View file

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build gccgo
// +build !aix
// +build gccgo,!hurd
// +build !aix,!hurd
#include <errno.h>
#include <stdint.h>

View file

@ -2,8 +2,8 @@
// 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
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
package unix

View file

@ -174,10 +174,10 @@ openbsd_arm64)
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
openbsd_mips64)
mkasm="go run mkasm.go"
mkerrors="$mkerrors -m64"
mksyscall="go run mksyscall.go -openbsd"
mksyscall="go run mksyscall.go -openbsd -libc"
mksysctl="go run mksysctl_openbsd.go"
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
# Let the type of C char be signed for making the bare syscall
# API consistent across platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"

View file

@ -255,6 +255,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)

View file

@ -319,6 +319,7 @@ func PtraceSingleStep(pid int) (err error) {
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)

22
vendor/golang.org/x/sys/unix/syscall_hurd.go generated vendored Normal file
View file

@ -0,0 +1,22 @@
// Copyright 2022 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 hurd
// +build hurd
package unix
/*
#include <stdint.h>
int ioctl(int, unsigned long int, uintptr_t);
*/
import "C"
func ioctl(fd int, req uint, arg uintptr) (err error) {
r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg))
if r0 == -1 && er != nil {
err = er
}
return
}

29
vendor/golang.org/x/sys/unix/syscall_hurd_386.go generated vendored Normal file
View file

@ -0,0 +1,29 @@
// Copyright 2022 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 386 && hurd
// +build 386,hurd
package unix
const (
TIOCGETA = 0x62251713
)
type Winsize struct {
Row uint16
Col uint16
Xpixel uint16
Ypixel uint16
}
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Cc [20]uint8
Ispeed int32
Ospeed int32
}

View file

@ -1973,36 +1973,46 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2
//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2
func bytes2iovec(bs [][]byte) []Iovec {
iovecs := make([]Iovec, len(bs))
for i, b := range bs {
iovecs[i].SetLen(len(b))
// minIovec is the size of the small initial allocation used by
// Readv, Writev, etc.
//
// This small allocation gets stack allocated, which lets the
// common use case of len(iovs) <= minIovs avoid more expensive
// heap allocations.
const minIovec = 8
// appendBytes converts bs to Iovecs and appends them to vecs.
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
for _, b := range bs {
var v Iovec
v.SetLen(len(b))
if len(b) > 0 {
iovecs[i].Base = &b[0]
v.Base = &b[0]
} else {
iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero))
v.Base = (*byte)(unsafe.Pointer(&_zero))
}
vecs = append(vecs, v)
}
return iovecs
return vecs
}
// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit
// systems, hi will always be 0. On 32-bit systems, offs will be split in half.
// preadv/pwritev chose this calling convention so they don't need to add a
// padding-register for alignment on ARM.
// offs2lohi splits offs into its low and high order bits.
func offs2lohi(offs int64) (lo, hi uintptr) {
return uintptr(offs), uintptr(uint64(offs) >> SizeofLong)
const longBits = SizeofLong * 8
return uintptr(offs), uintptr(uint64(offs) >> longBits)
}
func Readv(fd int, iovs [][]byte) (n int, err error) {
iovecs := bytes2iovec(iovs)
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = readv(fd, iovecs)
readvRacedetect(iovecs, n, err)
return n, err
}
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := bytes2iovec(iovs)
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
lo, hi := offs2lohi(offset)
n, err = preadv(fd, iovecs, lo, hi)
readvRacedetect(iovecs, n, err)
@ -2010,7 +2020,8 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
}
func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
iovecs := bytes2iovec(iovs)
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
lo, hi := offs2lohi(offset)
n, err = preadv2(fd, iovecs, lo, hi, flags)
readvRacedetect(iovecs, n, err)
@ -2037,7 +2048,8 @@ func readvRacedetect(iovecs []Iovec, n int, err error) {
}
func Writev(fd int, iovs [][]byte) (n int, err error) {
iovecs := bytes2iovec(iovs)
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
@ -2047,7 +2059,8 @@ func Writev(fd int, iovs [][]byte) (n int, err error) {
}
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := bytes2iovec(iovs)
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
@ -2058,7 +2071,8 @@ func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
}
func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
iovecs := bytes2iovec(iovs)
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}

View file

@ -110,6 +110,20 @@ func direntNamlen(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
}
func SysctlUvmexp(name string) (*Uvmexp, error) {
mib, err := sysctlmib(name)
if err != nil {
return nil, err
}
n := uintptr(SizeofUvmexp)
var u Uvmexp
if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil {
return nil, err
}
return &u, nil
}
func Pipe(p []int) (err error) {
return Pipe2(p, 0)
}
@ -245,6 +259,7 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)

Some files were not shown because too many files have changed in this diff Show more